What are these files in the workspace?

Hello everyone. I am new to deep learning toolbox specifically the Pattern Recognization (nprtool). Can someone help me translate what are these variables stand for in my Workspace (apart from hiddenLayerSize, trainFCN, data, data_1 textdata and textdata_1 because I understand what are those) and how I did ended up getting all these data? Apparently these were generated after running my neural network. Hope someone can explain this to me. Thanks in advance.

4 comentarios

Nagasai Bharat
Nagasai Bharat el 11 de Mzo. de 2021
Hi, Can you help me to reproduce the problem by sending the code you have tried?
Habibul Aqil
Habibul Aqil el 11 de Mzo. de 2021
Editada: Habibul Aqil el 11 de Mzo. de 2021
Sure. Also can you tell me what's "e" stands for and why it requires "t" to be substracted by "y"?
% Solve a Pattern Recognition Problem with a Neural Network
% Script generated by Neural Pattern Recognition app
% Created 19-Feb-2021 12:46:05
%
% This script assumes these variables are defined:
%
% data - input data.
% data_1 - target data.
x = data';
t = data_1';
% Choose a Training Function
% For a list of all training functions type: help nntrain
% 'trainlm' is usually fastest.
% 'trainbr' takes longer but may be better for challenging problems.
% 'trainscg' uses less memory. Suitable in low memory situations.
trainFcn = 'trainscg'; % Scaled conjugate gradient backpropagation.
% Create a Pattern Recognition Network
hiddenLayerSize = 50;
net = patternnet(hiddenLayerSize, trainFcn);
% Choose Input and Output Pre/Post-Processing Functions
% For a list of all processing functions type: help nnprocess
net.input.processFcns = {'removeconstantrows','mapminmax'};
% Setup Division of Data for Training, Validation, Testing
% For a list of all data division functions type: help nndivision
net.divideFcn = 'dividerand'; % Divide data randomly
net.divideMode = 'sample'; % Divide up every sample
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Choose a Performance Function
% For a list of all performance functions type: help nnperformance
net.performFcn = 'crossentropy'; % Cross-Entropy
% Choose Plot Functions
% For a list of all plot functions type: help nnplot
net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...
'plotconfusion', 'plotroc'};
% Train the Network
[net,tr] = train(net,x,t);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
tind = vec2ind(t);
yind = vec2ind(y);
percentErrors = sum(tind ~= yind)/numel(tind);
% Recalculate Training, Validation and Test Performance
trainTargets = t .* tr.trainMask{1};
valTargets = t .* tr.valMask{1};
testTargets = t .* tr.testMask{1};
trainPerformance = perform(net,trainTargets,y)
valPerformance = perform(net,valTargets,y)
testPerformance = perform(net,testTargets,y)
% View the Network
view(net)
% Plots
% Uncomment these lines to enable various plots.
%figure, plotperform(tr)
%figure, plottrainstate(tr)
%figure, ploterrhist(e)
%figure, plotconfusion(t,y)
%figure, plotroc(t,y)
% Deployment
% Change the (false) values to (true) to enable the following code blocks.
% See the help for each generation function for more information.
if (false)
% Generate MATLAB function for neural network for application
% deployment in MATLAB scripts or with MATLAB Compiler and Builder
% tools, or simply to examine the calculations your trained neural
% network performs.
genFunction(net,'myNeuralNetworkFunction');
y = myNeuralNetworkFunction(x);
end
if (false)
% Generate a matrix-only MATLAB function for neural network code
% generation with MATLAB Coder tools.
genFunction(net,'myNeuralNetworkFunction','MatrixOnly','yes');
y = myNeuralNetworkFunction(x);
end
if (false)
% Generate a Simulink diagram for simulation or deployment with.
% Simulink Coder tools.
gensim(net);
end
Walter Roberson
Walter Roberson el 11 de Mzo. de 2021
e is error, actual value minus predicted value.
It is not used in the code unless you remove the comment marker on the ploterrhist(e) line.
Habibul Aqil
Habibul Aqil el 11 de Mzo. de 2021
I checked the values of "e" and some of them are positives and the rest are negatives. Why is this the case?

Iniciar sesión para comentar.

 Respuesta aceptada

Nagasai Bharat
Nagasai Bharat el 11 de Mzo. de 2021

0 votos

Hi,
"t" represents the ground truth of your data. As suggested you could choose not to plot the error. The extra variables are created by the nprtool. You could modify the code by yourself to reduce the variables hence keeping the logic same.

3 comentarios

Habibul Aqil
Habibul Aqil el 11 de Mzo. de 2021
Editada: Habibul Aqil el 11 de Mzo. de 2021
Okay. Can I ask another question? How does "net" work from the part of my code: "y = net(x)"? How did I end up getting y when I use "net" alongside the x matrix? Is there any particular equation used in "net"?
Here's my x and y matrices in my xlsx Excel files for reference above
net uses the network which work was previously trained by your dataset due to this command.
[net,tr] = train(net,x,t);
After training it takes in x value and gives the predicted output.
Habibul Aqil
Habibul Aqil el 11 de Mzo. de 2021
I see. Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 5 de Mzo. de 2021

Comentada:

el 11 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by