Layer Class

A way to descript downsampling layers.

Methods


Constructor

Layer
(
  • type
  • Size
  • Sample
  • Stride
)

Parameters:

  • 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 l1 = new Layer('avgpool', 16, 2, 2);
l1.log();

Methods

feed
(
  • data
  • [options]
)
Array

Provided by the Dann module.

Defined in src\classes\layer\methods\feed.js:1

Feed data through the layer to obtain an output.

Parameters:

  • 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.

Returns:

Array :

Array of outputs values.

log ( )

Provided by the Dann module.

Defined in src\classes\layer\methods\log.js:1

Log the layer in the console.

Example:


const l1 = new Layer('maxpool', 16, 4, 4);
l1.log();