jeffheaton / encog-java-core

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

Double.MIN_VALUE Used Erroneously (Possibly) #255

Open deriven opened 6 years ago

deriven commented 6 years ago

I forked the code because I noticed a few places that mistakenly use Double.MIN_VALUE for comparison. But Double.MIN_VALUE is not the lowest negative value for double. Double.NEGATIVE_INFINITY is.

I say "possibly" because I'm not 100% it makes a difference in every possibility. (14 files total.) Some places use it for this.max while others use it for this.actualHigh.

Here's an example where it seems absolutely incorrect. https://github.com/encog/encog-java-core/blob/master/src/main/java/org/encog/neural/cpn/CPN.java#L150-L152

I can create a PR for this if you agree.