- Added validation loss tracking to the training method
- After training, rather than saving the parameters from the final epoch of training, the parameters from the epoch with the best loss are saved. If a validation set is provided, this reference loss is the validation loss. If not, the reference loss is the training loss.