spikingjelly.event_driven.encoding package

Module contents

class spikingjelly.event_driven.encoding.GaussianTuning(n, m, x_min: Tensor, x_max: Tensor)[源代码]

基类:object

参数
  • n – 特征的数量,int

  • m – 编码一个特征所使用的神经元数量,int

  • x_min – n个特征的最小值,shape=[n]的tensor

  • x_max – n个特征的最大值,shape=[n]的tensor

Bohte S M, Kok J N, La Poutre J A, et al. Error-backpropagation in temporally encoded networks of spiking neurons[J]. Neurocomputing, 2002, 48(1): 17-37. 中提出的高斯调谐曲线编码方式

编码器所使用的变量所在的device与x_min.device一致

encode(x: Tensor, max_spike_time=50)[源代码]
参数
  • x – shape=[batch_size, n, k],batch_size个数据,每个数据含有n个特征,每个特征中有k个数据

  • max_spike_time – 最大(最晚)脉冲发放时间,也可以称为编码时间窗口的长度

返回

out_spikes, shape=[batch_size, n, k, m],将每个数据编码成了m个神经元的脉冲发放时间