Hi,
I am using nftool to generate a neural network and using lmtrain. I want to know how do I know what the values are for the following variables:
  • initial weights
  • initial biases
  • initial mu-value
  • mu increase factor
  • mu decrease factor
Furthermore, how can I change the above parameters in nftool?
For background: I want to investigate the performance of the network using different hidden neurons, but can only actually compare the networks if the initial conditions are identical.
Thanks in advance.

 채택된 답변

Walter Roberson
Walter Roberson 2022년 8월 25일

2 개 추천

Initial weights and biases are random.
To be able to compare runs you need to use rng() to set the random seed.
Furthermore, how can I change the above parameters in nftool?
You cannot. nftool is a convenience interface for people who do not need fine control. If you need fine control, then you need to set up everything and call trainlm() yourself.

댓글 수: 4

David Ho
David Ho 2022년 8월 25일
If you would like fine control of the network parameters without starting from scratch, you can use the "Generate Code" option in the Neural Network Fitting tool to generate a script that does exactly the same training. You can then modify the parameters of the network to the values you would like.
Walter Roberson
Walter Roberson 2022년 8월 25일
Good point, @David Ho
Marlise Jacobs
Marlise Jacobs 2022년 8월 25일
@Walter Roberson Thank you so much. How do I integrate rng()? Currently, I call the nftool function from the command window, and then the app immediately opens and runs. So how do I call the rng-function before the nftool function runs?
rng(12345); nftool()
Then run one fitting (only!!) and quit nftool; repeat as needed.
But better yet would be to follow David's suggestion to use the Generate Code feature to convert the run into MATLAB code that you could then edit, including putting in an rng() call, or initializing the weights and biases yourself.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품

릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by