mlreco.models.layers.cluster_cnn.embeddings module¶
-
class
mlreco.models.layers.cluster_cnn.embeddings.Attention[source]¶ Bases:
torch.nn.modules.module.ModuleSparse Attention Module where the feature map is multiplied by a soft masking score tensor (sigmoid activated)
-
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
Moduleinstance 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.ModuleGiven 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)
-
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
Moduleinstance 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.
-
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.
-
__module__= 'mlreco.models.layers.cluster_cnn.embeddings'¶
-
training: bool¶
-