mlreco.models.layers.common.mobilenet module¶
-
class
mlreco.models.layers.common.mobilenet.MobileNetV3(cfg, name='mobilenetv3')[source]¶ Bases:
torch.nn.modules.module.ModuleVanilla UResNet with access to intermediate feature planes.
- depthint
Depth of UResNet, also corresponds to how many times we down/upsample.
- num_filtersint
Number of filters in the first convolution of UResNet. Will increase linearly with depth.
- repsint, optional
Convolution block repetition factor
- kernel_sizeint, optional
Kernel size for the SC (sparse convolutions for down/upsample).
- input_kernelint, optional
Receptive field size for very first convolution after input layer.
-
__init__(cfg, name='mobilenetv3')[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
encoder(x)[source]¶ Vanilla UResNet Encoder.
- INPUTS:
x (SparseTensor): MinkowskiEngine SparseTensor
- Returns
dictionary of encoder output with intermediate feature planes:
encoderTensors (list): list of intermediate SparseTensors
2) finalTensor (SparseTensor): feature tensor at deepest layer.
- Return type
result (dict)
-
decoder(final, encoderTensors)[source]¶ Vanilla UResNet Decoder INPUTS:
encoderTensors (list of SparseTensor): output of encoder.
- Returns
list of feature tensors in decoding path at each spatial resolution.
- Return type
decoderTensors (list of SparseTensor)
-
forward(input)[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.
-
__module__= 'mlreco.models.layers.common.mobilenet'¶
-
training: bool¶
-
class
mlreco.models.layers.common.mobilenet.MB3Encoder(cfg, name='mobilenetv3_encoder')[source]¶ Bases:
torch.nn.modules.module.ModuleVanilla UResNet with access to intermediate feature planes.
- depthint
Depth of UResNet, also corresponds to how many times we down/upsample.
- num_filtersint
Number of filters in the first convolution of UResNet. Will increase linearly with depth.
- repsint, optional
Convolution block repetition factor
- kernel_sizeint, optional
Kernel size for the SC (sparse convolutions for down/upsample).
- input_kernelint, optional
Receptive field size for very first convolution after input layer.
-
__init__(cfg, name='mobilenetv3_encoder')[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
__module__= 'mlreco.models.layers.common.mobilenet'¶
-
training: bool¶
-
encoder(x)[source]¶ Vanilla UResNet Encoder.
- INPUTS:
x (SparseTensor): MinkowskiEngine SparseTensor
- Returns
dictionary of encoder output with intermediate feature planes:
encoderTensors (list): list of intermediate SparseTensors
2) finalTensor (SparseTensor): feature tensor at deepest layer.
- Return type
result (dict)
-
forward(input)[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.