Skip to content

Commit

Permalink
Fix radius calculation error in Tensor.add method
Browse files Browse the repository at this point in the history
  • Loading branch information
ersagunkuruca committed May 3, 2020
1 parent bb2d544 commit efb0275
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ts/impl/tensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default class Tensor {

add(tensor: Tensor): Tensor {
this.matrix = this.matrix.map((v, i) => v * this.r + tensor.matrix[i] * tensor.r);
this.r = 2;
this.r = Math.hypot(...this.matrix);
this.matrix = this.matrix.map(v => v / this.r);
this.oldTheta = true;
return this;
}
Expand Down

0 comments on commit efb0275

Please # to comment.