CosineDecaySchedule¶
A cosine decay schedule.
This is a smooth falloff transition from the initial value down to alphainitial_value that follows the shape of the cosine function (from its initial peak to its first trough) over the course of transition_steps steps. After that, the parameter is held at alphainitial_value. Schedule nodes in NeuroPype are used for fine-grained control over how parameters, like the learning rate, should change over time during optimization. Most Step nodes offer a learning_rate_schedule port, into which a Schedule node can be wired to override the otherwise default constant learning rate. However, any other optimizer step parameter can be controlled by a schedule, simply by wiring the schedule node's output into the respective parameter of the Step nodes, and passing the schedule the current iteration (step) count of the optimization process. Version 0.2.0
Ports/Properties¶
step¶
Current step (iteration) count.
value¶
Schedule value at current step count.
init_value¶
Initial parameter value. This is the value at the beginning of the schedule.
transition_steps¶
The number of steps over which the cosine decay takes place. This is a soft transition following a raised- cosine function from a maximum scale of 1 (times initial_value) to a minimum scale of alpha (times initial value). The formula is: initial*((1-alpha)(raised_cosine(step/transition_steps)) + alpha)
alpha¶
The minimum scale of the cosine decay. This is the multiplier applied to the initial value at the end of the decay schedule (bottom of cosine function).
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
step_multiplier¶
Multiplier for the step count. This value is multiplied with each of the step counts to uniformly speed up or slow down the schedule through a single parameter. When used to define an optimizer used by the DeepModel node, this can also be set to 0.0, in which case the multiplier is chosen such that the schedule reaches its final value at the end of the training process, but note that this is not always possible, namely for schedules that are never reach a final value. Otherwise, to make a schedule dependent on the number of steps done by a node, you may normalize your schedule to eg 1000 steps and then wire a formula that calculates the steps done by some process divided by 1000 into this node.