DoubleBuffer vectors = ByteBuffer.allocateDirect(vocabSize * layerSize * 8).asDoubleBuffer();
this line was throwing error since the int multiplication vocabSize * layerSize * 8 > Integer.MAX_VALUE so negative number was passed into the method.
As a dirty fix i change it to the following:
DoubleBuffer vectors = DoubleBuffer.allocate(1000000000);
DoubleBuffer vectors = ByteBuffer.allocateDirect(vocabSize * layerSize * 8).asDoubleBuffer();
this line was throwing error since the int multiplication vocabSize * layerSize * 8 > Integer.MAX_VALUE so negative number was passed into the method.
As a dirty fix i change it to the following:
DoubleBuffer vectors = DoubleBuffer.allocate(1000000000);