spikingjelly.timing_based package#
Encoding#
- class spikingjelly.timing_based.encoding.GaussianTuning(n, m, x_min, x_max)[源代码]#
基类:
object
中文
使用高斯感受野将连续值编码为脉冲时间。每个输入维度由
m个神经元 编码,公开属性mu和sigma2分别保存感受野中心和方差。- 参数:
- 抛出:
ValueError --
n或m非法、输入范围形状不匹配,或任一x_min不小于对应的x_max
English
Encode continuous values as spike times with Gaussian receptive fields. Each input dimension uses
mneurons. Public attributesmuandsigma2contain the receptive-field centers and variances.- 参数:
- 抛出:
ValueError -- If
normis invalid, the range tensors have incompatible shapes, or any minimum is not smaller than its maximum
- encode(x, max_spike_time=50)[源代码]#
-
中文
- 参数:
- 返回:
形状为
[batch_size, n, samples_count, m]的脉冲时间- 返回类型:
- 抛出:
AssertionError -- 输入不是三维张量或特征维不等于
nValueError --
max_spike_time为负数
English
- 参数:
- 返回:
Spike times with shape
[batch_size, n, samples_count, m]- 返回类型:
- 抛出:
AssertionError -- If the input is not three-dimensional or its feature dimension differs from
nValueError -- If
max_spike_timeis negative
Neuron#
- class spikingjelly.timing_based.neuron.Tempotron(in_features, out_features, T, tau=15.0, tau_s=3.75, v_threshold=1.0)[源代码]#
基类:
Module
中文
实现 Tempotron 脉冲时序分类神经元。输入中的每个值表示对应输入神经元 的脉冲时刻,负值表示未发放。
- 参数:
- 抛出:
ValueError -- 数量、时间常数或阈值非正,或两个时间常数相等
English
Implement a Tempotron neuron for spike-timing classification. Each input value is the spike time of one input neuron; a negative value means that neuron did not spike.
- 参数:
- 抛出:
ValueError -- If a size, time constant, or threshold is not positive, or if the two time constants are equal
- forward(in_spikes, ret_type)[源代码]#
-
中文
- 参数:
- 返回:
完整电压轨迹、最大电压或输出脉冲时刻
- 返回类型:
- 抛出:
ValueError --
ret_type不受支持
English
- 参数:
- 返回:
Full voltage trace, maximum voltage, or output spike times
- 返回类型:
- 抛出:
ValueError -- If
ret_typeis unsupported