songcser / encog-java

Automatically exported from code.google.com/p/encog-java
0 stars 0 forks source link

integer overflow in EGB file reader for training data #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a training dataset that is large.  The one I used was 900 attributes 
and 164 ideals per row, each an integer, 
Total of 1000000 rows.   
2. Create an encog training dataset from this
3. When training, get an invalid position error In 
EncogEGBFile 
method 
setLocation 
from call 
this.fc.position(calculateIndex(row));

This is due to an integer overflow in the calculateIndex method of the same 
class.   I changed the method type to long, and the argument row to long, which 
solved the problem.  THis would only occur on LARGE datasets of course.

What is the expected output? What do you see instead?
expected no error, received stack trace.

What version of the product are you using? On what operating system?
This was with Encog 2.5.3   
The same code exists in 3.0 as well.

Please provide any additional information below.
Fix for this is outlined above.  I see minimal regression and performance risk 
to this.

Original issue reported on code.google.com by vagab...@gmail.com on 17 Apr 2011 at 10:43

GoogleCodeExporter commented 9 years ago
Thanks, I can see where that would happen.  I added a fix.

Original comment by JeffHeat...@gmail.com on 14 Jul 2011 at 1:54

GoogleCodeExporter commented 9 years ago
Fixed in Encog 3.0

Original comment by JeffHeat...@gmail.com on 15 Jul 2011 at 1:12