norse.torch.models.mobilenet module

class norse.torch.models.mobilenet.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


Defines the computation performed at every call.

Should be overridden by all subclasses.


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.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