How do I change number of hidden layer in nntraintool?
2 次查看(过去 30 天)
显示 更早的评论
How do i change number of hidden layer in nntraintool? Thank you
1 个评论
Halsey
2019-11-30
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?
回答(1 个)
Adarsh
2025-1-23
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!