How can I use fitnet coefficients of my older neural network in training a new one?

조회 수: 12 (최근 30일)
Vahagn
Vahagn 2023년 4월 18일
답변: Prasanna 2024년 12월 4일
Hi everyone,
I am using neural network for function fitting using fitnet command. First, I trained it using some inputs my input is a matrix 231x5000 and target is 8x5000. Now I want to add new inputs to my input matrix and to train a new neural network. The new input would be (231 + y)x5000 and the target is the same as on old problem 8x5000. How can I use the coefficients that I obtained from the first model in order to increase the computation time?

답변 (1개)

Prasanna
Prasanna 2024년 12월 4일
Hi Vahagn,
To use the weights and biases from your first trained neural network to initialize a new network with additional inputs, you can refer these steps:
  • Extract the weights and biases from the first model using the ‘getwb’ function.
  • Create the new network with the updated input size using the ‘fitnet’ method. The ‘fitnet’ method returns a function fitting neural network with a new hidden layer size.
  • Initialize the new network with the extracted weights using the ‘setwb’ function. You may need to adjust the weights to match the new input size accordingly.
  • Train the new network with the updated input data.
For more information regarding the functions used, refer the following documentations:

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by