brainpy.simulation.brainobjects.SpikeTimeInput
- class brainpy.simulation.brainobjects.SpikeTimeInput(size, times, indices, need_sort=True, **kwargs)[source]
The input neuron group characterized by spikes emitting at given times.
>>> # Get 2 neurons, firing spikes at 10 ms and 20 ms. >>> SpikeTimeInput(2, times=[10, 20]) >>> # or >>> # Get 2 neurons, the neuron 0 fires spikes at 10 ms and 20 ms. >>> SpikeTimeInput(2, times=[10, 20], indices=[0, 0]) >>> # or >>> # Get 2 neurons, neuron 0 fires at 10 ms and 30 ms, neuron 1 fires at 20 ms. >>> SpikeTimeInput(2, times=[10, 20, 30], indices=[0, 1, 0]) >>> # or >>> # Get 2 neurons; at 10 ms, neuron 0 fires; at 20 ms, neuron 0 and 1 fire; >>> # at 30 ms, neuron 1 fires. >>> SpikeTimeInput(2, times=[10, 20, 20, 30], indices=[0, 0, 1, 1])
- Parameters
size (int, tuple, list) – The neuron group geometry.
indices (int, list, tuple) – The neuron indices at each time point to emit spikes.
times (list, np.ndarray) – The time points which generate the spikes.
steps (tuple of str, tuple of function, dict of (str, function), optional) – The callable function, or a list of callable functions.
monitors (None, list, tuple, datastructures.Monitor) – Variables to monitor.
name (str, optional) – The name of the dynamic system.
Methods
__init__
(size, times, indices[, need_sort])build
([inputs, method, show_code])cpu
()cuda
()ints
([method])Collect all integrators in this node and the children nodes.
load_states
(filename[, verbose, check])Load the model states.
nodes
([method, _paths])Collect all children nodes.
register_constant_delay
(key, size, delay[, ...])Register a constant delay.
run
(duration[, dt, report, inputs, extra_func])The running function.
save_states
(filename[, all_vars])Save the model states.
struct_run
(duration[, dt])to
(devices)tpu
()train_vars
([method])The shortcut for retrieving all trainable variables.
unique_name
([name, type])Get the unique name for this object.
update
(_t, _i, **kwargs)The function to specify the updating rule.
vars
([method])Collect all variables in this node and the children nodes.
Attributes
implicit_nodes
Used to wrap the implicit children nodes which cannot be accessed by self.xxx
implicit_vars
Used to wrap the implicit variables which cannot be accessed by self.xxx
target_backend
Used to specify the target backend which the model to run.