- However, it does not directly provide options to display metrics computed over the entire training or validation set during training.
- To achieve this, the training loop should be customised using a custom training loop approach.
- Set hyperparameters like learning rate, number of epochs, and mini-batch size.
- Iterate over number of epochs.
- Within each epoch, iterate over mini-batches and compute predictions for mini-batch.
- Compute the gradients of the loss with respect to model parameters.
- Improve the model's performance by minimizing the loss using an optimization algorithm.
- Compute the MSE over the training and validation datasets after each mini-batch update. Here’s a sample code snippet:
- Plot the MSE for both training and validation datasets throughout the training process using “addpoints” and “drawnow”.