I am using neurolab in python to create a neural netowork. I create a newff network and use the default train_bfgs training function. My problem is many times, the training ends before either the epoch ends, or even the goal of the error is reached. I looked around and found a post on the neurolabs github page, where they explained why this was happening. My problem is that if I re-run the program several times, it just catches and training starts, and then the error also drops (probably some random starting weights are much better than others). What I want to do is put some kind of test check on the workout, so that if the error is too high, and the workouts that have passed it are not even close to the sum, then reinstall the network (itβs like repeating a program) (possibly resetting the network weight by default)
Here is what I wrote, but obviously it is not working
trainingComplete = False while not trainingComplete: error = net.train(trainingData, TS, epochs=50, show=10, goal=0.001) if len(error) < 0.8*epochs: if len(error) > 0 and min(error) < 0.01: trainingComplete = True else: net.reset() continue else: trainingComplete = True
what happens when it passes the first condition, that is, there are too few training eras, it runs net.reset() before restarting, but then there is no training that happens, and it becomes an endless loop. Any idea what I am missing?
thanks
source share