mlreco.models.uresnet_ppn_chain module

class mlreco.models.uresnet_ppn_chain.UResNetPPN(cfg)[source]

Bases: torch.nn.modules.module.Module

A model made of UResNet backbone and PPN layers. Typical configuration:

model:
  name: uresnet_ppn_chain
  modules:
    uresnet_lonely:
      # Your uresnet config here
    ppn:
      # Your ppn config here
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.

  • num_classes (int, default 5)

  • score_threshold (float, default 0.5)

  • classify_endpoints (bool, default False) – Enable classification of points into start vs end points.

  • ppn_resolution (float, default 1.0)

  • ghost (bool, default False)

  • downsample_ghost (bool, default True)

  • use_true_ghost_mask (bool, default False)

  • mask_loss_name (str, default ‘BCE’) – Can be ‘BCE’ or ‘LogDice’

  • particles_label_seg_col (int, default -2) – Which column corresponds to particles’ semantic label

  • track_label (int, default 1)

MODULES = ['mink_uresnet', 'mink_uresnet_ppn_chain', 'mink_ppn']
__init__(cfg)[source]

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

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.uresnet_ppn_chain'
training: bool
class mlreco.models.uresnet_ppn_chain.UResNetPPNLoss(cfg)[source]

Bases: torch.nn.modules.module.Module

__init__(cfg)[source]

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

forward(outputs, segment_label, particles_label, weights=None)[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.uresnet_ppn_chain'
training: bool