efficientcube

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(p *Policy, cfg BeamConfig) *Agent

func (*Agent) Act

func (a *Agent) Act(s core.State) core.Action

func (*Agent) EndEpisode

func (a *Agent) EndEpisode(total core.Reward)

func (*Agent) Observe

func (a *Agent) Observe(s core.State, act core.Action, r core.Reward, next core.State, done bool)

type BeamConfig

type BeamConfig struct {
	Width    int
	MaxDepth int
}

func DefaultBeamConfig

func DefaultBeamConfig() BeamConfig

type Policy

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

func LoadPolicy

func LoadPolicy(path string) (*Policy, error)

func NewPolicy

func NewPolicy(hidden []int, seed int64) *Policy

func Train

func Train(cfg TrainConfig, logFn func(iter int, loss, acc float64)) *Policy

func (*Policy) Best

func (p *Policy) Best(c rubix.Cube) rubix.Move

func (*Policy) Probs

func (p *Policy) Probs(c rubix.Cube) []float64

func (*Policy) Save

func (p *Policy) Save(path string) error

func (*Policy) Solve

func (p *Policy) Solve(start rubix.Cube, cfg BeamConfig) Result

func (*Policy) SolveBatch

func (p *Policy) SolveBatch(cubes []rubix.Cube, cfg BeamConfig) []Result

type Result

type Result struct {
	Moves  []rubix.Move
	Solved bool
	Nodes  int
}

type TrainConfig

type TrainConfig struct {
	Hidden []int
	K      int
	Batch  int
	Iters  int
	LR     float64
	Seed   int64
}

func DefaultTrainConfig

func DefaultTrainConfig() TrainConfig

Jump to

Keyboard shortcuts

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