How do I change number of hidden layer in nntraintool?

조회 수: 3 (최근 30일)
Yonten Dubjur
Yonten Dubjur 2019년 5월 22일
답변: Adarsh 2025년 1월 23일
How do i change number of hidden layer in nntraintool? Thank you
  댓글 수: 1
Halsey
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
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.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by