Documentation
¶
Index ¶
- type SoftMax
- func (sm *SoftMax) Back()
- func (sm *SoftMax) Decode(varNm string) int
- func (sm *SoftMax) Forward()
- func (sm *SoftMax) Init(ncats, ninputs int)
- func (sm *SoftMax) InitLayer(ncats int, layers []emer.Layer)
- func (sm *SoftMax) Input(varNm string)
- func (sm *SoftMax) Sort()
- func (sm *SoftMax) Train(targ int)
- func (sm *SoftMax) ValsTsr(name string) *etensor.Float32
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SoftMax ¶
type SoftMax struct {
Lrate float32 `def:"0.1" desc:"learning rate"`
Layers []emer.Layer `desc:"layers to decode"`
NCats int `desc:"number of different categories to decode"`
Units []Unit `desc:"unit values"`
Sorted []int `` /* 183-byte string literal not displayed */
NInputs int `desc:"number of inputs -- total sizes of layer inputs"`
Inputs []float32 `desc:"input values, copied from layers"`
Targ int `desc:"current target index of correct category"`
ValsTsrs map[string]*etensor.Float32 `view:"-" desc:"for holding layer values"`
Weights etensor.Float32 `desc:"synaptic weights: outer loop is units, inner loop is inputs"`
}
SoftMax is a softmax decoder
func (*SoftMax) Decode ¶
Decode decodes the given variable name from layers (forward pass) See Sorted list of indexes for the decoding output -- i.e., Sorted[0] is the most likely -- that is returned here as a convenience.
func (*SoftMax) Sort ¶
func (sm *SoftMax) Sort()
Sort updates Sorted indexes of the current Unit category activations sorted from highest to lowest. i.e., the 0-index value has the strongest decoded output category, 1 the next-strongest, etc.
Click to show internal directories.
Click to hide internal directories.