mlreco.models.layers.common.uresnet_layers module

class mlreco.models.layers.common.uresnet_layers.UResNetEncoder(cfg, name='uresnet_encoder')[source]

Bases: torch.nn.modules.module.Module

Vanilla UResNet with access to intermediate feature planes.

Configuration
  • data_dim (int, default 3)

  • num_input (int, default 1)

  • allow_bias (bool, default False)

  • spatial_size (int, default 512)

  • leakiness (float, default 0.33)

  • activation (dict) – For activation function, defaults to {‘name’: ‘lrelu’, ‘args’: {}}

  • norm_layer (dict) – For normalization function, defaults to {‘name’: ‘batch_norm’, ‘args’: {}}

  • depth (int, default 5) – Depth of UResNet, also corresponds to how many times we down/upsample.

  • filters (int, default 16) – Number of filters in the first convolution of UResNet. Will increase linearly with depth.

  • reps (int, default 2) – Convolution block repetition factor

  • input_kernel (int, default 3) – Receptive field size for very first convolution after input layer.

Output
  • encoderTensors (list of ME.SparseTensor) – list of intermediate tensors (taken between encoding block and convolution) from encoder half

  • finalTensor (ME.SparseTensor) – feature tensor at deepest layer

  • features_ppn (list of ME.SparseTensor) – list of intermediate tensors (right after encoding block + convolution)

__init__(cfg, name='uresnet_encoder')[source]

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

encoder(x)[source]

Vanilla UResNet Encoder.

Parameters

x (MinkowskiEngine SparseTensor) –

Returns

Return type

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 Module instance 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.uresnet_layers'
training: bool
class mlreco.models.layers.common.uresnet_layers.UResNetDecoder(cfg, name='uresnet_decoder')[source]

Bases: torch.nn.modules.module.Module

Vanilla UResNet Decoder

Configuration
  • data_dim (int, default 3)

  • num_input (int, default 1)

  • allow_bias (bool, default False)

  • spatial_size (int, default 512)

  • leakiness (float, default 0.33)

  • activation (dict) – For activation function, defaults to {‘name’: ‘lrelu’, ‘args’: {}}

  • norm_layer (dict) – For normalization function, defaults to {‘name’: ‘batch_norm’, ‘args’: {}}

  • depth (int, default 5) – Depth of UResNet, also corresponds to how many times we down/upsample.

  • filters (int, default 16) – Number of filters in the first convolution of UResNet. Will increase linearly with depth.

  • reps (int, default 2) – Convolution block repetition factor

Output

list of ME.SparseTensor

__init__(cfg, name='uresnet_decoder')[source]

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

decoder(final, encoderTensors)[source]

Vanilla UResNet Decoder

Parameters

encoderTensors (list of SparseTensor) – output of encoder.

Returns

decoderTensors – list of feature tensors in decoding path at each spatial resolution.

Return type

list of SparseTensor

forward(final, encoderTensors)[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.

__module__ = 'mlreco.models.layers.common.uresnet_layers'
training: bool
class mlreco.models.layers.common.uresnet_layers.UResNet(cfg, name='uresnet')[source]

Bases: torch.nn.modules.module.Module

Vanilla UResNet with access to intermediate feature planes.

Configuration
  • data_dim (int, default 3)

  • num_input (int, default 1)

  • allow_bias (bool, default False)

  • spatial_size (int, default 512)

  • leakiness (float, default 0.33)

  • activation (dict) – For activation function, defaults to {‘name’: ‘lrelu’, ‘args’: {}}

  • norm_layer (dict) – For normalization function, defaults to {‘name’: ‘batch_norm’, ‘args’: {}}

  • depth (int, default 5) – Depth of UResNet, also corresponds to how many times we down/upsample.

  • filters (int, default 16) – Number of filters in the first convolution of UResNet. Will increase linearly with depth.

  • reps (int, default 2) – Convolution block repetition factor

  • input_kernel (int, default 3) – Receptive field size for very first convolution after input layer.

Output
  • encoderTensors (list of ME.SparseTensor) – list of intermediate tensors (taken between encoding block and convolution) from encoder half

  • decoderTensors (list of ME.SparseTensor) – list of intermediate tensors (taken between encoding block and convolution) from decoder half

  • finalTensor (ME.SparseTensor) – feature tensor at deepest layer

  • features_ppn (list of ME.SparseTensor) – list of intermediate tensors (right after encoding block + convolution)

__init__(cfg, name='uresnet')[source]

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

__module__ = 'mlreco.models.layers.common.uresnet_layers'
training: bool
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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.