Documentation ¶
Overview ¶
Package nxx1 provides the Noisy-X-over-X-plus-1 activation function that well-characterizes the neural response function empirically, as a saturating sigmoid-like nonlinear response with an initial largely-linear regime.
The basic x/(x+1) sigmoid function is convolved with a gaussian noise kernel to produce a better approximation of the effects of noise on neural firing -- the main effect is to create a continuous graded early level of firing even slightly below threshold, softening the otherwise hard transition to firing at threshold.
A hand-optimized piece-wise function approximation is used to generate the NXX1 function instead of requiring a lookup table of the gaussian convolution. This is much easier to use across a range of computational platforms including GPU's, and produces very similar overall values.
Index ¶
- type Params
- func (xp *Params) Defaults()
- func (xp *Params) NoisyXX1(x float32) float32
- func (xp *Params) NoisyXX1Gain(x, gain float32) float32
- func (xp *Params) Update()
- func (xp *Params) XX1(x float32) float32
- func (xp *Params) XX1GainCor(x float32) float32
- func (xp *Params) XX1GainCorGain(x, gain float32) float32
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Params ¶
type Params struct { // [def: 0.5] threshold value Theta (Q) for firing output activation (.5 is more accurate value based on AdEx biological parameters and normalization Thr float32 `` /* 152-byte string literal not displayed */ // [def: 80,100,40,20] [min: 0] gain (gamma) of the rate-coded activation functions -- 100 is default, 80 works better for larger models, and 20 is closer to the actual spiking behavior of the AdEx model -- use lower values for more graded signals, generally in lower input/sensory layers of the network Gain float32 `` /* 305-byte string literal not displayed */ // [def: 0.005,0.01] [min: 0] variance of the Gaussian noise kernel for convolving with XX1 in NOISY_XX1 and NOISY_LINEAR -- determines the level of curvature of the activation function near the threshold -- increase for more graded responding there -- note that this is not actual stochastic noise, just constant convolved gaussian smoothness to the activation function NVar float32 `` /* 372-byte string literal not displayed */ // [def: 0.01] threshold on activation below which the direct vm - act.thr is used -- this should be low -- once it gets active should use net - g_e_thr ge-linear dynamics (gelin) VmActThr float32 `` /* 182-byte string literal not displayed */ // [def: 0.33] [view: -] multiplier on sigmoid used for computing values for net < thr SigMult float32 `def:"0.33" view:"-" json:"-" xml:"-" desc:"multiplier on sigmoid used for computing values for net < thr"` // [def: 0.8] [view: -] power for computing sig_mult_eff as function of gain * nvar SigMultPow float32 `def:"0.8" view:"-" json:"-" xml:"-" desc:"power for computing sig_mult_eff as function of gain * nvar"` // [def: 3] [view: -] gain multipler on (net - thr) for sigmoid used for computing values for net < thr SigGain float32 `def:"3" view:"-" json:"-" xml:"-" desc:"gain multipler on (net - thr) for sigmoid used for computing values for net < thr"` // [def: 0.01] [view: -] interpolation range above zero to use interpolation InterpRange float32 `def:"0.01" view:"-" json:"-" xml:"-" desc:"interpolation range above zero to use interpolation"` // [def: 10] [view: -] range in units of nvar over which to apply gain correction to compensate for convolution GainCorRange float32 `` /* 130-byte string literal not displayed */ // [def: 0.1] [view: -] gain correction multiplier -- how much to correct gains GainCor float32 `def:"0.1" view:"-" json:"-" xml:"-" desc:"gain correction multiplier -- how much to correct gains"` // [view: -] sig_gain / nvar SigGainNVar float32 `view:"-" json:"-" xml:"-" desc:"sig_gain / nvar"` // [view: -] overall multiplier on sigmoidal component for values below threshold = sig_mult * pow(gain * nvar, sig_mult_pow) SigMultEff float32 `` /* 145-byte string literal not displayed */ // [view: -] 0.5 * sig_mult_eff -- used for interpolation portion SigValAt0 float32 `view:"-" json:"-" xml:"-" desc:"0.5 * sig_mult_eff -- used for interpolation portion"` // [view: -] function value at interp_range - sig_val_at_0 -- for interpolation InterpVal float32 `view:"-" json:"-" xml:"-" desc:"function value at interp_range - sig_val_at_0 -- for interpolation"` }
Params are the Noisy X/(X+1) rate-coded activation function parameters. This function well-characterizes the neural response function empirically, as a saturating sigmoid-like nonlinear response with an initial largely-linear regime. The basic x/(x+1) sigmoid function is convolved with a gaussian noise kernel to produce a better approximation of the effects of noise on neural firing -- the main effect is to create a continuous graded early level of firing even slightly below threshold, softening the otherwise hard transition to firing at threshold. A hand-optimized piece-wise function approximation is used to generate the NXX1 function instead of requiring a lookup table of the gaussian convolution. This is much easier to use across a range of computational platforms including GPU's, and produces very similar overall values. abc.
func (*Params) NoisyXX1 ¶
NoisyXX1 computes the Noisy x/(x+1) function -- directly computes close approximation to x/(x+1) convolved with a gaussian noise function with variance nvar. No need for a lookup table -- very reasonable approximation for standard range of parameters (nvar = .01 or less -- higher values of nvar are less accurate with large gains, but ok for lower gains)
func (*Params) NoisyXX1Gain ¶
NoisyXX1Gain computes the noisy x/(x+1) function -- directly computes close approximation to x/(x+1) convolved with a gaussian noise function with variance nvar. No need for a lookup table -- very reasonable approximation for standard range of parameters (nvar = .01 or less -- higher values of nvar are less accurate with large gains, but ok for lower gains). Using external gain factor.
func (*Params) XX1GainCor ¶
XX1GainCor computes x/(x+1) with gain correction within GainCorRange to compensate for convolution effects
func (*Params) XX1GainCorGain ¶
X11GainCorGain computes x/(x+1) with gain correction within GainCorRange to compensate for convolution effects -- using external gain factor