Documentation
¶
Overview ¶
Package fsfffb provides Fast and Slow feedforward (FF) and feedback (FB) inhibition (FFFB) based on incoming spikes (FF) and outgoing spikes (FB).
This produces a robust, graded k-Winners-Take-All dynamic of sparse distributed representations having approximately k out of N neurons active at any time, where k is typically 10-20 percent of N.
Index ¶
- type GiParams
- func (fb *GiParams) Defaults()
- func (fb *GiParams) FS(fsi, gext float32, clamped bool) float32
- func (fb *GiParams) FS0Thr(val float32) float32
- func (fb *GiParams) FSiFmFFs(fsi *float32, ffs, fbs float32)
- func (fb *GiParams) Inhib(inh *Inhib, gimult float32)
- func (fb *GiParams) SSFmFBs(ssf, ssi *float32, fbs float32)
- func (fb *GiParams) Update()
- type Inhib
- func (fi *Inhib) Decay(decay float32)
- func (fi *Inhib) FloatFmIntFactor() float32
- func (fi *Inhib) FloatFromInt(ival int32) float32
- func (fi *Inhib) FloatToInt(val float32, nneurons int) int32
- func (fi *Inhib) FloatToIntFactor() float32
- func (fi *Inhib) GiFmFSSS() float32
- func (fi *Inhib) Init()
- func (fi *Inhib) InitRaw()
- func (fi *Inhib) IntToRaw()
- func (fi *Inhib) LayerMax(liGi float32)
- func (fi *Inhib) PoolMax(piGi float32)
- func (fi *Inhib) RawIncr(spike, geRaw, geExt float32, nneurons int)
- func (fi *Inhib) RawIncrInt(spike, geRaw, geExt float32, nneurons int)
- func (fi *Inhib) SaveOrig()
- func (fi *Inhib) SpikesFmRaw(nneurons int)
- func (fi *Inhib) Zero()
- type Inhibs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GiParams ¶ added in v1.7.0
type GiParams struct {
// enable this level of inhibition
On slbool.Bool `desc:"enable this level of inhibition"`
// [def: 1,1.1,0.75,0.9] [viewif: On] [min: 0] [0.8-1.5 typical, can go lower or higher as needed] overall inhibition gain -- this is main parameter to adjust to change overall activation levels -- it scales both the the FS and SS factors uniformly
Gi float32 `` /* 249-byte string literal not displayed */
// [def: 0.5,1,4] [viewif: On] [min: 0] amount of FB spikes included in FF for driving FS -- for small networks, 0.5 or 1 works best; larger networks and more demanding inhibition requires higher levels.
FB float32 `` /* 204-byte string literal not displayed */
// [def: 6] [viewif: On] [min: 0] fast spiking (PV+) intgration time constant in cycles (msec) -- tau is roughly how long it takes for value to change significantly -- 1.4x the half-life.
FSTau float32 `` /* 188-byte string literal not displayed */
// [def: 30] [viewif: On] [min: 0] multiplier on SS slow-spiking (SST+) in contributing to the overall Gi inhibition -- FS contributes at a factor of 1
SS float32 `` /* 152-byte string literal not displayed */
// [def: 20] [viewif: On] [min: 0] slow-spiking (SST+) facilitation decay time constant in cycles (msec) -- facilication factor SSf determines impact of FB spikes as a function of spike input-- tau is roughly how long it takes for value to change significantly -- 1.4x the half-life.
SSfTau float32 `` /* 284-byte string literal not displayed */
// [def: 50] [viewif: On] [min: 0] slow-spiking (SST+) intgration time constant in cycles (msec) cascaded on top of FSTau -- tau is roughly how long it takes for value to change significantly -- 1.4x the half-life.
SSiTau float32 `` /* 215-byte string literal not displayed */
// [def: 0.1] [viewif: On] fast spiking zero point -- below this level, no FS inhibition is computed, and this value is subtracted from the FSi
FS0 float32 `` /* 145-byte string literal not displayed */
// [def: 50] [viewif: On] time constant for updating a running average of the feedforward inhibition over a longer time scale, for computing FFPrv
FFAvgTau float32 `` /* 148-byte string literal not displayed */
// [def: 0] [viewif: On] proportion of previous average feed-forward inhibition (FFAvgPrv) to add, resulting in an accentuated temporal-derivative dynamic where neurons respond most strongly to increases in excitation that exceeds inhibition from last time.
FFPrv float32 `` /* 259-byte string literal not displayed */
// [view: -] rate = 1 / tau
FSDt float32 `inactive:"+" view:"-" json:"-" xml:"-" desc:"rate = 1 / tau"`
// [view: -] rate = 1 / tau
SSfDt float32 `inactive:"+" view:"-" json:"-" xml:"-" desc:"rate = 1 / tau"`
// [view: -] rate = 1 / tau
SSiDt float32 `inactive:"+" view:"-" json:"-" xml:"-" desc:"rate = 1 / tau"`
// [view: -] rate = 1 / tau
FFAvgDt float32 `inactive:"+" view:"-" json:"-" xml:"-" desc:"rate = 1 / tau"`
// contains filtered or unexported fields
}
GiParams parameterizes feedforward (FF) and feedback (FB) inhibition (FFFB) based on incoming spikes (FF) and outgoing spikes (FB) across Fast (PV+) and Slow (SST+) timescales. FF -> PV -> FS fast spikes, FB -> SST -> SS slow spikes (slow to get going)
func (*GiParams) FS ¶ added in v1.7.0
FS returns the current effective FS value based on fsi and fsd if clamped, then only use gext, without applying FS0
func (*GiParams) FSiFmFFs ¶ added in v1.7.0
FSiFmFFs updates fast-spiking inhibition from FFs spikes
func (*GiParams) Inhib ¶ added in v1.7.0
Inhib is full inhibition computation for given inhib state which has aggregated FFs and FBs spiking values
type Inhib ¶
type Inhib struct {
// all feedforward incoming spikes into neurons in this pool -- raw aggregation
FFsRaw float32 `desc:"all feedforward incoming spikes into neurons in this pool -- raw aggregation"`
// all feedback outgoing spikes generated from neurons in this pool -- raw aggregation
FBsRaw float32 `desc:"all feedback outgoing spikes generated from neurons in this pool -- raw aggregation"`
// all extra GeExt conductances added to neurons
GeExtRaw float32 `desc:"all extra GeExt conductances added to neurons"`
// all feedforward incoming spikes into neurons in this pool, normalized by pool size
FFs float32 `desc:"all feedforward incoming spikes into neurons in this pool, normalized by pool size"`
// all feedback outgoing spikes generated from neurons in this pool, normalized by pool size
FBs float32 `desc:"all feedback outgoing spikes generated from neurons in this pool, normalized by pool size"`
// all extra GeExt conductances added to neurons, normalized by pool size
GeExts float32 `desc:"all extra GeExt conductances added to neurons, normalized by pool size"`
// if true, this layer is hard-clamped and should use GeExts exclusively for PV
Clamped slbool.Bool `desc:"if true, this layer is hard-clamped and should use GeExts exclusively for PV"`
// fast spiking PV+ fast integration of FFs feedforward spikes
FSi float32 `desc:"fast spiking PV+ fast integration of FFs feedforward spikes"`
// slow spiking SST+ integration of FBs feedback spikes
SSi float32 `desc:"slow spiking SST+ integration of FBs feedback spikes"`
// slow spiking facilitation factor, representing facilitating effects of recent activity
SSf float32 `desc:"slow spiking facilitation factor, representing facilitating effects of recent activity"`
// overall fast-spiking inhibitory conductance
FSGi float32 `desc:"overall fast-spiking inhibitory conductance"`
// overall slow-spiking inhibitory conductance
SSGi float32 `desc:"overall slow-spiking inhibitory conductance"`
// overall inhibitory conductance = FSGi + SSGi
Gi float32 `desc:"overall inhibitory conductance = FSGi + SSGi"`
// original value of the inhibition (before pool or other effects)
GiOrig float32 `desc:"original value of the inhibition (before pool or other effects)"`
// for pools, this is the layer-level inhibition that is MAX'd with the pool-level inhibition to produce the net inhibition
LayGi float32 `` /* 127-byte string literal not displayed */
// longer time scale running average FF drive -- used for FFAvgPrv
FFAvg float32 `desc:"longer time scale running average FF drive -- used for FFAvgPrv"`
// previous theta cycle FFAvg value -- for FFPrv factor -- updated in Decay function that is called at start of new ThetaCycle
FFAvgPrv float32 `` /* 130-byte string literal not displayed */
// int32 atomic add compatible integration of FFsRaw
FFsRawInt int32 `desc:"int32 atomic add compatible integration of FFsRaw"`
// int32 atomic add compatible integration of FBsRaw
FBsRawInt int32 `desc:"int32 atomic add compatible integration of FBsRaw"`
// int32 atomic add compatible integration of GeExtRaw
GeExtRawInt int32 `desc:"int32 atomic add compatible integration of GeExtRaw"`
}
Inhib contains state values for computed FFFB inhibition
func (*Inhib) FloatFmIntFactor ¶ added in v1.7.9
FloatFmIntFactor returns the factor used for converting int32 back to float32 -- this is 1 / FloatToIntFactor for faster multiplication instead of dividing.
func (*Inhib) FloatFromInt ¶ added in v1.7.9
FloatFromInt converts the given int32 value produced via FloatToInt back into a float32 (divides by factor)
func (*Inhib) FloatToInt ¶ added in v1.7.9
FloatToInt converts the given floating point value to a large int for max updating.
func (*Inhib) FloatToIntFactor ¶ added in v1.7.9
FloatToIntFactor returns the factor used for converting float32 to int32 for summing, assuming that the overall value is in the general order of 0-1 (512 is the max).
func (*Inhib) GiFmFSSS ¶ added in v1.6.1
GiFmFSSS returns the sum of FSGi and SSGi as overall inhibition
func (*Inhib) InitRaw ¶
func (fi *Inhib) InitRaw()
InitRaw clears raw spike counters -- done every cycle prior to accumulating
func (*Inhib) IntToRaw ¶ added in v1.7.9
func (fi *Inhib) IntToRaw()
IntToRaw computes int values into float32 raw values
func (*Inhib) LayerMax ¶
LayerMax updates given pool-level inhib values from given layer-level Gi with resulting value being the Max of either
func (*Inhib) PoolMax ¶
PoolMax updates given layer-level inhib values from given pool-level with resulting value being the Max of either
func (*Inhib) RawIncr ¶ added in v1.7.9
RawIncr increments raw values from given neuron-based input values
func (*Inhib) RawIncrInt ¶ added in v1.7.9
RawIncrInt increments raw values from given neuron-based input values for the int-based values (typically use Atomic InterlockedAdd instead)
func (*Inhib) SaveOrig ¶
func (fi *Inhib) SaveOrig()
SaveOrig saves the current Gi values as original values
func (*Inhib) SpikesFmRaw ¶
SpikesFmRaw updates spike values from raw, dividing by given number in pool
