ml-basic
Version:
Lightweight, zero dependency, machine learning library
30 lines (29 loc) • 747 B
TypeScript
import { Activator } from "../lib/functions";
import Matrix from "../lib/matrix";
import Layer from "./layer";
export type ConvolutionalParams = {
input: [number, number];
kernel: [number, number];
/**
* @default 1
*/
stride?: number;
/**
* @default 0
*/
padding?: number;
/**
* @default {@link Sigmoid}
*/
activation?: Activator;
};
export default class ConvolutionalLayer extends Layer {
name: string;
kernel: Matrix;
bias: Matrix;
stride: number;
padding: number;
constructor({ input, kernel, stride, padding, activation }: ConvolutionalParams);
propagate(input: Matrix): Matrix;
backPropagate(input: Matrix, output: Matrix, loss: Matrix): Matrix;
}