Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Dann feedForward

Matias Vazquez-Levi edited this page Feb 12, 2021 · 6 revisions

Back to Dann

feedForward( input , options );

This function feeds data through the model to obtain an output.

  • input

    Takes an array of input data.

  • options (optional)

    An object including specific properties.
Properties
Property Type Function
log Boolean If set to true, it will log a report in the console.
table Boolean If the 'log' option is set to true, setting this value to true will print the arrays of this function in tables.
decimals Integer If used, the output of this function will be rounded to the number of decimals specified.
mode
* for development
String When gpu support will be implemented, specifing the string 'gpu' as opposed to 'cpu' will run the function on a kernel. This funtionality is not yet implemented

  • returns

    an array of output predictions.

Example

const nn = new Dann(4,2);
nn.makeWeights();

let prediction = nn.feedForward([0,0,0,1],{log:true});

//outputs an array of length 2
console.log(prediction);