1.0.0 • Published 3 years ago

ml-matrix-convolution v1.0.0

Weekly downloads
2,721
License
MIT
Repository
github
Last release
3 years ago

ml-matrix-convolution

NPM version build status Test coverage npm download

Matrix convolution.

Installation

npm i ml-matrix-convolution
const MatrixConvolution = require('ml-matrix-convolution');

let matrix = [
  [1, 1, 1, 1, 1],
  [1, 1, 1, 1, 1],
  [1, 1, 1, 1, 1],
  [1, 1, 1, 1, 1],
  [1, 1, 1, 1, 1],
];

let kernel = [
  [1, 1, 1],
  [1, 1, 1],
  [1, 1, 1],
];

let conv1 = MatrixConvolution.direct(matrix, kernel);

let conv2 = MatrixConvolution.fft(matrix, kerne11);

console.log({ conv1, conv2 }); // both should be equal

License

MIT