def track_progress(**context):
model = context["<STR_LIT>"]<EOL>train_X = context["<STR_LIT>"]<EOL>dev_X = context["<STR_LIT>"]<EOL>dev_y = context["<STR_LIT>"]<EOL>n_train = len(train_X)<EOL>trainer = context["<STR_LIT>"]<EOL>def each_epoch():<EOL><INDENT>global epoch_train_acc<EOL>acc = model.evaluate(dev_X, dev_y)<EOL>with model.use_params(trainer.optimizer.averages):<EOL><INDENT>avg_acc = model.evaluate(dev_X, dev_y)<EOL><DEDENT>stats = (acc, avg_acc, float(epoch_train_acc) / n_train, trainer.dropout)<EOL>print("<STR_LIT>" % stats)<EOL>epoch_train_acc = <NUM_LIT:0.0><EOL><DEDENT>return each_epoch<EOL>
Print training progress. Called after each epoch.