spikingjelly.clock_driven.model package

Submodules

spikingjelly.clock_driven.model.spiking_resnet module

class spikingjelly.clock_driven.model.spiking_resnet.SpikingResNet(block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]

基类:Module

forward(x)[源代码]
training: bool
spikingjelly.clock_driven.model.spiking_resnet.spiking_resnet18(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single-step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNet-18

返回类型

torch.nn.Module

A spiking version of ResNet-18 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.spiking_resnet34(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single-step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNet-34

返回类型

torch.nn.Module

A spiking version of ResNet-34 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.spiking_resnet50(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single-step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNet-50

返回类型

torch.nn.Module

A spiking version of ResNet-50 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.spiking_resnet101(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single-step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNet-101

返回类型

torch.nn.Module

A spiking version of ResNet-101 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.spiking_resnet152(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNet-152

返回类型

torch.nn.Module

A spiking version of ResNet-152 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.spiking_resnext50_32x4d(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNeXt-50 32x4d

返回类型

torch.nn.Module

A spiking version of ResNeXt-50 32x4d model from “Aggregated Residual Transformation for Deep Neural Networks”

spikingjelly.clock_driven.model.spiking_resnet.spiking_resnext101_32x8d(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking ResNeXt-101 32x8d

返回类型

torch.nn.Module

A spiking version of ResNeXt-101 32x8d model from “Aggregated Residual Transformation for Deep Neural Networks”

spikingjelly.clock_driven.model.spiking_resnet.spiking_wide_resnet50_2(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking Wide ResNet-50-2

返回类型

torch.nn.Module

A spiking version of Wide ResNet-50-2 model from “Wide Residual Networks”

The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.

spikingjelly.clock_driven.model.spiking_resnet.spiking_wide_resnet101_2(pretrained=False, progress=True, single_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • single_step_neuron (callable) – a single step neuron

  • kwargs (dict) – kwargs for single_step_neuron

返回

Spiking Wide ResNet-101-2

返回类型

torch.nn.Module

A spiking version of Wide ResNet-101-2 model from “Wide Residual Networks”

The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.

class spikingjelly.clock_driven.model.spiking_resnet.MultiStepSpikingResNet(block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=64, replace_stride_with_dilation=None, norm_layer=None, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]

基类:Module

forward(x)[源代码]
参数

x (torch.Tensor) – the input with shape=[N, C, H, W] or [*, N, C, H, W]

返回

output

返回类型

torch.Tensor

training: bool
spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnet18(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNet-18

返回类型

torch.nn.Module

A multi-step spiking version of ResNet-18 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnet34(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNet-34

返回类型

torch.nn.Module

A multi-step spiking version of ResNet-34 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnet50(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNet-50

返回类型

torch.nn.Module

A multi-step spiking version of ResNet-50 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnet101(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNet-101

返回类型

torch.nn.Module

A multi-step spiking version of ResNet-101 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnet152(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNet-152

返回类型

torch.nn.Module

A multi-step spiking version of ResNet-152 model from “Deep Residual Learning for Image Recognition”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnext50_32x4d(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNeXt-50 32x4d

返回类型

torch.nn.Module

A multi-step spiking version of ResNeXt-50 32x4d model from “Aggregated Residual Transformation for Deep Neural Networks”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_resnext101_32x8d(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking ResNeXt-101 32x8d

返回类型

torch.nn.Module

A multi-step spiking version of ResNeXt-101 32x8d model from “Aggregated Residual Transformation for Deep Neural Networks”

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_wide_resnet50_2(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking Wide ResNet-50-2

返回类型

torch.nn.Module

A multi-step spiking version of Wide ResNet-50-2 model from “Wide Residual Networks”

The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.

spikingjelly.clock_driven.model.spiking_resnet.multi_step_spiking_wide_resnet101_2(pretrained=False, progress=True, T: Optional[int] = None, multi_step_neuron: Optional[callable] = None, **kwargs)[源代码]
参数
  • pretrained (bool) – If True, the SNN will load parameters from the ANN pre-trained on ImageNet

  • progress (bool) – If True, displays a progress bar of the download to stderr

  • T (int) – total time-steps

  • multi_step_neuron (callable) – a multi-step neuron

  • kwargs (dict) – kwargs for multi_step_neuron

返回

Spiking Wide ResNet-101-2

返回类型

torch.nn.Module

A multi-step spiking version of Wide ResNet-101-2 model from “Wide Residual Networks”

The model is the same as ResNet except for the bottleneck number of channels which is twice larger in every block. The number of channels in outer 1x1 convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048 channels, and in Wide ResNet-50-2 has 2048-1024-2048.

Module contents