Versions in this module Expand all Collapse all v0 v0.1.1 May 13, 2023 Changes in this version + var DefaultAgentConfig = &AgentConfig + var DefaultFCLayerBuilder = func(x, y *modelv1.Input) []layer.Config + var DefaultHyperparameters = &Hyperparameters + var DefaultPolicyConfig = &PolicyConfig + func MakePolicy(name string, config *PolicyConfig, base *agentv1.Base, env *envv1.Env) (modelv1.Model, error) + type Agent struct + Epsilon common.Schedule + Policy model.Model + TargetPolicy model.Model + func NewAgent(c *AgentConfig, env *envv1.Env) (*Agent, error) + func (a *Agent) Action(state, goal *tensor.Dense) (action int, err error) + func (a *Agent) Hindsight(episodeEvents Events) error + func (a *Agent) Learn() error + func (a *Agent) Remember(event ...*Event) + type AgentConfig struct + Base *agentv1.Base + MemorySize int + PolicyConfig *PolicyConfig + SuccessfulReward float32 + type Event struct + Goal *tensor.Dense + State *tensor.Dense + func NewEvent(state, goal *tensor.Dense, outcome *envv1.Outcome) *Event + func (e *Event) Copy() *Event + func (e *Event) Print() + type Events []*Event + func (e Events) Copy() Events + type Hyperparameters struct + Epsilon common.Schedule + Gamma float32 + UpdateTargetEpisodes int + type LayerBuilder func(x, y *modelv1.Input) []layer.Config + type Memory struct + func NewMemory(size int) *Memory + func (m *Memory) Len() int + func (m *Memory) Remember(events ...*Event) + func (m *Memory) Sample(batchsize int) (ret []*Event, err error) + type PolicyConfig struct + BatchSize int + LayerBuilder LayerBuilder + Loss modelv1.Loss + Optimizer g.Solver + Track bool