Closed taoyuan closed 1 year ago
Hello!
First at all, good catch. Yes, is an issue, it should be initialized so what is wrong are the tests.
Now the curious part: as k is undefined, the loop is not executed. I'm testing with my corpus in different languages, and the scale of the difference is at 1/1000:
It has some sense, as this loop is only executed when there is no error at the perceptron, it achieved error 0, but we add a little delta because of the momentum (no spread of the error is done as there is no error).
Basically, don't having this loop improves the time performance, but having this loop is more correct from an algebraic stand point... Right now I don't know if remove this part (better time perfomance) or correct it (mathematically correct).
Closing due to inactivity
Here
k
is not initialize. https://github.com/axa-group/nlp.js/blob/38745194f88b88a2cac32e374dbb37f48e11e79c/packages/neural/src/neural-network.js#L243-L247If init
k
with0
the below testing will be failed.
https://github.com/axa-group/nlp.js/blob/38745194f88b88a2cac32e374dbb37f48e11e79c/packages/neural/test/neural-network.test.js#L108-L118