nxx1

package
v2.0.0-dev0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {

	// threshold value Theta (Q) for firing output activation (.5 is more accurate value based on AdEx biological parameters and normalization
	Thr float32 `default:"0.5"`

	// 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 `default:"80,100,40,20" 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 `default:"0.005,0.01" min:"0"`

	// 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 `default:"0.01"`

	// multiplier on sigmoid used for computing values for net < thr
	SigMult float32 `default:"0.33" display:"-" json:"-" xml:"-"`

	// power for computing sig_mult_eff as function of gain * nvar
	SigMultPow float32 `default:"0.8" display:"-" json:"-" xml:"-"`

	// gain multipler on (net - thr) for sigmoid used for computing values for net < thr
	SigGain float32 `default:"3" display:"-" json:"-" xml:"-"`

	// interpolation range above zero to use interpolation
	InterpRange float32 `default:"0.01" display:"-" json:"-" xml:"-"`

	// range in units of nvar over which to apply gain correction to compensate for convolution
	GainCorRange float32 `default:"10" display:"-" json:"-" xml:"-"`

	// gain correction multiplier -- how much to correct gains
	GainCor float32 `default:"0.1" display:"-" json:"-" xml:"-"`

	// sig_gain / nvar
	SigGainNVar float32 `display:"-" json:"-" xml:"-"`

	// overall multiplier on sigmoidal component for values below threshold = sig_mult * pow(gain * nvar, sig_mult_pow)
	SigMultEff float32 `display:"-" json:"-" xml:"-"`

	// 0.5 * sig_mult_eff -- used for interpolation portion
	SigValAt0 float32 `display:"-" json:"-" xml:"-"`

	// function value at interp_range - sig_val_at_0 -- for interpolation
	InterpVal float32 `display:"-" json:"-" xml:"-"`
}

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) Defaults

func (xp *Params) Defaults()

func (*Params) NoisyXX1

func (xp *Params) NoisyXX1(x float32) float32

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

func (xp *Params) NoisyXX1Gain(x, gain float32) float32

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) Update

func (xp *Params) Update()

func (*Params) XX1

func (xp *Params) XX1(x float32) float32

XX1 computes the basic x/(x+1) function

func (*Params) XX1GainCor

func (xp *Params) XX1GainCor(x float32) float32

XX1GainCor computes x/(x+1) with gain correction within GainCorRange to compensate for convolution effects

func (*Params) XX1GainCorGain

func (xp *Params) XX1GainCorGain(x, gain float32) float32

X11GainCorGain computes x/(x+1) with gain correction within GainCorRange to compensate for convolution effects -- using external gain factor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL