spaic.Monitor package

Submodules

spaic.Monitor.Monitor module

Created on 2020/8/12 @project: SPAIC @filename: Monitor @author: Hong Chaofei @contact: hongchf@gmail.com

@description: 定义神经集群放电以及神经元状态量、连接状态量的仿真记录模块

class spaic.Monitor.Monitor.Monitor(target, var_name, index='full', dt=None, get_grad=False, nbatch=True)[source]

Bases: BaseModule

check_var_name(var_name)[source]

Check if variable is in the target model, and add the target id label to the variable name.

Parameters:
  • var_name (original variable name) –

  • Returns (modified variable name) –

  • -------

get_str(level)[source]
monitor_on()[source]
monitor_off()[source]
clear()[source]
build(backend: Backend)[source]
init_record()[source]
update_step()[source]
push_data(data, time)[source]

push data to monitor by backend

class spaic.Monitor.Monitor.SpikeMonitor(target, var_name='O', index='full', dt=None, get_grad=False, nbatch=False)[source]

Bases: Monitor

build(backend: Backend)[source]
clear()[source]
init_record()[source]
push_spike_train(spk_times, spk_index, batch_index=0)[source]
update_step(variables)[source]

Recoding the variable values of the current step.

property spk_times
property spk_index
property spk_grad
property time_spk_rate
property time_pop_rate
property spk_count
property time
class spaic.Monitor.Monitor.StateMonitor(target, var_name, index='full', dt=None, get_grad=False, nbatch=False)[source]

Bases: Monitor

build(backend: Backend)[source]
clear()[source]
init_record()[source]

Inite record of new trial Returns:

update_step(variables)[source]

Recoding the variable values of the current step.

property nbatch_values
property nbatch_times
property values
property tensor_values
property grads
property times
plot_weight(**kwargs)[source]

Module contents

Created on 2020/8/12 @project: SPAIC @filename: __init__.py @author: Hong Chaofei @contact: hongchf@gmail.com

@description: