d20fc092d6454011da6c306975e740a5875f97e7,eval.py,,,#,22

Before Change


    infos = utils.pickle_load(f)

// override and collect parameters
if len(opt.input_fc_dir) == 0:
    opt.input_fc_dir = infos["opt"].input_fc_dir
    opt.input_att_dir = infos["opt"].input_att_dir
    opt.input_box_dir = getattr(infos["opt"], "input_box_dir", "")
    opt.input_label_h5 = infos["opt"].input_label_h5
if len(opt.input_json) == 0:
    opt.input_json = infos["opt"].input_json
if opt.batch_size == 0:
    opt.batch_size = infos["opt"].batch_size
if len(opt.id) == 0:
    opt.id = infos["opt"].id
ignore = ["id", "batch_size", "beam_size", "start_from", "language_eval", "block_trigrams"]

for k in vars(infos["opt"]).keys():
    if k not in ignore:

After Change


parser.add_argument("--verbose_loss", type=int, default=0, 
                help="if we need to calculate loss.")

opt = parser.parse_args()

// Load infos
with open(opt.infos_path) as f:
    infos = utils.pickle_load(f)

// override and collect parameters
replace = ["input_fc_dir", "input_att_dir", "input_box_dir", "input_label_h5", "input_json", "batch_size", "id"]
ignore = ["start_from"]

for k in vars(infos["opt"]).keys():
    if k in replace:
        setattr(opt, k, getattr(opt, k) or getattr(infos["opt"], k))
    elif k not in ignore:
        if not k in vars(opt):
            vars(opt).update({k: vars(infos["opt"])[k]}) // copy over options from model
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 44

Instances


Project Name: ruotianluo/self-critical.pytorch
Commit Name: d20fc092d6454011da6c306975e740a5875f97e7
Time: 2019-04-18
Author: rluo@ttic.edu
File Name: eval.py
Class Name:
Method Name:


Project Name: ruotianluo/self-critical.pytorch
Commit Name: a710695ec2319935068396453896d5341759c1c9
Time: 2019-04-18
Author: rluo@ttic.edu
File Name: eval_ensemble.py
Class Name:
Method Name:


Project Name: ruotianluo/self-critical.pytorch
Commit Name: d20fc092d6454011da6c306975e740a5875f97e7
Time: 2019-04-18
Author: rluo@ttic.edu
File Name: eval.py
Class Name:
Method Name: