Exemple #1
0
        return performance_dict


if __name__ == '__main__':

    parser = argparse.ArgumentParser(
        description='running experiments on multimodal datasets.')
    parser.add_argument('-config',
                        action='store',
                        dest='config_file',
                        help='please enter configuration file.',
                        default='config/run.ini')
    args = parser.parse_args()
    params = Params()
    params.parse_config(args.config_file)
    params.config_file = args.config_file
    mode = 'run'
    if 'mode' in params.__dict__:
        mode = params.mode
    set_seed(params)

    params.device = torch.device(
        'cuda') if torch.cuda.is_available() else torch.device('cpu')

    if mode == 'run':
        results = []
        reader = setup(params)
        reader.read(params)
        print(params.output_dim_emo)
        params.reader = reader
Exemple #2
0
def print_result_from_dir(dir_path):
    params = Params()
    params.parse_config(os.path.join(dir_path, 'config.ini'))
    reader = open(os.path.join(dir_path,'eval'),'r')
    s = reader.readline().split()
    print('dataset: {}, network_type: {}, acc: {}, f1:{}'.format(params.dataset_name,params.network_type,s[2],s[5]))