How do I change number of hidden layer in nntraintool?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How do i change number of hidden layer in nntraintool? Thank you
1 comentario
Halsey
el 30 de Nov. de 2019
Hi, i wish to decrese the hidden layer from 2 layers to only 1, i am using nntraintool via script. Did you found solution for your problem? Mind to share with me how to solve it?
Respuestas (1)
Adarsh
el 23 de En. de 2025
I have gone through the MATLAB documentation and found that the “nntraintool” function is a medium to manually open and close the Neural Network training window. This window can be used to control the training, visualize the network and visualize the performance throughout training as it provides various plots such as the performance plot and error histogram.
However, modification of network architecture parameters such as hidden layers is directly not possible through the “nntraintool” function. The configuration of hidden layers should be decided while creating the network architecture itself before passing it as an input argument to the “train” function.
Upon searching the latest MATLAB documentation of R2024b release, I found that the “nntraintool” is removed and the “train” function can be used which directly opens the Neural Network training window. Here is the link to the documentation section regarding the removal of “nntraintool”:
Here is an example demonstrating the training of Neural Network with custom no of hidden layers and training the network and visualizing it:
neuralnetwork = feedforwardnet([10 2]); %creates a network with two hidden layers one with 10 neurons and other with 2 neurons
neuralnetwork = configure(neuralnetwork, X_train', Y_train');
neuralnetwork.performFcn = 'crossentropy';
neuralnetwork = train(neuralnetwork, X_train', Y_train'); %automatically opens the training window
I hope this helps in resolving the question.
0 comentarios
Ver también
Categorías
Más información sobre Deep Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!