MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _setup_graph

Method _setup_graph

tensorpack/contrib/keras.py:129–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

127 self._learning_phase = keras.backend.learning_phase()
128
129 def _setup_graph(self):
130 logger.info("Using Keras learning phase {} in the graph!".format(
131 self._learning_phase.name))
132 cbs = self.trainer._callbacks.cbs
133 for cb in cbs:
134 # XXX HACK
135 if isinstance(cb, InferenceRunnerBase):
136 h = CallbackToHook(KerasPhaseCallback(False))
137 cb.register_hook(h)
138
139 def _before_run(self, ctx):
140 return tf.train.SessionRunArgs(

Callers

nothing calls this directly

Calls 4

CallbackToHookClass · 0.85
KerasPhaseCallbackClass · 0.85
formatMethod · 0.80
register_hookMethod · 0.45

Tested by

no test coverage detected