Home › Forums › General Help (Braph 2.0) › Extracting Trained Parameters for Fine-Tuning Insights in BRAPH 2 Neural Network
- This topic has 3 replies, 2 voices, and was last updated 1 year ago by Yu-Wei Chang.
-
AuthorPosts
-
August 28, 2023 at 5:30 pm #194787Jo-Hsin ShihParticipant
Hi BRAPH 2 Team,
I have been actively using the pipeline of neural networks. Since acquiring insights into the parameters learned by the model during training would greatly enhance me to explore the process of fine-tuning for my research.
Is it available to extract the relevant parameters from a model after it has undergone training ?
Many thanks 🙂
Best,
Jo-Hsin ShihAugust 28, 2023 at 6:22 pm #194791Yu-Wei ChangModeratorHi Jo-Hsin,
Thank you for your feedback on using BRAPH 2.
Absolutely, it is possible to extract the learned parameters from a trained neural network model.
Let me guide you through the process using the “example_NN_CON_WU_Classification_AdjacencyMatrix.m” script as an illustration. After line 69, kindly integrate the following code segment:
%% extract parameters and visualize model net = classifier.get('MODEL'); % Display the layers of the network disp("Network Layers:") disp(net.Layers) % Extract and display weights and biases from a specific layer specificLayerName = 'fc1'; % Replace with the name of the desired layer layerIndex = find(strcmp({net.Layers.Name}, specificLayerName)); specificLayer = net.Layers(layerIndex); weights = specificLayer.Weights; biases = specificLayer.Bias; % Visualize the net work architecture analyzeNetwork(net)
In this code segment, the script first displays all layers within the model. Subsequently, it extracts the parameters (weights and biases) for a specified layer (in this case, ‘fc1’ – the first fully connected layer). Finally, it provides a visual representation of the overall model architecture.
I hope this reply addresses your question. Please feel free to reach out if you require further clarification.
Best,
Yu-Wei- This reply was modified 1 year ago by Yu-Wei Chang.
- This reply was modified 1 year ago by Yu-Wei Chang.
- This reply was modified 1 year ago by Yu-Wei Chang.
- This reply was modified 1 year ago by Yu-Wei Chang.
September 5, 2023 at 12:45 pm #195326Jo-Hsin ShihParticipantThank you.The way you guided me has been very helpful.
It has inspired me to seek more information in a similar manner.
I look forward to asking questions in the future as I come across them.September 5, 2023 at 2:23 pm #195327Yu-Wei ChangModeratorHi Jo-Hsin,
Many thanks! Please don’t hesitate to reach out if you have any questions or need assistance.
-
AuthorPosts
- You must be logged in to reply to this topic.