Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bbars opened this issue Jul 21, 2021 · 0 comments
Open

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

bbars opened this issue Jul 21, 2021 · 0 comments

Comments

@bbars
Copy link

bbars commented Jul 21, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant