Moh
Moh

Reputation: 2087

Need help on Hopfield Simulation function

I have trained a Hopfiled network using newhop function, when I am simulating this network for my test input data, [y,Pf,Af] = sim(net,{1 repeatnum},{},{im1}); it is working properly but the problem is that it gets number of iterations as an input argument e.g. 100 iterations. The network may converge on the input data for example in 5th iteration and there's no need to continue the simulation. Is there any way to simulate until the convergence of network?

Regards!

Upvotes: 2

Views: 774

Answers (1)

cyborg
cyborg

Reputation: 10139

Check out net.adaptParam.goal.

If necessary, set net.adaptFcn and net.adaptParam properly and according to the help of help nntrain.

From help traingd:

Training stops when any of these conditions occurs:
 1) The maximum number of EPOCHS (repetitions) is reached.
 2) The maximum amount of TIME has been exceeded.
 3) Performance has been minimized to the GOAL.
 4) The performance gradient falls below MINGRAD.
 5) Validation performance has increased more than MAX_FAIL times
    since the last time it decreased (when using validation).

Upvotes: 1

Related Questions