This repository has been archived by the owner on Feb 6, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Dann backpropagate
Matias Vazquez-Levi edited this page Feb 12, 2021
·
4 revisions
Train the model's weights.
Takes an array of input data.
Takes an array of expected output.
An object including specific 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. |
saveLoss | Boolean | Whether or not to save the losses in the neural network object. After a lot of training, carrying loss data in the neural network object gets heavy, this is why it is set to false by default. |
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 |
//train 1 epoch
for (data of dataset) {
nn.backpropagate(data.input,data.output);
}
or here is another example
//train 1 epoch
for (data of dataset) {
nn.backpropagate([0,1],[1]);
nn.backpropagate([1,0],[1]);
nn.backpropagate([1,1],[0]);
nn.backpropagate([0,0],[0]);
}