870e17a6857365bec3035bfece2e77b525288b01,exp.py,,train,#Any#,50
Before Change
eval_results = evaluation.evaluate(dev_set.examples, model, args,
verbose=True, eval_top_pred_only=args.eval_top_pred_only)
dev_score = eval_results["bleu"] if args.lang == "conala" else eval_results["accuracy"]
if args.lang == "conala":
print("[Epoch %d] evaluate details: %s took %ds" % (
epoch, eval_results, time.time() - eval_start), file=sys.stderr)
else:
print("[Epoch %d] code generation accuracy=%.5f took %ds" % (
epoch, dev_score, time.time() - eval_start), file=sys.stderr)
is_better = history_dev_scores == [] or dev_score > max(history_dev_scores)
history_dev_scores.append(dev_score)
else:
is_better = True
After Change
parser_cls = get_parser_class(args.lang)
model = parser_cls(args, vocab, transition_system)
model.train()
evaluator = Registrable.by_name(args.evaluator)(transition_system)
if args.cuda: model.cuda()
optimizer_cls = eval("torch.optim.%s" % args.optimizer) // FIXME: this is evil!
optimizer = optimizer_cls(model.parameters(), lr=args.lr)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: pcyin/tranX
Commit Name: 870e17a6857365bec3035bfece2e77b525288b01
Time: 2018-11-20
Author: pcyin@cs.cmu.edu
File Name: exp.py
Class Name:
Method Name: train
Project Name: allenai/allennlp
Commit Name: 72cc9dd414ee4befbadf9bd3e4804cb2e0908e9c
Time: 2017-08-07
Author: mattg@allenai.org
File Name: allennlp/nn/initializers.py
Class Name: InitializerApplicator
Method Name: from_params
Project Name: pcyin/tranX
Commit Name: 870e17a6857365bec3035bfece2e77b525288b01
Time: 2018-11-20
Author: pcyin@cs.cmu.edu
File Name: exp.py
Class Name:
Method Name: test