Documentation ¶
Index ¶
- Variables
- type Stats
- func (st *Stats) ClosestPat(net emer.Network, layNm, unitVar string, pats *etable.Table, ...) (int, float32, string)
- func (st *Stats) ConfigRasters(net emer.Network, layers []string)
- func (st *Stats) F32Tensor(name string) *etensor.Float32
- func (st *Stats) F64Tensor(name string) *etensor.Float64
- func (st *Stats) Float(name string) float64
- func (st *Stats) Init()
- func (st *Stats) Int(name string) int
- func (st *Stats) PCAStats(ix *etable.IdxView, varNm string, layers []string)
- func (st *Stats) Print(stats []string) string
- func (st *Stats) RasterRec(net emer.Network, cyc int, varNm string, layers []string)
- func (st *Stats) ResetStartTimer(name string) *timer.Time
- func (st *Stats) ResetTimer(name string) *timer.Time
- func (st *Stats) SetFloat(name string, value float64)
- func (st *Stats) SetInt(name string, value int)
- func (st *Stats) SetLayerTensor(net emer.Network, layNm, unitVar string) *etensor.Float32
- func (st *Stats) SetRasterCol(sr, tsr *etensor.Float32, col int)
- func (st *Stats) SetString(name string, value string)
- func (st *Stats) SimMat(name string) *simat.SimMat
- func (st *Stats) StartTimer(name string) *timer.Time
- func (st *Stats) StopTimer(name string) *timer.Time
- func (st *Stats) String(name string) string
- func (st *Stats) Timer(name string) *timer.Time
Constants ¶
This section is empty.
Variables ¶
var PCAStrongThr = 0.01
PCAStrongThr is the threshold for counting PCA eigenvalues as "strong"
Functions ¶
This section is empty.
Types ¶
type Stats ¶
type Stats struct { Floats map[string]float64 Strings map[string]string Ints map[string]int F32Tensors map[string]*etensor.Float32 `desc:"float32 tensor used for grabbing values from layers"` F64Tensors map[string]*etensor.Float64 `desc:"float64 tensor as needed for other computations"` SimMats map[string]*simat.SimMat `desc:"similarity matrix for comparing pattern similarities"` PCA pca.PCA `desc:"one PCA object can be reused for all PCA computations"` Timers map[string]*timer.Time `desc:"named timers available for timing how long different computations take (wall-clock time)"` }
Stats provides maps for storing statistics as named scalar and tensor values. These stats are available in the elog.Context for use during logging.
func (*Stats) ClosestPat ¶
func (st *Stats) ClosestPat(net emer.Network, layNm, unitVar string, pats *etable.Table, colnm, namecol string) (int, float32, string)
ClosestStat finds the closest pattern in given column of given table of possible patterns, compared to layer activation pattern using given variable. Returns the row number, correlation value, and value of a column named namecol for that row if non-empty. Column must be etensor.Float32
func (*Stats) ConfigRasters ¶
ConfigRasters configures spike rasters
func (*Stats) F32Tensor ¶
F32Tensor returns a float32 tensor of given name, creating if not yet made
func (*Stats) F64Tensor ¶
F64Tensor returns a float64 tensor of given name, creating if not yet made
func (*Stats) PCAStats ¶
PCAStats computes PCA statistics on recorded hidden activation patterns on given log table (IdxView), and given list of layer names and variable name -- columns named "layer_var". Helpful for measuring the overall information (variance) in the representations to detect a common failure mode where a few patterns dominate over everything ("hogs"). Records Float stats as: layer_PCA_NStrong: number of eigenvalues above the PCAStrongThr threshold layer_PCA_Top5: average strength of top 5 eigenvalues layer_PCA_Next5: average strength of next 5 eigenvalues layer_PCA_Rest: average strength of remaining eigenvalues (if more than 10 total eigens)
func (*Stats) Print ¶
Print returns a formatted Name: Value string of stat values, suitable for displaying at the bottom of the NetView or otherwise printing. Looks for names of stats in order of fields in Stats object (Floats, Strings, Ints)
func (*Stats) RasterRec ¶
RasterRec records data from given layers, variable name to raster for given cycle number (X axis index)
func (*Stats) ResetStartTimer ¶
ResetStartTimer resets then starts given named timer
func (*Stats) ResetTimer ¶
ResetTimer resets given named timer
func (*Stats) SetLayerTensor ¶
SetLayerTensor sets tensor of Unit values on a layer for given variable to a F32Tensor with name = layNm
func (*Stats) SetRasterCol ¶
SetRasterCol sets column of given raster from data
func (*Stats) SimMat ¶
SimMat returns a SimMat similarity matrix of given name, creating if not yet made
func (*Stats) StartTimer ¶
StartTimer starts given named timer