mlreco.models.layers.common.fpn module¶
-
class
mlreco.models.layers.common.fpn.FPN(cfg, name='fpn')[source]¶ Bases:
torch.nn.modules.module.ModuleFeature Pyramid Network (FPN)
FPNs are a different implementation of the concept behind unets.
- depthint
Depth of FPN, also corresponds to how many times we down/upsample.
- num_filtersint
Number of filters in the first convolution of FPN. 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='fpn')[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
__module__= 'mlreco.models.layers.common.fpn'¶
-
training: bool¶
-
encoder(x)[source]¶ Vanilla FPN 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 FPN 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.