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

Method on_batch_end

tensorflow/python/keras/callbacks.py:743–761  ·  view source on GitHub ↗
(self, batch, logs=None)

Source from the content-addressed store, hash-verified

741 self.log_values = []
742
743 def on_batch_end(self, batch, logs=None):
744 logs = logs or {}
745 batch_size = logs.get('size', 0)
746 # In case of distribution strategy we can potentially run multiple steps
747 # at the same time, we should account for that in the `seen` calculation.
748 num_steps = logs.get('num_steps', 1)
749 if self.use_steps:
750 self.seen += num_steps
751 else:
752 self.seen += batch_size * num_steps
753
754 for k in self.params['metrics']:
755 if k in logs:
756 self.log_values.append((k, logs[k]))
757
758 # Skip progbar update for the last batch;
759 # will be handled by on_epoch_end.
760 if self.verbose and (self.target is None or self.seen < self.target):
761 self.progbar.update(self.seen, self.log_values)
762
763 def on_epoch_end(self, epoch, logs=None):
764 logs = logs or {}

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
appendMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected