mlreco.models.full_chain module

class mlreco.models.full_chain.FullChain(cfg)[source]

Bases: mlreco.models.layers.common.gnn_full_chain.FullChainGNN

Full Chain with MinkowskiEngine implementations for CNNs.

Modular, End-to-end LArTPC Reconstruction Chain

  • Deghosting for 3D tomographic reconstruction artifiact removal

  • UResNet for voxel-wise semantic segmentation

  • PPN for point proposal

  • DBSCAN/GraphSPICE for dense particle clustering

  • GrapPA(s) for particle/interaction aggregation and identification

Configuration goes under the modules section. The full chain-related sections (as opposed to each module-specific configuration) look like this:

modules:
  chain:
    enable_uresnet: True
    enable_ppn: True
    enable_cnn_clust: True
    enable_gnn_shower: True
    enable_gnn_track: True
    enable_gnn_particle: False
    enable_gnn_inter: True
    enable_gnn_kinematics: False
    enable_cosmic: False
    enable_ghost: True
    use_ppn_in_gnn: True
    verbose: True

The chain section enables or disables specific stages of the full chain. When a module is disabled through this section, it will not even be constructed. The configuration blocks for each enabled module should also live under the modules section of the configuration.

To see an example of full chain configuration, head over to https://github.com/DeepLearnPhysics/lartpc_mlreco3d_tutorials/blob/master/book/data/inference.cfg

MODULES = ['grappa_shower', 'grappa_track', 'grappa_inter', 'grappa_shower_loss', 'grappa_track_loss', 'grappa_inter_loss', 'full_chain_loss', 'mink_graph_spice', 'graph_spice_loss', 'fragment_clustering', 'chain', 'dbscan_frag', ('mink_uresnet_ppn', ['mink_uresnet', 'mink_ppn'])]
__init__(cfg)[source]

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

static get_extra_gnn_features(fragments, frag_seg, classes, input, result, use_ppn=False, use_supp=False)[source]

Extracting extra features to feed into the GNN particle aggregators

  • PPN: Most likely PPN point for showers,

    end points for tracks (+ direction estimate)

  • Supplemental: Mean/RMS energy in the fragment + semantic class

Parameters
  • fragments (np.ndarray) –

  • frag_seg (np.ndarray) –

  • classes (list) –

  • input (list) –

  • result (dictionary) –

  • use_ppn (bool) –

  • use_supp (bool) –

Returns

  • mask (np.ndarray) – Boolean mask to select fragments belonging to one of the requested classes.

  • kwargs (dictionary) – Keys can include points (if use_ppn is True) and extra_feats (if use_supp is True).

full_chain_cnn(input)[source]

Run the CNN portion of the full chain.

Parameters
  • input

  • result

Returns

result – dictionary of all network outputs from cnns.

Return type

dict

__module__ = 'mlreco.models.full_chain'
training: bool
class mlreco.models.full_chain.FullChainLoss(cfg)[source]

Bases: mlreco.models.layers.common.gnn_full_chain.FullChainLoss

Loss function for the full chain.

__init__(cfg)[source]

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

__module__ = 'mlreco.models.full_chain'
reduction: str