brainpy.CondNeuGroup#

class brainpy.CondNeuGroup(size, keep_size=False, C=1.0, A=0.001, V_th=0.0, V_initializer=Uniform(min_val=-70, max_val=-60.0, rng=[4254 1952]), noise=None, method='exp_auto', name=None, mode=None, **channels)[source]#

Base class to model conductance-based neuron group.

The standard formulation for a conductance-based model is given as

\[C_m {dV \over dt} = \sum_jg_j(E - V) + I_{ext}\]

where \(g_j=\bar{g}_{j} M^x N^y\) is the channel conductance, \(E\) is the reversal potential, \(M\) is the activation variable, and \(N\) is the inactivation variable.

\(M\) and \(N\) have the dynamics of

\[{dx \over dt} = \phi_x {x_\infty (V) - x \over \tau_x(V)}\]

where \(x \in [M, N]\), \(\phi_x\) is a temperature-dependent factor, \(x_\infty\) is the steady state, and \(\tau_x\) is the time constant. Equivalently, the above equation can be written as:

\[\frac{d x}{d t}=\phi_{x}\left(\alpha_{x}(1-x)-\beta_{x} x\right)\]

where \(\alpha_{x}\) and \(\beta_{x}\) are rate constants.

New in version 2.1.9: Model the conductance-based neuron model.

Parameters:
  • size (int, sequence of int) – The network size of this neuron group.

  • method (str) – The numerical integration method.

  • name (optional, str) – The neuron group name.

See also

Channel

__init__(size, keep_size=False, C=1.0, A=0.001, V_th=0.0, V_initializer=Uniform(min_val=-70, max_val=-60.0, rng=[4254 1952]), noise=None, method='exp_auto', name=None, mode=None, **channels)[source]#

Methods

__init__(size[, keep_size, C, A, V_th, ...])

clear_input()

Useful for monitoring inputs.

cpu()

Move all variable into the CPU device.

cuda()

Move all variables into the GPU device.

derivative(V, t)

get_batch_shape([batch_size])

get_delay_data(identifier, delay_step, *indices)

Get delay data according to the provided delay steps.

load_state_dict(state_dict[, warn, compatible])

Copy parameters and buffers from state_dict into this module and its descendants.

load_states(filename[, verbose])

Load the model states.

nodes([method, level, include_self])

Collect all children nodes.

register_delay(identifier, delay_step, ...)

Register delay variable.

register_implicit_nodes(*channels, ...)

register_implicit_vars(*variables[, var_cls])

reset(*args, **kwargs)

Reset function which reset the whole variables in the model.

reset_local_delays([nodes])

Reset local delay variables.

reset_state([batch_size])

Reset function which reset the states in the model.

save_states(filename[, variables])

Save the model states.

state_dict()

Returns a dictionary containing a whole state of the module.

to(device)

Moves all variables into the given device.

tpu()

Move all variables into the TPU device.

train_vars([method, level, include_self])

The shortcut for retrieving all trainable variables.

tree_flatten()

Flattens the object as a PyTree.

tree_unflatten(aux, dynamic_values)

Unflatten the data to construct an object of this class.

unique_name([name, type_])

Get the unique name for this object.

update(tdi, *args, **kwargs)

The function to specify the updating rule.

update_local_delays([nodes])

Update local delay variables.

vars([method, level, include_self, ...])

Collect all variables in this node and the children nodes.

Attributes

global_delay_data

Global delay data, which stores the delay variables and corresponding delay targets.

mode

Mode of the model, which is useful to control the multiple behaviors of the model.

name

Name of the model.

varshape

The shape of variables in the neuron group.