Versions in this module Expand all Collapse all v1 v1.1.2 May 6, 2021 v1.1.1 May 6, 2021 v1.1.0 Sep 16, 2020 Changes in this version + var DefaultTrainerOptions = TrainerOptions + type ConvLayer struct + func (l *ConvLayer) Backward() + func (l *ConvLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *ConvLayer) MarshalJSON() ([]byte, error) + func (l *ConvLayer) OutDepth() int + func (l *ConvLayer) OutSx() int + func (l *ConvLayer) OutSy() int + func (l *ConvLayer) ParamsAndGrads() []ParamsAndGrads + func (l *ConvLayer) UnmarshalJSON(b []byte) error + type DropoutLayer struct + func (l *DropoutLayer) Backward() + func (l *DropoutLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *DropoutLayer) MarshalJSON() ([]byte, error) + func (l *DropoutLayer) OutDepth() int + func (l *DropoutLayer) OutSx() int + func (l *DropoutLayer) OutSy() int + func (l *DropoutLayer) ParamsAndGrads() []ParamsAndGrads + func (l *DropoutLayer) UnmarshalJSON(b []byte) error + type FullyConnLayer struct + func (l *FullyConnLayer) Backward() + func (l *FullyConnLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *FullyConnLayer) MarshalJSON() ([]byte, error) + func (l *FullyConnLayer) OutDepth() int + func (l *FullyConnLayer) OutSx() int + func (l *FullyConnLayer) OutSy() int + func (l *FullyConnLayer) ParamsAndGrads() []ParamsAndGrads + func (l *FullyConnLayer) UnmarshalJSON(b []byte) error + type InputLayer struct + func (l *InputLayer) Backward() + func (l *InputLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *InputLayer) MarshalJSON() ([]byte, error) + func (l *InputLayer) OutDepth() int + func (l *InputLayer) OutSx() int + func (l *InputLayer) OutSy() int + func (l *InputLayer) ParamsAndGrads() []ParamsAndGrads + func (l *InputLayer) UnmarshalJSON(b []byte) error + type Layer interface + Backward func() + Forward func(v *Vol, isTraining bool) *Vol + OutDepth func() int + OutSx func() int + OutSy func() int + ParamsAndGrads func() []ParamsAndGrads + type LayerDef struct + Activation LayerType + Alpha float64 + Beta float64 + BiasPref float64 + BiasPrefZero bool + DropProb float64 + DropProbZero bool + Filters int + GroupSize int + GroupSizeZero bool + InDepth int + InSx int + InSy int + K float64 + L1DecayMul float64 + L1DecayMulZero bool + L2DecayMul float64 + L2DecayMulZero bool + N int + NumClasses int + NumNeurons int + OutDepth int + OutSx int + OutSy int + Pad int + PadZero bool + Stride int + StrideZero bool + Sx int + SxZero bool + Sy int + SyZero bool + Type LayerType + type LayerType int + const LayerConv + const LayerDropout + const LayerFC + const LayerInput + const LayerLRN + const LayerMaxout + const LayerPool + const LayerRegression + const LayerRelu + const LayerSVM + const LayerSigmoid + const LayerSoftmax + const LayerTanh + func (i LayerType) String() string + type LocalResponseNormalizationLayer struct + func (l *LocalResponseNormalizationLayer) Backward() + func (l *LocalResponseNormalizationLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *LocalResponseNormalizationLayer) MarshalJSON() ([]byte, error) + func (l *LocalResponseNormalizationLayer) OutDepth() int + func (l *LocalResponseNormalizationLayer) OutSx() int + func (l *LocalResponseNormalizationLayer) OutSy() int + func (l *LocalResponseNormalizationLayer) ParamsAndGrads() []ParamsAndGrads + func (l *LocalResponseNormalizationLayer) UnmarshalJSON(b []byte) error + type LossData struct + Dim int + Val float64 + type LossLayer interface + BackwardLoss func(y LossData) float64 + type MagicNet struct + type MaxoutLayer struct + func (l *MaxoutLayer) Backward() + func (l *MaxoutLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *MaxoutLayer) MarshalJSON() ([]byte, error) + func (l *MaxoutLayer) OutDepth() int + func (l *MaxoutLayer) OutSx() int + func (l *MaxoutLayer) OutSy() int + func (l *MaxoutLayer) ParamsAndGrads() []ParamsAndGrads + func (l *MaxoutLayer) UnmarshalJSON(b []byte) error + type Net struct + Layers []Layer + func (n *Net) Backward(y LossData) float64 + func (n *Net) CostLoss(v *Vol, y LossData) float64 + func (n *Net) Forward(v *Vol, isTraining bool) *Vol + func (n *Net) MakeLayers(defs []LayerDef, r *rand.Rand) + func (n *Net) ParamsAndGrads() []ParamsAndGrads + func (n *Net) Prediction() int + func (n *Net) UnmarshalJSON(b []byte) error + type ParamsAndGrads struct + Grads []float64 + L1DecayMul float64 + L2DecayMul float64 + Params []float64 + type PoolLayer struct + func (l *PoolLayer) Backward() + func (l *PoolLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *PoolLayer) MarshalJSON() ([]byte, error) + func (l *PoolLayer) OutDepth() int + func (l *PoolLayer) OutSx() int + func (l *PoolLayer) OutSy() int + func (l *PoolLayer) ParamsAndGrads() []ParamsAndGrads + func (l *PoolLayer) UnmarshalJSON(b []byte) error + type RegressionLayer struct + func (l *RegressionLayer) Backward() + func (l *RegressionLayer) BackwardLoss(y LossData) float64 + func (l *RegressionLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *RegressionLayer) MarshalJSON() ([]byte, error) + func (l *RegressionLayer) OutDepth() int + func (l *RegressionLayer) OutSx() int + func (l *RegressionLayer) OutSy() int + func (l *RegressionLayer) ParamsAndGrads() []ParamsAndGrads + func (l *RegressionLayer) UnmarshalJSON(b []byte) error + type ReluLayer struct + func (l *ReluLayer) Backward() + func (l *ReluLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *ReluLayer) MarshalJSON() ([]byte, error) + func (l *ReluLayer) OutDepth() int + func (l *ReluLayer) OutSx() int + func (l *ReluLayer) OutSy() int + func (l *ReluLayer) ParamsAndGrads() []ParamsAndGrads + func (l *ReluLayer) UnmarshalJSON(b []byte) error + type SVMLayer struct + func (l *SVMLayer) Backward() + func (l *SVMLayer) BackwardLoss(y LossData) float64 + func (l *SVMLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *SVMLayer) MarshalJSON() ([]byte, error) + func (l *SVMLayer) OutDepth() int + func (l *SVMLayer) OutSx() int + func (l *SVMLayer) OutSy() int + func (l *SVMLayer) ParamsAndGrads() []ParamsAndGrads + func (l *SVMLayer) UnmarshalJSON(b []byte) error + type SigmoidLayer struct + func (l *SigmoidLayer) Backward() + func (l *SigmoidLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *SigmoidLayer) MarshalJSON() ([]byte, error) + func (l *SigmoidLayer) OutDepth() int + func (l *SigmoidLayer) OutSx() int + func (l *SigmoidLayer) OutSy() int + func (l *SigmoidLayer) ParamsAndGrads() []ParamsAndGrads + func (l *SigmoidLayer) UnmarshalJSON(b []byte) error + type SoftmaxLayer struct + func (l *SoftmaxLayer) Backward() + func (l *SoftmaxLayer) BackwardLoss(y LossData) float64 + func (l *SoftmaxLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *SoftmaxLayer) MarshalJSON() ([]byte, error) + func (l *SoftmaxLayer) OutDepth() int + func (l *SoftmaxLayer) OutSx() int + func (l *SoftmaxLayer) OutSy() int + func (l *SoftmaxLayer) ParamsAndGrads() []ParamsAndGrads + func (l *SoftmaxLayer) UnmarshalJSON(b []byte) error + type TanhLayer struct + func (l *TanhLayer) Backward() + func (l *TanhLayer) Forward(v *Vol, isTraining bool) *Vol + func (l *TanhLayer) MarshalJSON() ([]byte, error) + func (l *TanhLayer) OutDepth() int + func (l *TanhLayer) OutSx() int + func (l *TanhLayer) OutSy() int + func (l *TanhLayer) ParamsAndGrads() []ParamsAndGrads + func (l *TanhLayer) UnmarshalJSON(b []byte) error + type Trainer struct + Net *Net + func NewTrainer(net *Net, opts TrainerOptions) *Trainer + func (t *Trainer) Train(x *Vol, y LossData) TrainingResult + type TrainerMethod int + const MethodADADelta + const MethodADAGrad + const MethodAdam + const MethodNetsterov + const MethodSGD + const MethodWindowGrad + func (i TrainerMethod) String() string + type TrainerOptions struct + BatchSize int + Beta1 float64 + Beta2 float64 + Eps float64 + L1Decay float64 + L2Decay float64 + LearningRate float64 + Method TrainerMethod + Momentum float64 + Ro float64 + type TrainingResult struct + CostLoss float64 + L1DecayLoss float64 + L2DecayLoss float64 + Loss float64 + type Vol struct + Depth int + Dw []float64 + Sx int + Sy int + W []float64 + func ImgToVol(img image.Image, convertGrayscale bool) *Vol + func NewVol(sx, sy, depth int, c float64) *Vol + func NewVol1D(w []float64) *Vol + func NewVolRand(sx, sy, depth int, r *rand.Rand) *Vol + func (v *Vol) Add(x, y, d int, value float64) + func (v *Vol) AddFrom(v2 *Vol) + func (v *Vol) AddFromScaled(v2 *Vol, a float64) + func (v *Vol) AddGrad(x, y, d int, value float64) + func (v *Vol) Augment(crop, dx, dy int, fliplr bool) *Vol + func (v *Vol) Clone() *Vol + func (v *Vol) CloneAndZero() *Vol + func (v *Vol) Get(x, y, d int) float64 + func (v *Vol) GetGrad(x, y, d int) float64 + func (v *Vol) Set(x, y, d int, value float64) + func (v *Vol) SetConst(a float64) + func (v *Vol) SetGrad(x, y, d int, value float64) + func (v *Vol) UnmarshalJSON(b []byte) error