ml-matrix-convolution
v1.0.0
Published
Matrix convolution: It offers the direct and the fourier transform convolution
Downloads
68,070
Readme
ml-matrix-convolution
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