jeffheaton / encog-java-core

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

CrossValidationKFold not possible with LevenbergMarquardtTraining (LMA) ? #253

Open wiemp opened 6 years ago

wiemp commented 6 years ago

Hello, I tried to use the CrossValidateSunspot example with LevenbergMarquardtTraining, which caused an java.lang.IndexOutOfBoundsException:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 249, Size: 249 at java.util.ArrayList.rangeCheck(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at org.encog.ml.data.basic.BasicMLDataSet.getRecord(BasicMLDataSet.java:253) at org.encog.ml.data.folded.FoldedDataSet.getRecord(FoldedDataSet.java:234) at org.encog.neural.networks.training.lma.LevenbergMarquardtTraining.calculateError(LevenbergMarquardtTraining.java:216) at org.encog.neural.networks.training.lma.LevenbergMarquardtTraining.iteration(LevenbergMarquardtTraining.java:264) at org.encog.neural.networks.training.cross.CrossValidationKFold.iteration(CrossValidationKFold.java:103) at org.encog.examples.neural.cross.CrossValidateSunspot.train(CrossValidateSunspot.java:143) at org.encog.examples.neural.cross.CrossValidateSunspot.run(CrossValidateSunspot.java:189) at org.encog.examples.neural.cross.CrossValidateSunspot.main(CrossValidateSunspot.java:196)

Isn't it possible, to use LMA with CrossValidationKFold? Is this a bug?

best regards