Built-in learning rate policies, which allow for a dynamic learning rate during neural network training.
- Source:
- See:
Example
Copy
let { methods, Network } = require("@liquid-carrot/carrot");
let network = new Network(5, 10, 5);
// OPTION #1: methods.rate.FIXED
network.train(dataset, { rate_policy: methods.rate.FIXED });
// OPTION #2: methods.rate.STEP
network.train(dataset, { rate_policy: methods.rate.STEP });
// OPTION #3: methods.rate.EXP
network.train(dataset, { rate_policy: methods.rate.EXP });
// OPTION #4: methods.rate.INV
network.train(dataset, { rate_policy: methods.rate.INV });
// more coming soon...
Methods
(static) EXP (base_rate, iteration, optionsopt) → {function} open an issue
Exponential Learning Rate
The learning rate will exponentially decrease.
The rate at iteration
is calculated as: rate = base_rate * Math.pow(options.gamma, iteration)
Parameters:
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
base_rate |
number | A base learning rate - 0 < |
||||||||
iteration |
number | A number - |
||||||||
options |
Properties
|
Example
Copy
let { Network, methods } = require("@liquid-carrot/carrot");
let network = new Network(10, 1);
network.train(dataset, { rate_policy: methods.rate.EXP });
- Source:
(static) FIXED (base_rate) → {function} open an issue
Fixed Learning Rate
Default rate policy. Using this will make learning rate static (no change). Useful as a way to update a previous rate policy.
Parameters:
Name | Type | Description |
---|---|---|
base_rate |
number | A base learning rate - 0 < |
Example
Copy
let { Network, methods } = require("@liquid-carrot/carrot");
let network = new Network(10, 1);
network.train(dataset, { rate_policy: methods.rate.FIXED });
- Source:
(static) INV (base_rate, iteration, optionsopt) → {function} open an issue
Inverse Exponential Learning Rate
The learning rate will exponentially decrease.
The rate at iteration
is calculated as: rate = baseRate * Math.pow(1 + options.gamma * iteration, -options.power)
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
base_rate |
number | A base learning rate - 0 < |
||||||||||||
iteration |
number | A number - |
||||||||||||
options |
Properties
|
Example
Copy
let { Network, methods } = require("@liquid-carrot/carrot");
let network = new Network(10, 1);
network.train(dataset, { rate_policy: methods.rate.INV });
- Source:
(static) STEP (base_rate, iteration, optionsopt) → {function} open an issue
Step Learning Rate
The learning rate will decrease (i.e. 'step down') every options.step_size
iterations.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
base_rate |
number | A base learning rate - 0 < |
||||||||||||
iteration |
number | A number - |
||||||||||||
options |
Properties
|
Example
Copy
let { Network, methods } = require("@liquid-carrot/carrot");
let network = new Network(10, 1);
network.train(dataset, { rate_policy: methods.rate.STEP });
- Source: