ivanhk/fastText_java

Error: IndexOutOfBoundsException: Index: 0, Size: 0

Closed this issue · 7 comments

Hi, I am getting this error on all the threads
is there a workaround or a simple fix ?
Thanks

JAR=fasttext-0.0.1-SNAPSHOT-jar-with-dependencies.jar
time java -Xmx5g -jar ${JAR} supervised -lr 0.4 -dim 50 -epoch 12 -wordNgrams 12 -loss hs -bucket 10000000 -thread 1 -input fasttext_LN.tsv -output model
Read 54M words
Number of words: 292301
Number of labels: 7188
Exception in thread "Thread-0" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at fasttext.Model.buildTree(Model.java:273)
at fasttext.Model.setTargetCounts(Model.java:238)
at fasttext.FastText$TrainThread.run(FastText.java:345)

Fixed the hs buildTree bug, still need to check the correctness of generated model.

Thanks for your quick response 👍
now getting this error , which is the same error I get if not using : -loss hs:
IllegalArgumentException in fasttext.Model.computeHidden(Model.java:142)

time java -Xmx5g -jar ${JAR} supervised -lr 0.4 -dim 50 -epoch 12 -wordNgrams 12 -loss hs -bucket 10000000 -thread 1 -input fasttext_LN.tsv -output model
Read 4M words
Number of words: 93858
Number of labels: 34
Exception in thread "Thread-0" java.lang.IllegalArgumentException
at fasttext.Utils.checkArgument(Utils.java:27)
at fasttext.Vector.addRow(Vector.java:32)
at fasttext.Model.computeHidden(Model.java:142)
at fasttext.Model.update(Model.java:213)
at fasttext.FastText.supervised(FastText.java:160)
at fasttext.FastText$TrainThread.run(FastText.java:383)

fixed -wordNgrams 12, might need some time to check Hierarchical Softmax codes

error is gone , Thanks!
but model testing results are pretty low precision / recall @1.

i noticed that Hierarchical Softmax has problem, loss is very high, i need more time to test the code.

yep , Hierarchical Softmax should be very close to the results without it .
and currently is pretty far .
Thanks

Hierarchical Softmax, Negative Sampling bug is fixed.