norse.torch.models package

class norse.torch.models.ConvNet(num_channels=1, feature_size=28, method='super', dtype=torch.float32)[source]

Bases: torch.nn.modules.module.Module

A convolutional network with LIF dynamics

Parameters
  • num_channels (int) – Number of input channels

  • feature_size (int) – Number of input features

  • method (str) – Threshold method

Initializes internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class norse.torch.models.ConvNet4(num_channels=1, feature_size=28, method='super', dtype=torch.float32)[source]

Bases: torch.nn.modules.module.Module

A convolutional network with LIF dynamics

Parameters
  • num_channels (int) – Number of input channels

  • feature_size (int) – Number of input features

  • method (str) – Threshold method

Initializes internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class norse.torch.models.MobileNetV2(num_classes=1000, width_mult=1.0, inverted_residual_setting=None, round_nearest=8, block=None, norm_layer=None)[source]

Bases: torch.nn.modules.module.Module

MobileNet V2 main class :param num_classes: Number of classes :type num_classes: int :param width_mult: Width multiplier - adjusts number of channels in each layer by this amount :type width_mult: float :param inverted_residual_setting: Network structure :param round_nearest: Round the number of channels in each layer to be a multiple of this number :type round_nearest: int :param Set to 1 to turn off rounding: :param block: Module specifying inverted residual building block for mobilenet :param norm_layer: Module specifying the normalization layer to use

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
class norse.torch.models.VGG(features, num_classes=1000, init_weights=True)[source]

Bases: torch.nn.modules.module.Module

Initializes internal Module state, shared by both nn.Module and ScriptModule.

forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training: bool
norse.torch.models.mobilenet_v2(pretrained=False, progress=True, **kwargs)[source]

Constructs a MobileNetV2 architecture from “MobileNetV2: Inverted Residuals and Linear Bottlenecks”. :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg11(pretrained=False, progress=True, **kwargs)[source]

VGG 11-layer model (configuration “A”) from “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg11_bn(pretrained=False, progress=True, **kwargs)[source]

VGG 11-layer model (configuration “A”) with batch normalization “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg13(pretrained=False, progress=True, **kwargs)[source]

VGG 13-layer model (configuration “B”) “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg13_bn(pretrained=False, progress=True, **kwargs)[source]

VGG 13-layer model (configuration “B”) with batch normalization “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg16(pretrained=False, progress=True, **kwargs)[source]

VGG 16-layer model (configuration “D”) “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg16_bn(pretrained=False, progress=True, **kwargs)[source]

VGG 16-layer model (configuration “D”) with batch normalization “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg19(pretrained=False, progress=True, **kwargs)[source]

VGG 19-layer model (configuration “E”) “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool

norse.torch.models.vgg19_bn(pretrained=False, progress=True, **kwargs)[source]

VGG 19-layer model (configuration ‘E’) with batch normalization “Very Deep Convolutional Networks For Large-Scale Image Recognition” :param pretrained: If True, returns a model pre-trained on ImageNet :type pretrained: bool :param progress: If True, displays a progress bar of the download to stderr :type progress: bool