Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MLP can be used for both regression and classification. For both tasks, we need first initialize the MLP model by specifying the parameters.

Train the model

For training, the following things need to be specified:

...

Parameter

Description

training.max.iterations

The maximum number of iterations (a.k.a. epoch) for training.

training.batch.size

As the mini-batch update is leveraged for training, this parameter specify how many training instances are used in one batch.

convergence.check.interval

If this parameters is set, then the model will be checked every time when the iteration is a multiple of this parameter. If the convergence condition is satisfied, the training will terminate immediately.

tasks

The number of concurrent tasks.

Use the trained model

Once the model is trained and stored, it can be reused later.

No Format

  String modelPath = ...;  // the location of the existing model

  DoubleVector features = ...; // the features of an instance
  SmallLayeredNeuralNetwork ann = new SmallLayeredNeuralNetwork(modelPath);
  DoubleVector labels = ann.getOutput(instance);  // the label evaluated by the model

Two class learning problem

...