Versions in this module Expand all Collapse all v0 v0.1.1 May 13, 2023 Changes in this version + var DefaultAgentConfig = &AgentConfig + var DefaultEvolverHyperparameters = &EvolverHyperparameters + var DefaultFCLayerBuilder = func(x, y *modelv1.Input) []layer.Config + var DefaultPolicyConfig = &PolicyConfig + var DefaultSphereBlackBoxConfig = &SphereBlackBoxConfig + func MakePolicy(config *PolicyConfig, base *agentv1.Base, env *envv1.Env) (modelv1.Model, error) + type Agent struct + Policy model.Model + func NewAgent(c *AgentConfig, env *envv1.Env, base *agentv1.Base) (*Agent, error) + func (a *Agent) Action(state *tensor.Dense) (action int, err error) + func (a *Agent) SetWeights(weights *tensor.Dense) error + type AgentConfig struct + PolicyConfig *PolicyConfig + type BlackBox interface + InitWeights func() *t.Dense + Run func(weights *t.Dense) (reward float32, err error) + RunAsync func(populationID int, weights *tensor.Dense, results chan BlackBoxResult, ...) + type BlackBoxResult struct + Err error + PopulationID int + Reward float32 + Solved bool + Weights *tensor.Dense + type Evolver struct + func NewEvolver(c *EvolverConfig) *Evolver + func (e *Evolver) Evolve() (weights *tensor.Dense, err error) + type EvolverConfig struct + Base *agent.Base + BlackBox BlackBox + type EvolverHyperparameters struct + Alpha float32 + NGen int + NPop int + Sigma float32 + type LayerBuilder func(x, y *modelv1.Input) []layer.Config + type PolicyConfig struct + LayerBuilder LayerBuilder + Track bool + type SolvedChecker func(reward float32) bool + type SphereBlackBox struct + func NewSphereBlackBox(config *SphereBlackBoxConfig, server *envv1.Server) (*SphereBlackBox, error) + func (s *SphereBlackBox) InitWeights() *tensor.Dense + func (s *SphereBlackBox) Run(weights *tensor.Dense) (reward float32, err error) + func (s *SphereBlackBox) RunAsync(populationID int, weights *tensor.Dense, results chan BlackBoxResult, ...) + type SphereBlackBoxConfig struct + AgentConfig *AgentConfig + EnvName string + Logger *log.Logger + NumEpisodes int + SolvedChecker SolvedChecker