Reuse of Weights and Biases in CNN
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone, I have applied a 1D CNN to a training dataset with dimensions 60095×39 and obtained the attached network. Now, I would like to extract the weights and biases corresponding to feature 2 (column 2) and then retrain the network using only feature 2 with dimensions 60095×1, utilizing the weights from the previous training. Could you please guide me on how to achieve this?
You can find the attached network.
Thanks in advance.
1 件のコメント
Debraj Maji
2023 年 11 月 21 日
編集済み: Debraj Maji
2023 年 11 月 24 日
Can you please clarify on what is meant by weights and biases corresponding to feature 2?
回答 (1 件)
Ayush
2023 年 12 月 5 日
編集済み: Ayush
2023 年 12 月 5 日
Hey Hamza,
I understand that you have a trained network with 39 features and 60095 data points. You want to extract the weights and biases corresponding to feature 2 (column 2) from the trained network. After extracting these parameters, you aim to retrain the new network using only feature 2 data with dimensions 60095×1, while utilizing the weights from the previous training.
To extract the weights and biases corresponding to feature 2 from the trained network, you can access these parameters using the network's property fields. Here's an example of how you might extract the weights and biases for feature 2 in MATLAB:
% Assuming your trained network is named 'trainedNet
weightsLayer2 = trainedNet.Layers(2).Weights; % Extract weights for the second layer
biasesLayer2 = trainedNet.Layers(2).Bias; % Extract biases for the second layer
For retraining the network using feature-2 , you can follow these steps:
- Prepare Feature-2 data: Prepare your training dataset using only feature 2 with dimensions 60095×1.
- Create a new network. You can use functions like “feedforwardnet” for this operation.
- Set the weights and biases of the network using properties again.
- Training the new network using “train” function .
For more information on “feedforwardnet” and “train” , refer to the MathWorks documentation link below:
- https://www.mathworks.com/help/deeplearning/ref/feedforwardnet.html
- https://www.mathworks.com/help/deeplearning/ref/network.train.html
Hope this helps!
Regards,
Ayush Goyal
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!