|
error = Matrix.substract(targets, outputs); |
Matrix.substract(targets, outputs) does its work on { Matrix, Matrix } and { Matrix, any (number?) }.
But it breaks things down when called with { Matrix, Array } as an arguments, which is called from the NeuralNetwork::train method:
|
train(inputArray, targetArray) { |
|
const inputs = Matrix.from_arr(inputArray); |
|
const outputs = this.predict(inputArray); |
|
const targets = Matrix.from_arr(targetArray); |
|
|
|
let prevError = null; |
|
|
|
for(let i = this.layers.length - 1; i >= 0; i--) { |
|
const layer = this.layers[i]; |
|
|
|
let error; |
|
|
|
if(!prevError) { |
|
error = Matrix.substract(targets, outputs); |
PS also there's a typo in a word subStract
multi-layer-neural-network/js/neuralnetwork.js
Line 48 in 2578278
Matrix.substract(targets, outputs)does its work on { Matrix, Matrix } and { Matrix, any (number?) }.But it breaks things down when called with { Matrix, Array } as an arguments, which is called from the
NeuralNetwork::trainmethod:multi-layer-neural-network/js/neuralnetwork.js
Lines 35 to 48 in 2578278
PS also there's a typo in a word subStract