I use the training function "traingd" to train a shallow neural network by using:

[trainedNet,tr] = train(net,X,T)

When the training is done, to which epoch/iteration of the training does the neural network, which is returned as trainedNet by the "train" function, correspond?

Is it the network with the weights of the last epoch of the training before stopping or is it the network with the smallest training error which occured at a certain epoch during the training?

Thanks in advance!

I use MATLAB 2013 and MATLAB 2015 with the neural network toolbox.

## Best Answer