MATLAB Answers

0

train code of Neural Network Toolbox for GUI packaging

Asked by Jaepil Ban on 8 May 2018
Latest activity Commented on by Jaepil Ban on 15 Jun 2018

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 Comments

you may refer to this site

 https://kr.mathworks.com/help/nnet/ug/deploy-training-of-neural-networks.html

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

I'm not sure if Neural network toolbox provides the iteration numbers during the training. You may edit the 'train' code for your purpose, although it can be quite a cumbersome task.

To see and edit 'train' function, we can use "Ctrl + D" on 'train' in your code.

Sign in to comment.

0 Answers