mxnet.gluon.contrib.estimator.batch_processor¶
Gluon Batch Processor for Estimators
Classes
BatchProcessor Class for plug and play fit_batch & evaluate_batch |
- class mxnet.gluon.contrib.estimator.batch_processor.BatchProcessor[source]¶
Bases:
objectBatchProcessor Class for plug and play fit_batch & evaluate_batch
During training or validation, data are divided into minibatches for processing. This class aims at providing hooks of training or validating on a minibatch of data. Users may provide customized fit_batch() and evaluate_batch() methods by inheriting from this class and overriding class methods.
BatchProcessorcan be used to replace fit_batch() and evaluate_batch() in the base estimator class- evaluate_batch(estimator, val_batch, batch_axis=0)[source]¶
Evaluate the estimator model on a batch of validation data.
- fit_batch(estimator, train_batch, batch_axis=0)[source]¶
Trains the estimator model on a batch of training data.
- Parameters:
- Returns:
data (List of NDArray) – Sharded data from the batch. Data is sharded with gluon.split_and_load.
label (List of NDArray) – Sharded label from the batch. Labels are sharded with gluon.split_and_load.
pred (List of NDArray) – Prediction on each of the sharded inputs.
loss (List of NDArray) – Loss on each of the sharded inputs.