brainpy.dyn.base.ConstantDelay#

class brainpy.dyn.base.ConstantDelay(size, delay, dtype=None, dt=None, **kwargs)[source]#

Class used to model constant delay variables.

This class automatically supports batch size on the last axis. For example, if you run batch with the size of (10, 100), where 100 are batch size, then this class can automatically support your batched data. For examples,

>>> import brainpy as bp
>>> bp.dyn.ConstantDelay(size=(10, 100), delay=10.)

This class also support nonuniform delays.

>>> bp.dyn.ConstantDelay(size=100, delay=bp.math.random.random(100) * 4 + 10)
Parameters
  • size (int, list of int, tuple of int) – The delay data size.

  • delay (int, float, function, ndarray) – The delay time. With the unit of dt.

  • dt (float, optional) – The time precision.

  • name (optional, str) – The name of the dynamic system.

__init__(size, delay, dtype=None, dt=None, **kwargs)[source]#

Methods

__init__(size, delay[, dtype, dt])

get_delay_data(name, delay_step, *indices)

Get delay data according to the provided delay steps.

ints([method])

Collect all integrators in this node and the children nodes.

load_states(filename[, verbose])

Load the model states.

nodes([method, level, include_self])

Collect all children nodes.

pull()

push(value)

register_delay(name, delay_step, delay_target)

Register delay variable.

register_implicit_nodes(nodes)

register_implicit_vars(variables)

reset()

Reset the variables.

reset_delay(name, delay_target)

Reset the delay variable.

save_states(filename[, variables])

Save the model states.

train_vars([method, level, include_self])

The shortcut for retrieving all trainable variables.

unique_name([name, type_])

Get the unique name for this object.

update([t, dt])

Update the delay index.

update_delay(name, delay_data)

Update the delay according to the delay data.

vars([method, level, include_self])

Collect all variables in this node and the children nodes.

Attributes

global_delay_vars

latest

name

oldest

steps