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

Function model_iteration

tensorflow/python/keras/engine/training_arrays.py:46–467  ·  view source on GitHub ↗

Loop function for arrays of data with modes TRAIN/TEST/PREDICT. Arguments: model: Keras Model instance. inputs: Either a list or dictionary of arrays, or a dataset instance. targets: List/dictionary of input arrays. sample_weights: Optional list of sample weight arrays.

(model,
                    inputs,
                    targets=None,
                    sample_weights=None,
                    batch_size=None,
                    epochs=1,
                    verbose=1,
                    callbacks=None,
                    val_inputs=None,
                    val_targets=None,
                    val_sample_weights=None,
                    shuffle=True,
                    initial_epoch=0,
                    steps_per_epoch=None,
                    validation_steps=None,
                    validation_freq=1,
                    mode=ModeKeys.TRAIN,
                    validation_in_fit=False,
                    prepared_feed_values_from_dataset=False,
                    steps_name='steps',
                    **kwargs)

Source from the content-addressed store, hash-verified

44
45
46def model_iteration(model,
47 inputs,
48 targets=None,
49 sample_weights=None,
50 batch_size=None,
51 epochs=1,
52 verbose=1,
53 callbacks=None,
54 val_inputs=None,
55 val_targets=None,
56 val_sample_weights=None,
57 shuffle=True,
58 initial_epoch=0,
59 steps_per_epoch=None,
60 validation_steps=None,
61 validation_freq=1,
62 mode=ModeKeys.TRAIN,
63 validation_in_fit=False,
64 prepared_feed_values_from_dataset=False,
65 steps_name='steps',
66 **kwargs):
67 """Loop function for arrays of data with modes TRAIN/TEST/PREDICT.
68
69 Arguments:
70 model: Keras Model instance.
71 inputs: Either a list or dictionary of arrays, or a dataset instance.
72 targets: List/dictionary of input arrays.
73 sample_weights: Optional list of sample weight arrays.
74 batch_size: Integer batch size or None if unknown.
75 epochs: Number of times to iterate over the data
76 verbose: 0, 1, or 2. Verbosity mode.
77 0 = silent, 1 = progress bar, 2 = one line per epoch.
78 Note that the progress bar is not particularly useful when
79 logged to a file, so verbose=2 is recommended when not running
80 interactively (eg, in a production environment).
81 callbacks: List of callbacks to be called during training
82 val_inputs: Either a list or dictionary of arrays, or a dataset instance.
83 val_targets: List/dictionary of target arrays.
84 val_sample_weights: Optional list of sample weight arrays.
85 shuffle: Whether to shuffle the data at the beginning of each epoch
86 concatenation of list the display names of the outputs of `f` and the
87 list of display names of the outputs of `f_val`.
88 initial_epoch: Epoch at which to start training (useful for resuming a
89 previous training run)
90 steps_per_epoch: Total number of steps (batches of samples) before
91 declaring one epoch finished and starting the next epoch. Ignored with
92 the default value of `None`.
93 validation_steps: Number of steps to run validation for (only if doing
94 validation from data tensors). Ignored with the default value of
95 `None`.
96 validation_freq: Only relevant if validation data is provided. Integer or
97 `collections_abc.Container` instance (e.g. list, tuple, etc.). If an
98 integer, specifies how many training epochs to run before a new
99 validation run is performed, e.g. `validation_freq=2` runs
100 validation every 2 epochs. If a Container, specifies the epochs on
101 which to run validation, e.g. `validation_freq=[1, 2, 10]` runs
102 validation at the end of the 1st, 2nd, and 10th epochs.
103 mode: One of ModeKeys.TRAIN/ModeKeys.TEST/ModeKeys.PREDICT.

Callers

nothing calls this directly

Calls 15

createMethod · 0.95
aggregateMethod · 0.95
finalizeMethod · 0.95
make_batchesFunction · 0.90
slice_arraysFunction · 0.90
_get_iteratorFunction · 0.85
_get_model_feedFunction · 0.85
_reinitialize_iteratorFunction · 0.85
_call_begin_hookMethod · 0.80
reset_metricsMethod · 0.80

Tested by

no test coverage detected