Documentation ¶
Overview ¶
Package descend provides tools to use gradient descent to optimize the parameters of continuous functions implemented as tensorflow graphs. It does not (yet) implement backpropagation, but rather uses ES and other black box optimization algorithms.
Index ¶
- func NewSeedSM(s *op.Scope, noise NoiseFunc, paramDefs []ParamDef, numSeeds int) (makeSeedSM func(*tf.Session) (SeedSM, error), ...)
- func NewWeightedSeedSM(s *op.Scope, noise NoiseFunc, paramDefs []ParamDef, numSeeds int) (makeSeedSM func(*tf.Session) (WeightedSeedSM, error), ...)
- type LossFunc
- type ModelDef
- type NoiseFunc
- type ParamDef
- type SeedSM
- type WeightedSeedSM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSeedSM ¶
func NewSeedSM(s *op.Scope, noise NoiseFunc, paramDefs []ParamDef, numSeeds int, ) ( makeSeedSM func(*tf.Session) (SeedSM, error), newBestSeed func(LossFunc) func(*tf.Session) (func() (int64, error), error), generation tf.Output, params []tf.Output, )
NewSeedSM creates TF OPs for a state machine to move through parameter space according to the seed which is give and the generation. Use perturb and deperturb to move forward or rewind.
func NewWeightedSeedSM ¶
func NewWeightedSeedSM(s *op.Scope, noise NoiseFunc, paramDefs []ParamDef, numSeeds int, ) ( makeSeedSM func(*tf.Session) (WeightedSeedSM, error), newSeedWeights func(LossFunc, tf.Output) func(*tf.Session) (func() ([]float32, error), error), generation tf.Output, params []tf.Output, )
NewWeightedSeedSM creates TF OPs for a state machine to move through parameter space according to the seed which is give and the generation. Use perturb and deperturb to move forward and rewind.
Types ¶
type ModelDef ¶
type ModelDef struct { Params []ParamDef // The list of shapes of params that the child wants. Loss LossFunc // Loss takes a slice of params, and returns a number which will be minimized. }
ModelDef defines a model. Params describes the tensors of params which are to be optimised. Loss is a function which, when called, will create a sub graph which takes the params, and returns a loss value. Log takes params and generation, and returns a slice of operations to be pulled on.
type ParamDef ¶
type ParamDef struct { Name string // Name must be unique Init func(*op.Scope) tf.Output // Output of the initial state }
ParamDef defines a shape and name
type WeightedSeedSM ¶
type WeightedSeedSM struct { Generation int64 SeedWeights [][]float32 // contains filtered or unexported fields }
WeightedSeedSM allows one to move through the parameter space using a list of seed weights.
func (*WeightedSeedSM) Step ¶
func (sm *WeightedSeedSM) Step(weights []float32) (err error)
Step moves the parameters through parameter space by one list of weights