Table Of Contents
Table Of Contents

mxnet.model.FeedForward

class mxnet.model.FeedForward(symbol, ctx=None, num_epoch=None, epoch_size=None, optimizer='sgd', initializer=<mxnet.initializer.Uniform object>, numpy_batch_size=128, arg_params=None, aux_params=None, allow_extra_params=False, begin_epoch=0, **kwargs)[source]

Model class of MXNet for training and predicting feedforward nets. This class is designed for a single-data single output supervised network.

Parameters
  • symbol (Symbol) – The symbol configuration of computation network.

  • ctx (Context or list of Context, optional) – The device context of training and prediction. To use multi GPU training, pass in a list of gpu contexts.

  • num_epoch (int, optional) – Training parameter, number of training epochs(epochs).

  • epoch_size (int, optional) – Number of batches in a epoch. In default, it is set to ceil(num_train_examples / batch_size).

  • optimizer (str or Optimizer, optional) – Training parameter, name or optimizer object for training.

  • initializer (initializer function, optional) – Training parameter, the initialization scheme used.

  • numpy_batch_size (int, optional) – The batch size of training data. Only needed when input array is numpy.

  • arg_params (dict of str to NDArray, optional) – Model parameter, dict of name to NDArray of net’s weights.

  • aux_params (dict of str to NDArray, optional) – Model parameter, dict of name to NDArray of net’s auxiliary states.

  • allow_extra_params (boolean, optional) – Whether allow extra parameters that are not needed by symbol to be passed by aux_params and arg_params. If this is True, no error will be thrown when aux_params and arg_params contain more parameters than needed.

  • begin_epoch (int, optional) – The begining training epoch.

  • kwargs (dict) – The additional keyword arguments passed to optimizer.

__init__(symbol, ctx=None, num_epoch=None, epoch_size=None, optimizer='sgd', initializer=<mxnet.initializer.Uniform object>, numpy_batch_size=128, arg_params=None, aux_params=None, allow_extra_params=False, begin_epoch=0, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(symbol[, ctx, num_epoch, …])

Initialize self.

create(symbol, X[, y, ctx, num_epoch, …])

Functional style to create a model.

fit(X[, y, eval_data, eval_metric, …])

Fit the model.

load(prefix, epoch[, ctx])

Load model checkpoint from file.

predict(X[, num_batch, return_data, reset])

Run the prediction, always only use one device.

save(prefix[, epoch])

Checkpoint the model checkpoint into file.

score(X[, eval_metric, num_batch, …])

Run the model given an input and calculate the score as assessed by an evaluation metric.