Skip to content

Commit

Permalink
Merge pull request #119 from stanford-oval/wip/training-progress
Browse files Browse the repository at this point in the history
training: fix computing progress for contextual
  • Loading branch information
gcampax committed Dec 16, 2019
2 parents 40baf8f + 85e1cc4 commit d5f79a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/training/decanlp.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ module.exports = class DecaNLPTrainingJob extends BaseTrainingJob {

this.metrics = {};
await execCommand(this, 'decanlp', args, (line) => {
const match = /train_[a-z]+:([0-9]+)\/[0-9]+:val_[a-z]+:(.*)$/.exec(line);
// the line we are looking for has the form:
// ...:train_contextual_almond:70000/100000:val_deca:...
// or
// ...:train_almond:70000/100000:val_deca:...
const match = /train_[a-z_]+:([0-9]+)\/[0-9]+:val_[a-z_]+:(.*)$/.exec(line);
if (match === null)
return;
this.progress = parseFloat(match[1])/this._config.train_iterations;
Expand Down

0 comments on commit d5f79a0

Please sign in to comment.