Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Float = G.Float32
Functions ¶
Types ¶
type Config ¶
type Config struct { K int // number of filters FC int // fc layer width L2 float64 // L2 regularization BatchSize int // batch size Width, Height int // board size Features int // feature counts ActionSpace int FwdOnly bool // is this a fwd only graph? }
Config configures the neural network
func DefaultConf ¶
type Dual ¶
type Dual struct { Config Π, V *G.Node // pi and value labels. Pi is a matrix of 1s and 0s // contains filtered or unexported fields }
Dual is the whole neural network architecture of the dual network.
The policy and value outputs are shared
func (*Dual) SetTesting ¶
func (d *Dual) SetTesting()
type Inferencer ¶
type Inferencer struct {
// contains filtered or unexported fields
}
Inferencer is a struct that holds the state for a *Dual and a VM. By using an Inferece struct, there is no longer a need to create a VM every time an inference needs to be done.
func Infer ¶
func Infer(d *Dual, actionSpace int, toLog bool) (*Inferencer, error)
Infer takes a trained *Dual, and creates a interence data structure such that it'd be easy to infer
func (*Inferencer) Close ¶
func (m *Inferencer) Close() error
Close implements a closer, because well, a gorgonia VM is a resource.
func (*Inferencer) ExecLog ¶
func (m *Inferencer) ExecLog() string
ExecLog returns the execution log. If Infer was called with toLog = false, then it will return an empty string
Click to show internal directories.
Click to hide internal directories.