Constructor
new Trainer(optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Properties
|
- Source:
Example
const network = new anny.Network([2, 1])
const trainer = new Trainer()
trainer.train(network, anny.DATA.ORGate)
network.activate([0, 0]) // => 0.000836743108
network.activate([0, 1]) // => 0.998253857294
Methods
train(network, data, overridesopt)
Train the network
to classify the data
.
Train the network
to classify the data
.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
network |
Network | The Network to be trained. |
|||||||||
data |
Array.<object> | Array of objects in the form
|
|||||||||
overrides |
Object |
<optional> |
Overrides are merged into this trainer Properties
|
- Source:
- See:
-
- Network
- Data
Type Definitions
onFail(error, epoch)
Called if the network
error is not below the errorThreshold
after
maxEpochs
iterations through the training data set.
Called if the network
error is not below the errorThreshold
after
maxEpochs
iterations through the training data set.
Parameters:
Name | Type | Description |
---|---|---|
error |
number | The |
epoch |
number | Indicates on which iteration through the training data the |
- Source:
onProgress(error, epoch)
Called if the network
error falls below the errorThreshold
.
Called if the network
error falls below the errorThreshold
.
Parameters:
Name | Type | Description |
---|---|---|
error |
number | The |
epoch |
number | Indicates on which iteration through the training data the |
- Source:
onSuccess(error, epoch)
Called if the network
error falls below the errorThreshold
.
Called if the network
error falls below the errorThreshold
.
Parameters:
Name | Type | Description |
---|---|---|
error |
number | The |
epoch |
number | Indicates on which iteration through the training data the |
- Source: