mlreco.models.layers.cluster_cnn.embeddings module

class mlreco.models.layers.cluster_cnn.embeddings.Attention[source]

Bases: torch.nn.modules.module.Module

Sparse Attention Module where the feature map is multiplied by a soft masking score tensor (sigmoid activated)

__init__()[source]

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

forward(x, scores)[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.cluster_cnn.embeddings'
training: bool
class mlreco.models.layers.cluster_cnn.embeddings.ExpandAs[source]

Bases: torch.nn.modules.module.Module

Given a sparse tensor with one dimensional features, expand the feature map to given shape and return a newly constructed ME.SparseTensor.

  • x (ME.SparseTensor): with x.F.shape[1] == 1

  • shape (tuple)

__init__()[source]

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

forward(x, shape)[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.cluster_cnn.embeddings'
training: bool
class mlreco.models.layers.cluster_cnn.embeddings.SPICE(cfg, name='spice')[source]

Bases: torch.nn.modules.module.Module

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

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

filter_class(input)[source]

Filter classes according to segmentation label.

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.cluster_cnn.embeddings'
training: bool