IAF_encode¶
- class vtem.ensemble_encode.IAF_encode(num_neurons, dt, dtype=<type 'numpy.float64'>)¶
Methods
encode(neural_inputs[, startbias, avg_rate]) Encode with IAFs load_parameters([h_kappa, h_bias, h_delta, ...]) Load encoding parameters to GPU reset_timer() Reset the time_count to zeros set_initial_value() Set integration from zeros set_parameters() Set the parameters using default values set_time_count() Set time_count zeros - __init__(num_neurons, dt, dtype=<type 'numpy.float64'>)¶
Population encoding with IAF neurons
Parameters: num_neurons : integer
number of neurons to encode
dt : float
time interval between two consecutive samples in the input for each neuron
dtype : np.float64 or np.float32, optional
dtype of spike interval to be stored (np.float32 not yet tested) If not specified, will be set to np.float64
- encode(neural_inputs, startbias=0, avg_rate=0.1)¶
Encode with IAFs
Parameters: neural_inputs : PitchArray
PitchArray of shape (num_samples, num_neurons) containing inputs to all neurons
startbias : integer, optional
the neuron index corresponding to first column of neural_inputs
avg_rate: float, optional
average spiking rate assumed for neurons, will allocate memory num_samples/avg_rate for each neuron for storing spikes
If not specified, will be set to 0.1
Returns: spikes: ndarray of self.dtype
stores the spikes for one neuron after another
spike_count: ndarray of int32 of size num_neurons
indicates the number of spikes generated by each neuron
Notes
spikes for neuron j can be accessed by
cum_count = np.concatenate((np.zeros(1,np.int32),np.cumsum(spike_count))) tk = spikes[cum_count[j]:cum_count[j+1]]
- load_parameters(h_kappa=None, h_bias=None, h_delta=None, h_sigma=None, h_time_count=None, h_v0=None)¶
Load encoding parameters to GPU
h_kappa, h_bias, h_delta can be set up using default values (using None), or specified together (using ndarrays of dtype)
h_time_count can be set up using default values (using None), or specified values(using ndarrays of dtype)
h_v0 can be set up using default values (using None), or specified values(using ndarrays of dtype)
- reset_timer()¶
Reset the time_count to zeros
- set_initial_value()¶
Set integration from zeros
- set_parameters()¶
Set the parameters using default values
Will set kappa’s to be 1.0, deltas to be 0.03, bias to be 0.8
- set_time_count()¶
Set time_count zeros