jeffheaton / encog-java-core

http://www.heatonresearch.com/encog
Other
742 stars 268 forks source link

Bug in EndMinutesStrategy #166

Closed wiemp closed 10 years ago

wiemp commented 10 years ago

Hello Jeff, I've discovered the following bug in class EndMinutesStrategy: In the method "postIteration" you set the remaining minutes to

this.minutesLeft.set((int)((now - this.startedTime)/60000));

but this is actually the runtime of the training in minutes, not the amount of minutes left. So, the calculated runtime should be subtracted from the initial number of left minutes instead. In the current implementation, the stop condition is met right after the first iteration, where the runtime is still below 1 minute and therefore, minutesLeft will be set to "0", which results in in the shouldStop method to return "true". I also don't think, the shouldStop method is ok, when it's checked against "minutesLeft >= 0".

regards, Winfried

otearle commented 10 years ago

Bump. I've found this too

trigeorgis commented 10 years ago

Made a pull request #180 to fix this issue

jeffheaton commented 10 years ago

Thanks for the pull request, I will take a look.

jeffheaton commented 10 years ago

I tested the code and it appears to work, closing issue, and adding to Encog 3.3