Closed dktcoding closed 7 years ago
Accessing element [0] is just for initialization purposes. As all answer vectors should have the same dimensions and it's assume there is at least 1 answer pattern, it doesn't matter really if its the 0, 1 or X. On the other hand, maybe there are not enough answers to access the offset (input validation should enter here to avoid this, though). Accessing the element 0 it's the safest simpler option. About the offset+length, input validation should cover this case as well.
Yeahp, I'll cancel the PR and start working on input validation.
This is actually a minor issue, but when calling
NeuralNetwork#error()
orMLP#train()
with an offset, values outside the range[offset, offset + length]
should be completely ignored, thus they could very well benull
. Currently the code accesses element[0]
of the array instead of element at position[offset]
.Other NN seem to be unaffected since they handle the offset value differently.