1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package neuralnetworkbase
- import (
- mat "gonum.org/v1/gonum/mat"
- )
- const (
- BiasGradient = iota
- WeightGradient = iota
- )
- type GradientDescentInitializer func(nn *NeuralNetwork, layer, gradientType int) interface{}
- type OnlineGradientDescent interface {
- ApplyDelta(m mat.Matrix, gradient mat.Matrix) *mat.Dense
- }
- type BatchGradientDescent interface {
- ApplyDelta(m mat.Matrix) *mat.Dense
- AccumGradients(gradient mat.Matrix)
- Gradients() *mat.Dense
- }
- const (
- StateIdle = 1
- StateLearning = 2
- StateValidation = 3
- StatePredict = 4
- )
- type StateWatcher interface {
- Init(nn *NeuralNetwork)
- UpdateState(state int)
- UpdateActivations(l int, a *mat.Dense)
- UpdateBiases(l int, biases *mat.Dense)
- UpdateWeights(l int, weights *mat.Dense)
- }
|