play

package
v0.0.0-...-599284e Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DIMENSION = 8 * 8 * 12
View Source
const MAX_SCORE float32 = 1e6

Variables

Functions

func NegamaxSync

func NegamaxSync(
	model *ChessBotModel,
	game *chess.Game,
	depth uint8,
	alpha,
	beta,
	player float32,
) (float32, []*chess.Move)

func ParseBoard

func ParseBoard(board *chess.Board) []float32

Types

type BoardInput

type BoardInput [DIMENSION]float32

type ChessBotModel

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

func LoadModel

func LoadModel(modelPath string) (*ChessBotModel, error)

func (*ChessBotModel) Close

func (m *ChessBotModel) Close() error

func (*ChessBotModel) Evaluate

func (m *ChessBotModel) Evaluate(inputs [][]float32) ([]float32, error)

type MoveResult

type MoveResult struct {
	Move  *chess.Move
	Score float32
	Moves []*chess.Move
}

func Negamax

func Negamax(
	model *ChessBotModel,
	game *chess.Game,
	depth uint8,
	alpha,
	beta,
	player float32,
) *MoveResult

Jump to

Keyboard shortcuts

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