- Choose regression model options: https://www.mathworks.com/help/releases/R2023b/stats/choose-regression-model-options.html#:~:text=Neural%20Network%20Model%20Hyperparameter%20Options This documentation shows the Neural Network model hyperparameter options available in the Regression Learner App.
- Regression Learner App: https://www.mathworks.com/help/releases/R2023b/stats/regression-learner-app.html
- trainingOptions: https://www.mathworks.com/help/releases/R2023b/deeplearning/ref/trainingoptions.html
I am using Regression Learner App for training the Neural Network. I want to know how to specify the batch size, select adam optimizer and also where to select loss function?
11 views (last 30 days)
Show older comments
In regression learner app, where can we select these options?
- Batch size
- Optimizer slection(for ex: adam optimizer)
- Loss Function
0 Comments
Accepted Answer
Abhipsa
on 7 Mar 2025
In the Regression Learner App, when utilizing Neural Networks as the model, you have several hyperparameter options. However, there are no available options for adjusting the batch size, optimizers, or loss functions.
A suitable workaround to avail the stated options would be to use trainingOptions function in the Deep Learning Toolbox.
You can refer to the below code snippet for a better understanding:
% Specify the neural network architecture
layers = [
featureInputLayer(1) % Input layer for 1 feature
fullyConnectedLayer(10) % Fully connected layer with 10 neurons
reluLayer % Activation function (ReLU)
fullyConnectedLayer(1) % Output layer (1 neuron for regression)
regressionLayer]; % Regression output layer
% Specify the training options according to your requirements
options = trainingOptions('adam', ... % Optimizer (Adam)
'MaxEpochs', 50, ... % Number of epochs
'MiniBatchSize', 10, ... % Batch size
'InitialLearnRate', 0.01, ... % Learning rate
'Plots', 'training-progress', ... % Plot training progress
'Verbose', false); % Suppress command window output
% Train the network
net = trainNetwork(data, layers, options);
For more information, you can refer to the below given MATLAB Documentations for the same:
I hope this resolves your query.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!