Clear Filters
Clear Filters

tools for LVQ RBF and GRNN and PNN alike nftool nprtool nctool & ntstool

2 views (last 30 days)
Similar to tools : nftool nprtool nctool ntstool ,
which simulate the 'functioning or NN execution' and indicate the graphical process and also be able to save the developed code and keep a file for later use;
are there any tools for learning and creating LVQ RBF and GRNN and PNN types of NN

Answers (1)

Jash Kadu
Jash Kadu on 13 Jul 2022
  3 Comments
Jash Kadu
Jash Kadu on 14 Jul 2022
Hi Yogini!
Please share the code and any necessary documentations/screenshot so I can help you out with it.
Thanks
yogini prabhu
yogini prabhu on 14 Jul 2022
yes
Following is the code (Kindly assume some the inputs and targets matix )
hiddenLayerSize = 10; net = patternnet(hiddenLayerSize);
% Choose the Performance Function
net.trainFcn = 'trainscg';
for i = 1:k
net = configure(net,input,target);
testIdx = (cvFolds == i);
trainIdx = ~testIdx;
trInd = find(trainIdx)
tstInd = find(testIdx)
net.trainParam.epochs = 100;
net.divideParam.trainInd = trInd
net.divideParam.testInd = tstInd
% Performance Function
net.performFcn = 'mse'; % Mean squared error
% Train the network
[net, tr] = train(net,input,target);
net.trainParam.showCommandLine=true; % training information will be displayed in the command line
% test using test instances
output = net(input);
errors = gsubtract(target, output);
performance = perform(net,target,output)
% Recalculate Training, Validation and Test Performance
trainTargets = target .* tr.trainMask{1};
testTargets = target .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,output)
testPerformance = perform(net,testTargets,output)
test(k)=testPerformance;
% Plot confusion
save net
figure, plotconfusion(target,output)
end
accuracy=mean(test);
accuracy_percentage=accuracy*100;
% View the Network
view(net)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!