Documentation ¶
Index ¶
- Constants
- func AdamUpdate(params, grads, mean, variance *NDArray, lr, beta1, beta2, epsilon, wd float32) error
- func GpuCount() int
- func NextSymbolId() int
- func Nograd(_hidden_nograd_)
- func RandomSeed(seed int)
- func ResetSymbolId(first int)
- func SgdMomUpdate(params, grads, mom *NDArray, lr, momentum, wd float32) error
- func SgdUpdate(params, grads *NDArray, lr, wd float32) error
- type ActivationType
- type Context
- type Dimension
- type Dtype
- type Graph
- func (g *Graph) Backward() error
- func (g *Graph) Forward(train bool) error
- func (g *Graph) GetShapes(withLoss bool) (map[string][]int, error)
- func (g *Graph) Identity() GraphIdentity
- func (g *Graph) Initialize(inite func(*NDArray, string) error) error
- func (g *Graph) LoadParams(reader io.Reader) error
- func (g *Graph) LogSummary(withLoss bool) error
- func (g *Graph) PrintSummary(withLoss bool) error
- func (g *Graph) Release()
- func (g *Graph) SaveParams(writer io.Writer) error
- func (g *Graph) Summary(withLoss bool) (Summary, error)
- func (g *Graph) SummaryOut(withLoss bool, out func(string)) error
- func (g *Graph) ToJson(withLoss bool) ([]byte, error)
- type GraphIdentity
- type GraphJs
- type Inite
- type Loss
- type NDArray
- func (a *NDArray) Cast(dt Dtype) *NDArray
- func (a *NDArray) Context() Context
- func (a *NDArray) CopyValuesTo(dst interface{}) error
- func (a *NDArray) Depth() int
- func (a *NDArray) Dim() Dimension
- func (a *NDArray) Dtype() Dtype
- func (a NDArray) Err() error
- func (a *NDArray) Fill(value float32) *NDArray
- func (a *NDArray) Len(d int) int
- func (a *NDArray) NewLikeThis() *NDArray
- func (a *NDArray) Normal(mean float32, scale float32) *NDArray
- func (a *NDArray) Ones() *NDArray
- func (a *NDArray) Raw() []byte
- func (a *NDArray) Release()
- func (a *NDArray) Reshape(dim Dimension) *NDArray
- func (a *NDArray) SetValues(vals ...interface{}) error
- func (a *NDArray) Size() int
- func (a *NDArray) String() string
- func (a *NDArray) Uniform(low float32, high float32) *NDArray
- func (a *NDArray) Values(dtype Dtype) (interface{}, error)
- func (a *NDArray) ValuesF32() []float32
- func (a *NDArray) Xavier(gaussian bool, factor int, magnitude float32) *NDArray
- func (a *NDArray) Zeros() *NDArray
- type Param
- type Summary
- type SummaryRow
- type SummryArg
- type Symbol
- func Abs(a *Symbol) *Symbol
- func Activation(a *Symbol, actType ActivationType) *Symbol
- func Add(lv interface{}, rv interface{}) *Symbol
- func BatchNorm(a, gamma, beta, rmean, rvar *Symbol, mom, eps float32, axis ...int) *Symbol
- func BlockGrad(s *Symbol) *Symbol
- func Concat(a ...*Symbol) *Symbol
- func Conv(a, weight, bias *Symbol, channels int, kernel, stride, padding Dimension, ...) *Symbol
- func Cosh(a *Symbol) *Symbol
- func Div(lv interface{}, rv interface{}) *Symbol
- func Dot(lv interface{}, rv interface{}) *Symbol
- func Flatten(a *Symbol) *Symbol
- func FullyConnected(a, weight, bias *Symbol, size int, flatten bool) *Symbol
- func GenericOp2(op, opScalar, opScalarR capi.MxnetOp, lv interface{}, rv interface{}) *Symbol
- func Group(a ...*Symbol) *Symbol
- func Input(..._hidden_input_) *Symbol
- func Log(a *Symbol) *Symbol
- func LogCosh(a *Symbol) *Symbol
- func LogSoftmax(a *Symbol, axis ...int) *Symbol
- func MakeLoss(s *Symbol) *Symbol
- func Mean(a *Symbol, axis ...int) *Symbol
- func MeanXl(a *Symbol, axis ...int) *Symbol
- func Minus(a *Symbol) *Symbol
- func Mul(lv interface{}, rv interface{}) *Symbol
- func Not(a *Symbol) *Symbol
- func Pick(a *Symbol, label *Symbol) *Symbol
- func Pool(a *Symbol, kernel, stride, padding Dimension, ceil bool, maxpool bool) *Symbol
- func Pow(lv interface{}, rv interface{}) *Symbol
- func Sigmoid(a *Symbol) *Symbol
- func Sin(a *Symbol) *Symbol
- func Softmax(a *Symbol, axis ...int) *Symbol
- func SoftmaxActivation(a *Symbol, channel bool) *Symbol
- func SoftmaxCrossEntropy(a, b *Symbol, axis ...int) *Symbol
- func SoftmaxOutput(a *Symbol, l *Symbol, multiOutput bool) *Symbol
- func Square(a *Symbol) *Symbol
- func Stack(a ...*Symbol) *Symbol
- func Stack1(a ...*Symbol) *Symbol
- func Sub(lv interface{}, rv interface{}) *Symbol
- func Sum(a *Symbol, axis ...int) *Symbol
- func SumXl(a *Symbol, axis ...int) *Symbol
- func SymbolCast(i interface{}) (*Symbol, error)
- func Tanh(a *Symbol) *Symbol
- func Var(name string, opt ...interface{}) *Symbol
- type VersionType
Constants ¶
View Source
const ( DimRow = 0 DimColumn = 1 DimDepth = 2 DimDepth3 = 3 )
View Source
const ( VersionMajor = 1 VersionMinor = 5 VersionPatch = 0 )
View Source
const ( OpVar_ capi.MxnetOp = -1 OpInput_ capi.MxnetOp = -2 OpScalar_ capi.MxnetOp = -4 OpNogVar_ capi.MxnetOp = -5 OpGroup_ capi.MxnetOp = -7 )
View Source
const MaxDimensionCount = 4
do not change this constant code can assume exactly this value
Variables ¶
This section is empty.
Functions ¶
func AdamUpdate ¶
func NextSymbolId ¶
func NextSymbolId() int
func RandomSeed ¶
func RandomSeed(seed int)
func ResetSymbolId ¶
func ResetSymbolId(first int)
func SgdMomUpdate ¶
Types ¶
type ActivationType ¶
type ActivationType int
const ( ReLU ActivationType = iota SoftReLU SoftSign ActivSigmoid ActivTanh )
type Graph ¶
type Graph struct { Ctx Context Dtype Dtype Input *NDArray // network input Outputs []*NDArray // referencing to executor outputs except loss Loss *NDArray // referencing to last executor output Label *NDArray // loss function label Params map[string]Param Exec capi.ExecutorHandle Initializers map[string]Inite Initialized bool // contains filtered or unexported fields }
func (*Graph) Identity ¶
func (g *Graph) Identity() GraphIdentity
func (*Graph) LogSummary ¶
func (*Graph) PrintSummary ¶
type GraphIdentity ¶
type GraphIdentity [20]byte // SHA1
func (GraphIdentity) String ¶
func (identity GraphIdentity) String() string
type NDArray ¶
type NDArray struct {
// contains filtered or unexported fields
}
func (*NDArray) CopyValuesTo ¶
func (*NDArray) NewLikeThis ¶
type Summary ¶
type Summary []*SummaryRow
type SummaryRow ¶
type Symbol ¶
type Symbol struct {
// contains filtered or unexported fields
}
func Activation ¶
func Activation(a *Symbol, actType ActivationType) *Symbol
func GenericOp2 ¶
func LogSoftmax ¶
func SoftmaxActivation ¶
func SoftmaxCrossEntropy ¶
func SymbolCast ¶
type VersionType ¶
type VersionType int
const Version VersionType = VersionMajor*10000 + VersionMinor*100 + VersionPatch
func LibVersion ¶
func LibVersion() VersionType
func MakeVersion ¶
func MakeVersion(major, minor, patch int) VersionType
func (VersionType) Major ¶
func (v VersionType) Major() int
func (VersionType) Minor ¶
func (v VersionType) Minor() int
func (VersionType) Patch ¶
func (v VersionType) Patch() int
func (VersionType) String ¶
func (v VersionType) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.