brainpy.running.Runner#

class brainpy.running.Runner(target, monitors=None, fun_monitors=None, jit=True, progress_bar=True, dyn_vars=None, numpy_mon_after_run=True)[source]#

Base Runner.

Parameters
  • target (Any) – The target model.

  • monitors (None, sequence of str, dict, Monitor) –

    Variables to monitor.

    • A list of string. Like monitors=[‘a’, ‘b’, ‘c’]

    • A list of string with index specification. Like monitors=[(‘a’, 1), (‘b’, [1,3,5]), ‘c’]

    • A dict with the explicit monitor target, like: monitors={‘a’: model.spike, ‘b’: model.V}

    • A dict with the index specification, like: monitors={‘a’: (model.spike, 0), ‘b’: (model.V, [1,2])}

  • fun_monitors (dict) – Monitoring variables by callable functions. Should be a dict. The key should be a string for later retrieval by runner.mon[key]. The value should be a callable function which receives two arguments: t and dt.

  • jit (bool, dict) – The JIT settings.

  • progress_bar (bool) – Use progress bar to report the running progress or not?

  • dyn_vars (Optional, dict) – The dynamically changed variables. Instance of Variable.

  • numpy_mon_after_run (bool) – When finishing the network running, transform the JAX arrays into numpy ndarray or not?

__init__(target, monitors=None, fun_monitors=None, jit=True, progress_bar=True, dyn_vars=None, numpy_mon_after_run=True)[source]#

Methods

__init__(target[, monitors, fun_monitors, ...])

build_monitors(return_without_idx, ...)

rtype

Callable

format_monitors()

Attributes

mon

jit

target