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

6 ビュー (過去 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 Center および File ExchangeSequence 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