Dannjs
2.3.13Deep Neural Network Library for JavaScript.
new Layer
(
type
Size
Sample
Stride
)
Downsampling layer component
type
String
A string representing the type of this layer.
Size
Number
The size of the downsampling layer.
Sample
Number
The size of the 2d sample iterating trough the array.
Stride
Number
The number of jumps the sample is going to perform for each iteration.
Example
const Dannjs = require('dannjs'); const Layer = Dannjs.layer;
const l1 = new Layer('avgpool', 16, 2, 2); l1.log();
feed
(
data
[options]
)
Feed data through the layer to obtain an output.
data
Array
Takes an array of numbers to feed through the layer.
[options]
Object
optional
An object including specific properties.
Property | Type | Function |
---|---|---|
log | Boolean | Whether or not to log the output. |
table | Boolean | Whether or not we want to print the result in the form of a table or a normal console log. |
log
( )
Log the layer in the console.
Example
const l1 = new Layer('maxpool', 16, 4, 4);
l1.log();