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

Dann setLossFunction

Matias Vazquez-Levi edited this page Feb 1, 2021 · 4 revisions

Back to Dann

setLossFunction( lossfunc );

Set the loss function of the model

  • lossfunc

    Takes a string of the loss function's name. If this function is not called, the loss function will be set to 'mse' by default. See available loss functions Here.

Example

const nn = new Dann(4,2);
nn.addHiddenLayer(8,'sigmoid');
nn.makeWeights();

console.log('Before changing the loss function');
console.log(nn.lossfunc)

nn.setLossFunction('mael');

console.log('After changing the loss function');
console.log(nn.lossfunc)