(self)
| 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( |
nothing calls this directly
no test coverage detected