jeffheaton / encog-java-core

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

Issue with Image downsampling #154

Closed svandreev closed 10 years ago

svandreev commented 10 years ago

Get division by 0 when downsampling the image that is already of the target size.

Caused by: java.lang.ArithmeticException: / by zero at org.encog.util.downsample.RGBDownsample.downSampleRegion(RGBDownsample.java:184) ~[encog-core-3.1.0.jar:na] at org.encog.util.downsample.SimpleIntensityDownsample.downSample(SimpleIntensityDownsample.java:74) ~[encog-core-3.1.0.jar:na] at org.encog.platformspecific.j2se.data.image.ImageMLData.downsample(ImageMLData.java:89) ~[encog-core-3.1.0.jar:na] at org.encog.platformspecific.j2se.data.image.ImageMLDataSet.downsample(ImageMLDataSet.java:125) ~[encog-core-3.1.0.jar:na] at model.net.Trainer$.train(Trainer.scala:20) ~[na:na]

jeffheaton commented 10 years ago

Thanks, good catch! Just added a fix/unit test.