Documentation
¶
Index ¶
- func GenomeLen(nIn, nHidden, nOut int) int
- type Config
- type Driver
- type Population
- func (p *Population) Act(s core.State) core.Action
- func (p *Population) All() iter.Seq[core.Individual]
- func (p *Population) Best() []float64
- func (p *Population) BestPolicy() func(obs []float64) []float64
- func (p *Population) EndEpisode(total core.Reward)
- func (p *Population) Evolve()
- func (p *Population) Generation() int
- func (p *Population) Len() int
- func (p *Population) Observe(s core.State, a core.Action, r core.Reward, next core.State, done bool)
- func (p *Population) SaveBest(path string) error
- func (p *Population) SetMemberGenome(i int, genome []float64) error
- type SavedGenome
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(sg SavedGenome) *Driver
func (*Driver) SetFitness ¶
type Population ¶
type Population struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg Config) *Population
func (*Population) All ¶
func (p *Population) All() iter.Seq[core.Individual]
func (*Population) Best ¶
func (p *Population) Best() []float64
func (*Population) BestPolicy ¶
func (p *Population) BestPolicy() func(obs []float64) []float64
func (*Population) EndEpisode ¶
func (p *Population) EndEpisode(total core.Reward)
func (*Population) Evolve ¶
func (p *Population) Evolve()
func (*Population) Generation ¶
func (p *Population) Generation() int
func (*Population) Len ¶
func (p *Population) Len() int
func (*Population) SaveBest ¶
func (p *Population) SaveBest(path string) error
func (*Population) SetMemberGenome ¶
func (p *Population) SetMemberGenome(i int, genome []float64) error
type SavedGenome ¶
type SavedGenome struct {
SchemaVersion int `json:"schema_version"`
Inputs int `json:"inputs"`
HiddenSize int `json:"hidden_size"`
Outputs int `json:"outputs"`
Generation int `json:"generation"`
Genome []float64 `json:"genome"`
}
func LoadGenome ¶
func LoadGenome(path string) (SavedGenome, error)
Click to show internal directories.
Click to hide internal directories.