Extracting Trained Parameters for Fine-Tuning Insights in BRAPH 2 Neural Network

Home Forums General Help (Braph 2.0) Extracting Trained Parameters for Fine-Tuning Insights in BRAPH 2 Neural Network

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #194787
    Jo-Hsin Shih
    Participant

    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 Shih

    #194791
    Yu-Wei Chang
    Moderator

    Hi 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

    #195326
    Jo-Hsin Shih
    Participant

    Thank 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.

    #195327
    Yu-Wei Chang
    Moderator

    Hi Jo-Hsin,

    Many thanks! Please don’t hesitate to reach out if you have any questions or need assistance.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.