Outputs of the second layer in PNN neural network

1 view (last 30 days)
How to get the output response of the second layer in PNN network when use the command : newpnn in matlab.

Answers (1)

Snehal
Snehal on 19 Feb 2025
Hello,
In a Probabilistic Neural Network (PNN) created using MATLAB's ‘newpnn’ function, the layers are structured as follows:
  1. Input Layer: Passes the input features directly to the pattern layer without any computation
  2. Pattern Layer (First Computational Layer): Computes similarity scores between the input and each training sample using a radial basis function
  3. Summation Layer (Second Computational Layer): Aggregates the outputs from the pattern layer for each class
  4. Decision Layer (Output Layer): Determines the class with the highest aggregated score
The Summation Layer is considered the second computational layer in a PNN, and my understanding is that you want to extract the output responses for this layer. You can use the following code snippet for implementing this:
% Let’s assume that you have already created a PNN using the following command:
% net = newpnn(P,T,spread);
% where P: matrix of input vectors
% T : matrix of target class vectors
% spread: Spread of radial basis functions
% the syntax that you can use to get the output responses is:
patternLayerOutput = radbas(dist(net.IW{1,1}, inputSample) * spread);
summationLayerOutput = net.LW{2,1} * patternLayerOutput;
Additionally, you may refer to the following documentation links for more details:
Hope this helps!

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!