MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / on_train_batch_end

Method on_train_batch_end

tensorflow/python/keras/callbacks.py:1635–1660  ·  view source on GitHub ↗

Writes scalar summaries for metrics on every training batch. Performs profiling if current batch is in profiler_batches. Arguments: batch: Integer, index of batch within the current epoch. logs: Dict. Metric results for this batch.

(self, batch, logs=None)

Source from the content-addressed store, hash-verified

1633 self._set_default_writer(self._validation_run_name)
1634
1635 def on_train_batch_end(self, batch, logs=None):
1636 """Writes scalar summaries for metrics on every training batch.
1637
1638 Performs profiling if current batch is in profiler_batches.
1639
1640 Arguments:
1641 batch: Integer, index of batch within the current epoch.
1642 logs: Dict. Metric results for this batch.
1643 """
1644 if self.update_freq == 'epoch' and self._profile_batch is None:
1645 return
1646
1647 # Don't output batch_size and batch number as TensorBoard summaries
1648 logs = logs or {}
1649 train_batches = self._total_batches_seen[self._train_run_name]
1650 if self.update_freq != 'epoch' and batch % self.update_freq == 0:
1651 self._log_metrics(logs, prefix='batch_', step=train_batches)
1652
1653 self._increment_step(self._train_run_name)
1654
1655 if context.executing_eagerly():
1656 if self._is_tracing:
1657 self._log_trace()
1658 elif (not self._is_tracing and
1659 math_ops.equal(train_batches, self._profile_batch - 1)):
1660 self._enable_trace()
1661
1662 def on_test_batch_end(self, batch, logs=None):
1663 if self.update_freq == 'epoch':

Callers

nothing calls this directly

Calls 6

_log_metricsMethod · 0.95
_increment_stepMethod · 0.95
_log_traceMethod · 0.95
_enable_traceMethod · 0.95
executing_eagerlyMethod · 0.80
equalMethod · 0.80

Tested by

no test coverage detected