@ai-on-browser/data-analysis-models
Version:
Data analysis model package without any dependencies
52 lines (51 loc) • 1.52 kB
TypeScript
/**
* Graph convolutional layer
*/
export default class GraphConvolutionalLayer extends Layer {
/**
* @param {object} config object
* @param {number} config.out_size Size of output
* @param {number[][] | Matrix | string} [config.w] Weight of kernel
* @param {number[][] | Matrix | string} [config.b] Bias
* @param {string | object} [config.activation] Name of activation or activation layer object
* @param {number} [config.l2_decay] L2 decay
* @param {number} [config.l1_decay] L1 decay
*/
constructor({ out_size, w, b, activation, l2_decay, l1_decay, ...rest }: {
out_size: number;
w?: number[][] | Matrix | string;
b?: number[][] | Matrix | string;
activation?: string | object;
l2_decay?: number;
l1_decay?: number;
});
_out_size: number;
_w: Matrix<number>;
_wname: string;
_b: Matrix<number>;
_bname: string;
_activation: Layer;
_l2_decay: number;
_l1_decay: number;
_aggregate: string;
calc(x: any): any;
_i: any;
_cum: any[];
_o: any;
grad(bo: any): any;
_dw: any;
_db: any;
_bi: any;
update(optimizer: any): void;
toObject(): {
type: string;
out_size: number;
w: string | number[][];
b: string | number[][];
activation: import("./index.js").PlainLayerObject;
l2_decay: number;
l1_decay: number;
};
}
import Layer from './base.js';
import Matrix from '../../../util/matrix.js';