https://github.com/mljs/matrix-convolution
Matrix convolution.
https://github.com/mljs/matrix-convolution
Last synced: 9 months ago
JSON representation
Matrix convolution.
- Host: GitHub
- URL: https://github.com/mljs/matrix-convolution
- Owner: mljs
- License: mit
- Created: 2016-07-11T07:26:18.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-03-04T07:38:03.000Z (over 4 years ago)
- Last Synced: 2025-04-12T16:12:52.408Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.17 MB
- Stars: 6
- Watchers: 8
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ml-matrix-convolution
[![NPM version][npm-image]][npm-url]
[![build status][ci-image]][ci-url]
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
Matrix convolution.
## Installation
```console
npm i ml-matrix-convolution
```
```js
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](./LICENSE)
[npm-image]: https://img.shields.io/npm/v/ml-matrix-convolution.svg
[npm-url]: https://npmjs.org/package/ml-matrix-convolution
[codecov-image]: https://img.shields.io/codecov/c/github/mljs/matrix-convolution.svg
[codecov-url]: https://codecov.io/gh/mljs/matrix-convolution
[ci-image]: https://github.com/mljs/matrix-convolution/workflows/Node.js%20CI/badge.svg?branch=master
[ci-url]: https://github.com/mljs/matrix-convolution/actions?query=workflow%3A%22Node.js+CI%22
[download-image]: https://img.shields.io/npm/dm/ml-matrix-convolution.svg
[download-url]: https://npmjs.org/package/ml-matrix-convolution