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

Method fit

tensorflow/contrib/learn/python/learn/trainable.py:39–90  ·  view source on GitHub ↗

Trains a model given training data `x` predictions and `y` labels. Args: x: Matrix of shape [n_samples, n_features...] or the dictionary of Matrices. Can be iterator that returns arrays of features or dictionary of arrays of features. The training inpu

(self,
          x=None,
          y=None,
          input_fn=None,
          steps=None,
          batch_size=None,
          monitors=None,
          max_steps=None)

Source from the content-addressed store, hash-verified

37
38 @abc.abstractmethod
39 def fit(self,
40 x=None,
41 y=None,
42 input_fn=None,
43 steps=None,
44 batch_size=None,
45 monitors=None,
46 max_steps=None):
47 """Trains a model given training data `x` predictions and `y` labels.
48
49 Args:
50 x: Matrix of shape [n_samples, n_features...] or the dictionary of
51 Matrices.
52 Can be iterator that returns arrays of features or dictionary of arrays
53 of features.
54 The training input samples for fitting the model. If set, `input_fn`
55 must be `None`.
56 y: Vector or matrix [n_samples] or [n_samples, n_outputs] or the
57 dictionary of same.
58 Can be iterator that returns array of labels or dictionary of array of
59 labels.
60 The training label values (class labels in classification, real numbers
61 in regression).
62 If set, `input_fn` must be `None`. Note: For classification, label
63 values must
64 be integers representing the class index (i.e. values from 0 to
65 n_classes-1).
66 input_fn: Input function returning a tuple of:
67 features - `Tensor` or dictionary of string feature name to `Tensor`.
68 labels - `Tensor` or dictionary of `Tensor` with labels.
69 If input_fn is set, `x`, `y`, and `batch_size` must be `None`.
70 steps: Number of steps for which to train model. If `None`, train forever.
71 'steps' works incrementally. If you call two times fit(steps=10) then
72 training occurs in total 20 steps. If you don't want to have incremental
73 behavior please set `max_steps` instead. If set, `max_steps` must be
74 `None`.
75 batch_size: minibatch size to use on the input, defaults to first
76 dimension of `x`. Must be `None` if `input_fn` is provided.
77 monitors: List of `BaseMonitor` subclass instances. Used for callbacks
78 inside the training loop.
79 max_steps: Number of total steps for which to train model. If `None`,
80 train forever. If set, `steps` must be `None`.
81
82 Two calls to `fit(steps=100)` means 200 training
83 iterations. On the other hand, two calls to `fit(max_steps=100)` means
84 that the second call will not do any iteration since first call did
85 all 100 steps.
86
87 Returns:
88 `self`, for chaining.
89 """
90 raise NotImplementedError

Calls

no outgoing calls