tf.contrib.learn.BaseEstimator.partial_fit()

tf.contrib.learn.BaseEstimator.partial_fit(x=None, y=None, input_fn=None, steps=1, batch_size=None, monitors=None)

Incremental fit on a batch of samples.

This method is expected to be called several times consecutively on different or the same chunks of the dataset. This either can implement iterative training or out-of-core/online training.

This is especially useful when the whole dataset is too big to fit in memory at the same time. Or when model is taking long time to converge, and you want to split up training into subparts.

Args:
  • x: Matrix of shape [n_samples, n_features...]. Can be iterator that returns arrays of features. The training input samples for fitting the model. If set, input_fn must be None.
  • y: Vector or matrix [n_samples] or [n_samples, n_outputs]. Can be iterator that returns array of targets. The training target values (class labels in classification, real numbers in regression). If set, input_fn must be None.
  • input_fn: Input function. If set, x, y, and batch_size must be None.
  • steps: Number of steps for which to train model. If None, train forever.
  • batch_size: minibatch size to use on the input, defaults to first dimension of x. Must be None if input_fn is provided.
  • monitors: List of BaseMonitor subclass instances. Used for callbacks inside the training loop.
Returns:

self, for chaining.

Raises:
  • ValueError: If at least one of x and y is provided, and input_fn is provided.
doc_TensorFlow
2016-10-14 13:05:29
Comments
Leave a Comment

Please login to continue.