Train neural network
Trains a model for a fixed number of epochs (iterations on a dataset).
Inputs
-
Neural network — NeuralNetwork
The neural network to train.
-
Training X — Tensor
Training input data.
-
Training Y — Tensor
Training output data.
-
Optimizer — NeuralNetworkOptimizer
Optimizer instance.
-
Loss — NeuralNetworkLoss
Objective function instance that provides the loss value to minimize.
-
Metrics — List of NeuralNetworkMetric
A list of metric instances that will be evaluated by the model during training and testing.
-
Batch size — Integer
Number of samples per gradient update.
-
Epochs — Integer
Number of epochs to train the model. An epoch is an iteration over the entire Training X and Training Y data provided.
-
Validation split — Float
Between 0 and 1. Fraction of the training data to be used as validation data. The model will set apart this fraction of the training data, will not train on it, and will evaluate the loss and any model metrics on this data at the end of each epoch. The validation data is selected from the last samples in the x and y data provided, before shuffling. Note the fact that the validation loss of data provided using Validation split is not affected by regularization layers like noise and dropout.
-
Validation X — Tensor
Input data on which to evaluate the loss and any model metrics at the end of each epoch. The model will not be trained on this data. Note the fact that the validation loss of data provided using Validation X is not affected by regularization layers like noise and dropout. Validation X will override Validation split.
-
Validation Y — Tensor
Output data on which to evaluate the loss and any model metrics at the end of each epoch. The model will not be trained on this data.
-
Shuffle — String
When to shuffle the training data.
-
Validation frequency — Integer
Specifies how many training epochs to run before a new validation run is performed, e.g. Validation frequency = “2” runs validation every 2 epochs, Only relevant if validation data is provided.
Outputs
-
History — Tensor
A record of training loss values and metrics values at successive epochs, as well as validation loss values and validation metrics values (if applicable).
-
Loss — Float
Training loss of the model after the training.
-
Metric values — DynamicObject
A DynamicObject mapping metric names to their corresponding value (Float) on the training data after the training.
-
Validation loss — Float
Validation loss of the model after the training.
-
Validation metric values — DynamicObject
A DynamicObject mapping metric names to their corresponding value (Float) on the validation data after the training.
-
Model — DynamicObject
The trained model.