Skip to content

Matrix.substract doesn't work with Matrix and Array #3

Description

@bbars

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions