Documentation ¶
Overview ¶
Package common provides common methods and tooling for the agents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
Retry callback function for the number of attempts sleeping for the duration in-between.
func WithDecayRate ¶
func WithDecayRate(rate float32) func(*DecaySchedule)
WithDecayRate adds a decay rate to a default decay schedule.
func WithMinValue ¶
func WithMinValue(rate float32) func(*DecaySchedule)
WithMinValue adds a minimum value rate to a default decay schedule.
Types ¶
type ConstantSchedule ¶
type ConstantSchedule struct {
// contains filtered or unexported fields
}
ConstantSchedule just returns a constant value.
func NewConstantSchedule ¶
func NewConstantSchedule(value float32) *ConstantSchedule
NewConstantSchedule returns a new constant schedule.
func (*ConstantSchedule) Value ¶
func (c *ConstantSchedule) Value() float32
Value for the given step.
type DecaySchedule ¶
type DecaySchedule struct {
// contains filtered or unexported fields
}
DecaySchedule returns values on an exponential decay means.
func DefaultDecaySchedule ¶
func DefaultDecaySchedule(opts ...DecayScheduleOpt) *DecaySchedule
DefaultDecaySchedule is the default decay schedule.
func NewDecaySchedule ¶
func NewDecaySchedule(decayRate, initialValue, minValue float32) *DecaySchedule
NewDecaySchedule returns a new DecaySchedule.
func (*DecaySchedule) Initial ¶
func (d *DecaySchedule) Initial() float32
Initial value for the schedule.
func (*DecaySchedule) Value ¶
func (d *DecaySchedule) Value() float32
Value for the given step. Will decay with each call.
type DecayScheduleOpt ¶
type DecayScheduleOpt func(*DecaySchedule)
DecayScheduleOpt is an option for a decay schedule.
type LinearSchedule ¶
type LinearSchedule struct {
// contains filtered or unexported fields
}
LinearSchedule returns values on a linear means.
func DefaultLinearSchedule ¶
func DefaultLinearSchedule(numTimesteps int) *LinearSchedule
DefaultLinearSchedule returns a linear schedule with some sensible defaults.
func NewLinearSchedule ¶
func NewLinearSchedule(numTimesteps int, initialValue, finalValue float32) *LinearSchedule
NewLinearSchedule returns a new LinearSchedule.
func (*LinearSchedule) Initial ¶
func (l *LinearSchedule) Initial() float32
Initial value for the schedule.
Directories ¶
Path | Synopsis |
---|---|
Package num provides various numeric functions.
|
Package num provides various numeric functions. |
Package op provides extended Gorgonia graph operations.
|
Package op provides extended Gorgonia graph operations. |
Package require provides methods for enforcing requirements on values or exiting.
|
Package require provides methods for enforcing requirements on values or exiting. |