networks package
Submodules
networks.cnn module
- class networks.cnn.MobileNetV2(num_classes=10, width_mult=1.0)[source]
Bases:
Module- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- networks.cnn.mobilenet_v2(pretrained=False, progress=True, device='cpu', **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
networks.linear_net module
- class networks.linear_net.LinearNet(input_dim, out_dim)[source]
Bases:
ModuleLinear Classifier with out units and no softmax
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- class networks.linear_net.LinearNetDefer(input_dim, out_dim)[source]
Bases:
ModuleLinear Classifier with out+1 units and no softmax
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- class networks.linear_net.Linear_net_sig(input_dim, out_dim=1)[source]
Bases:
ModuleLinear binary classifier
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
networks.non_linear_net module
- class networks.non_linear_net.NonLinearNet(input_dim, out_dim)[source]
Bases:
ModuleNonLinear Classifier
- 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool