jeffheaton / encog-java-core

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

RandomTrainingFactory.generate() produces values out of given range #111

Closed tomarmo closed 11 years ago

tomarmo commented 12 years ago

While calling RandomTrainingFactory.generate( (long) (Math.random() * Long.MAX_VALUE), learnSetSize,1, 0, rangeBegin, rangeEnd); I sometimes get values out of (rangeBegin; rangeEnd) range, e.g. while asking for a (-5;5) range I get values from (-15; -5) range.

It can be helped by using (Math.random() * Integer.MAX_VALUE) as a seed instead.

jeffheaton commented 11 years ago

This is now corrected.