eval

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputSize  = 64 * 12
	HiddenSize = 512
)
View Source
const (
	Add    = 1
	Remove = -Add
)
View Source
const AvxInstructions = false
View Source
const MaxHeight = 128

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluationService

type EvaluationService struct {
	*Weights
	// contains filtered or unexported fields
}

func NewDefaultEvaluationService added in v1.55.0

func NewDefaultEvaluationService() *EvaluationService

TODO return err

func NewEvaluationService

func NewEvaluationService(weights *Weights) *EvaluationService

func (*EvaluationService) Evaluate

func (e *EvaluationService) Evaluate(p *Position) int

func (*EvaluationService) EvaluateQuick

func (e *EvaluationService) EvaluateQuick(p *Position) int

func (*EvaluationService) Init

func (e *EvaluationService) Init(p *Position)

func (*EvaluationService) MakeMove

func (e *EvaluationService) MakeMove(p *Position, m Move)

func (*EvaluationService) QuickFeed

func (e *EvaluationService) QuickFeed() float32

func (*EvaluationService) UnmakeMove

func (e *EvaluationService) UnmakeMove()

func (*EvaluationService) UpdateHidden

func (e *EvaluationService) UpdateHidden()

type Updates

type Updates struct {
	Indices [8]int16
	Coeffs  [8]int8
	Size    int
}

func (*Updates) Add

func (u *Updates) Add(index int16, coeff int8)

type Weights

type Weights struct {
	HiddenWeights [InputSize * HiddenSize]float32
	HiddenBiases  [HiddenSize]float32
	OutputWeights [HiddenSize]float32
	OutputBias    float32
}

func LoadWeights

func LoadWeights(f io.Reader) (*Weights, error)

Jump to

Keyboard shortcuts

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