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

Method on_start

tensorflow/python/keras/engine/training_v2.py:665–685  ·  view source on GitHub ↗

Provide a scope for the whole training process.

(self, model, callbacks=None, use_samples=False, verbose=0,
               mode=ModeKeys.TRAIN)

Source from the content-addressed store, hash-verified

663
664 @tf_contextlib.contextmanager
665 def on_start(self, model, callbacks=None, use_samples=False, verbose=0,
666 mode=ModeKeys.TRAIN):
667 """Provide a scope for the whole training process."""
668 # TODO(omalleyt): Handle ProgBar as part of Callbacks once hooks are ready.
669 progbar = training_utils.get_progbar(
670 model, 'samples' if use_samples else 'steps')
671 progbar.params = callbacks.params
672 progbar.params['verbose'] = verbose
673 callbacks.model.stop_training = False
674 callbacks._call_begin_hook(mode)
675 progbar.on_train_begin()
676
677 # Cache those two instance so that it can be used in other functions.
678 self.callbacks = callbacks
679 self.progbar = progbar
680
681 try:
682 yield
683 finally:
684 # End of all epochs
685 self.callbacks._call_end_hook(mode)
686
687 @tf_contextlib.contextmanager
688 def on_epoch(self, epoch=0, mode=ModeKeys.TRAIN):

Callers 2

fitMethod · 0.95
_model_iterationMethod · 0.95

Calls 3

_call_begin_hookMethod · 0.80
_call_end_hookMethod · 0.80
on_train_beginMethod · 0.45

Tested by

no test coverage detected