3578019be301ae9d8e9b7518daa5fb113d00d2db,open_seq2seq/utils/hooks.py,RunEvaluationHook,after_run,#RunEvaluationHook#Any#Any#,147
Before Change
inputs_per_batch, outputs_per_batch = [], []
total_loss = 0.0
for cnt, feed_dict in enumerate(
self._model.data_layer.iterate_one_epoch(cross_over=True)
):
loss, inputs, outputs = run_context.session.run(
self._fetches, feed_dict,
)
inputs_per_batch.append(inputs)
outputs_per_batch.append(outputs)
total_loss += loss
total_loss /= (cnt + 1)
deco_print("Validation loss: {:.4f}".format(total_loss), offset=4)
dict_to_log = self._model.maybe_evaluate(
inputs_per_batch,
After Change
return
self._timer.update_last_triggered_step(self._iter_count - 1)
if not self._model.on_horovod or self._model.hvd.rank() == 0:
deco_print("Running evaluation on a validation set:")
inputs_per_batch, outputs_per_batch, total_loss = get_batches_for_epoch(
self._model, run_context.session, compute_loss=True,
)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 3578019be301ae9d8e9b7518daa5fb113d00d2db
Time: 2018-05-07
Author: igor.a.gitman@gmail.com
File Name: open_seq2seq/utils/hooks.py
Class Name: RunEvaluationHook
Method Name: after_run
Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 80373cedf76f85b47de78080712f508a46c5345c
Time: 2018-05-16
Author: okuchaiev@nvidia.com
File Name: open_seq2seq/models/text2text_test.py
Class Name: BasicText2TextWithAttentionTestOnHorovod
Method Name: test_train
Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 80373cedf76f85b47de78080712f508a46c5345c
Time: 2018-05-16
Author: okuchaiev@nvidia.com
File Name: open_seq2seq/models/text2text_test.py
Class Name: BasicText2TextWithAttentionTest
Method Name: test_train