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

5 次查看(过去 30 天)
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