train code of Neural Network Toolbox for GUI packaging
이전 댓글 표시
I'm using MATLAB 2017b and Appdesigner to make a GUI which contains 'train' code of Neural Network Toolbox. And I want to make the standalone execution program of it by using application compiler.
All lines are executable when I run on Appdesigner tool. However, after I make the standalone application, 'train' code is not executed (I made a button for executing train code).
So I wonder that it is possible to contain 'train' code in the standalone execution program.
Here are some lines of the GUI code.
----------------------------------------------------------------------------------------------------------------
function TrainButtonPushed(app, event)
if strcmp(app.TrainButton.Enable,'on')
app.TrainButton.Enable='off';
IN_IM_SEQ=app.data.IN_IM_SEQ;
OUT_SEQ=app.data.OUT_SEQ;
for j=1:6
c=train(app.net,IN_IM_SEQ,OUT_SEQ); % Training neural network
d=c(IN_IM_SEQ); % trained network ouptut
app.epochEditField.Value = j;
end
app.hb=[c.IW{1,1} c.b{1}]; % [h bias], 15 by 31
app.wb=[c.LW{2,1}'; c.b{2}];
app.net_trained=c;
app.net_out=d;
app.ExportTrainedNetworkButton.Enable='on';
app.net=[];
app.NeuralNetworkLamp.Color = [1,0,0];
app.TrainingDATALamp.Color = [1,0,0];
app.TrainedNetworkLamp.Color = [0,1,0];
end
end
댓글 수: 7
Álvaro Cuevas
2018년 6월 12일
Hi! Did you solve this? I have the same problem in my appdesigner standalone app. The button doesn't work in order to train the network :S
Jaepil Ban
2018년 6월 12일
Álvaro Cuevas
2018년 6월 12일
편집: Álvaro Cuevas
2018년 6월 12일
Hi Jaepil, thanks for answering.
I noticed that in your code you didn't call any kind of network before the training, so you had to add 'fitnet' like you said.
In my case I am using a feedforward network (not fitnet or patternnet) and I am calling the feedforwardnet function to initialize the network previous the training via:
net = feedforwardnet(hiddenLayerSize,trainingFunction);
Just as it happened to you, from appdesigner everything works correctly so I don't understand it stops working when I make the deploy :(
Another related question, the appdesigner application deployed runs on a computer that does not have matlab installed?
Jaepil Ban
2018년 6월 12일
Jaepil Ban
2018년 6월 12일
Álvaro Cuevas
2018년 6월 14일
편집: Álvaro Cuevas
2018년 6월 14일
Thanks again for your response.
I've realize that my problem is because the training progress dialog, nntraintool is not supported in deployed mode :( so I can't show the training progress on the screen as it goes through the epochs.
Is there any way to catch the value of the epochs while the training process is running?
net.trainParam.showCommandLine = true;
With the previous command we can see the process through the matlab console, but in this case I need to show it through the GUI, so I need to catch the value of every epoch during the training to notice the user how much is left to reach the end.
Thanks Jaepil
Jaepil Ban
2018년 6월 15일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!