mljs / matrix-convolution

Matrix convolution.

Home Page:https://mljs.github.io/matrix-convolution/

Repository from Github https://github.commljs/matrix-convolutionRepository from Github https://github.commljs/matrix-convolution

ml-matrix-convolution

NPM version npm download test coverage license

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

About

Matrix convolution.

https://mljs.github.io/matrix-convolution/

License:MIT License


Languages

Language:JavaScript 100.0%