agent

package
v0.0.0-...-5c0e551 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDqn

func NewDqn(logger logger.Debug) (rlglue.Agent, error)

Types

type Dqn

type Dqn struct {
	logger.Debug

	EnableDebug         bool
	NumberOfActions     int     `json:"numberOfActions"`
	StateContainsReplay bool    `json:"state-contains-replay"`
	Gamma               float64 `json:"gamma"`
	Epsilon             float64 `json:"epsilon"`
	Hidden              int     `json:"dqn-hidden"`
	Layer               int     `json:"dqn-ly"`
	Alpha               float64 `json:"alpha"`
	Sync                int     `json:"dqn-sync"`

	Bsize int    `json:"buffer-size"`
	Btype string `json:"buffer-type"`

	StateDim  int `json:"state-len"`
	BatchSize int `json:"dqn-batch"`

	StateRange []float64
	// contains filtered or unexported fields
}

func (*Dqn) End

func (agent *Dqn) End(state rlglue.State, reward float64)

End informs the agent that a terminal state has been reached, providing the final reward.

func (*Dqn) Feed

func (agent *Dqn) Feed(lastS rlglue.State, lastA int, state rlglue.State, reward float64, gamma float64)

func (*Dqn) Initialize

func (agent *Dqn) Initialize(run uint, expAttr, envAttr rlglue.Attributes) error

func (*Dqn) Policy

func (agent *Dqn) Policy(state rlglue.State) int

Choose action

func (*Dqn) Start

func (agent *Dqn) Start(state rlglue.State) rlglue.Action

Start provides an initial observation to the agent and returns the agent's action.

func (*Dqn) StateNormalization

func (agent *Dqn) StateNormalization(state rlglue.State) rlglue.State

func (*Dqn) Step

func (agent *Dqn) Step(state rlglue.State, reward float64) rlglue.Action

Step provides a new observation and a reward to the agent and returns the agent's next action.

func (*Dqn) Update

func (agent *Dqn) Update()

type Model

type Model struct {
	// contains filtered or unexported fields
}

func NewModel

func NewModel(graphDefFilename string) *Model

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL