how to create exe file from NN toolbox trained network for testing on new data inputs
이전 댓글 표시
Hi all I created a NN using NNtoolbox to predict company failure, but now I want to create it as EXE for further analysis for new dataset so third users can use it can anyone tell me how to do that? and how to test the NN for predicating failure with using inputs of a new dataset here the code generated
if true
% Solve a Pattern Recognition Problem with a Neural Network
% Script generated by Neural Pattern Recognition app
% Created 28-May-2016 22:38:23
%
% This script assumes these variables are defined:
%
% inou - input data.
% out - target data.
x = inou';
t = out';
% 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 = 10;
net = patternnet(hiddenLayerSize);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% 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);
% View the Network
view(net)
end
답변 (1개)
Greg Heath
2016년 5월 28일
% To save
save net1;
% To use on new data in another program or from the command line
load net1
newoutput = net1(newinput);
Hope this helps.
Thank you for formally accepting my answer
Greg
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!