Neural Networks Warehouse
Artificial Intelligence Depot
"As knowledge increases, ignorance unfolds." -Kennedy
KNOWLEDGE MESSAGES SUBMIT SEARCH  
Suppressing the Matlab plots when training
quick help
 
• Suppressing the Matlab plots when training

When I create a neural network (newff) and train it, I want to stop Matlab plotting the training and printing the messages about epoch progress. I want it to be silent. How do I do this? I imagine it is a 'trainParam' but I cannot find a list of them anywhere.

Thanks for your time
Ross

5 posts.
Thursday 08 January, 12:32
Reply
• Suppressing the Matlab plots when training

No there isn't any parameter that remove the plotting of the error.
To do this you have to modify the m-files of the training functions.
For the newff the default is trainlm then:

1) open \matlab\toolbox\nnet\trainlm.m
2) comment " %" the line 300 (flag_stop=plotperf(tr,goal,this,epoch);)
3) save

Now the only output will be the text in the matlab window.

Remember that without the plot window you cannot stop the training earlier.

If you want use another training function find the "trainFcn".m file and comment the same line: flag_stop=plotperf(tr,goal,this,epoch);

Good work

42 posts.
Friday 09 January, 03:47
Reply
• Thanks

Cheers Favan
This is for an assignment so I guess I can't instruct my lecturer to edit his m files when marking!

What I'm doing is finding the best network for the given problem so I am looping newff creation with different numbers of hidden nodes. The constant stream of rapidly changing plots is a little irritating (and I'm sure it slows performance as well). You would think that display would be optional in a professional piece of kit like Matlab.

Anyway, thanks for the response. Do you have any idea where to get a full list of the trainParams?

Thanks
Ross

5 posts.
Friday 09 January, 08:15
Reply
• Matlab parameters

Matlab isn't so "professional" the only parameters existing are the ones listed in the Help or in m-file comment.
To be sure look at the first line of of a training function m-file where it says:

case 'pdefaults',

For example in the traingd.m:

case 'pdefaults',
trainParam.epochs = 100;
trainParam.goal = 0;
trainParam.lr = 0.01;
trainParam.max_fail = 5;
trainParam.mc = 0.9;
trainParam.min_grad = 1e-10;
trainParam.show = 25;
trainParam.time = inf;
net = trainParam;

As I said before the only solution is edit the m-file.
Anyway your code doesn't have to do this work; simply edit the training function you want to use and save it without changing the names.

If you don't believe that matlab sometimes isn't "professional" read the neural network toolbox help at the paragraph:

Using nueral...\Backpropagation\Fundamentals\Training

It's says:

If the new performance function on a given iteration exceeds the performance function on a previous
iteration by more than a predefined ratio max_perf_inc (typically 1.04), the new weights and biases
are discarded, and the momentum coefficient mc is set to zero.

but this trainParam doesn't and the code that makes the thing described above don't exist so the MSE is very oscillating.

42 posts.
Monday 12 January, 04:20
Reply
• surpress plots

After initializing the network (say you named it net1), use the following command

net1.trainParam.show = nan;

it'll do the trick

.petter

1 posts.
Wednesday 11 February, 13:46
Reply
• Exactly the same results when running Matlab Training over and over

I am using Matlab Neural Network. However, I am facing the following problem when running the "Sample Training Session" that was provided in the help of the Matlab Neural Network Tool box.

Every time I run the "Sample Training Session", (here attached:
Test_Sample_Training_Session.m) with the workspace "choles_all.mat" as provided in Matlab Neural Network Tool Box , I am getting different answers, different shapes of the graphs. I have tried to initialize the network, the weights, the biases..., nothing seems to unable me to get the same answer over and over.

Are there any variables that I have to initialize to obtain the exact same answers over and over when I run the program Test_Sample_Training_Session.m (or any train.m) over and over.

1 posts.
Monday 16 August, 23:06
Reply
• Suppressing the Matlab plots when training

Try

net.trainParam.show = NaN

6 posts.
Thursday 26 October, 07:53
Reply