MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / fit

Method fit

tensorpack/contrib/keras.py:279–294  ·  view source on GitHub ↗

Args: validation_data (DataFlow or InputSource): to be used for inference. The inference callback is added as the first in the callback list. If you need to use it in a different order, please write it in the callback list manually. kw

(self, validation_data=None, **kwargs)

Source from the content-addressed store, hash-verified

277 metrics=metrics)
278
279 def fit(self, validation_data=None, **kwargs):
280 """
281 Args:
282 validation_data (DataFlow or InputSource): to be used for inference.
283 The inference callback is added as the first in the callback list.
284 If you need to use it in a different order, please write it in the callback list manually.
285 kwargs: same arguments as :meth:`Trainer.train_with_defaults`.
286 """
287 callbacks = kwargs.pop('callbacks', [])
288 if validation_data is not None:
289 # There is no way to guess where users want this callback. So we have to choose one.
290 # MinSaver may need results from this callback,
291 # so we put this callback at first.
292 callbacks.insert(0, InferenceRunner(
293 validation_data, ScalarStats(self._stats_to_inference)))
294 self.trainer.train_with_defaults(callbacks=callbacks, **kwargs)

Callers 1

mnist-keras-v2.pyFile · 0.80

Calls 3

InferenceRunnerClass · 0.85
ScalarStatsClass · 0.85
train_with_defaultsMethod · 0.80

Tested by

no test coverage detected