mlreco.models.singlep module¶
-
class
mlreco.models.singlep.ParticleImageClassifier(cfg, name='particle_image_classifier')[source]¶ Bases:
torch.nn.modules.module.Module-
MODULES= ['particle_image_classifier', 'network_base', 'mink_encoder']¶
-
__init__(cfg, name='particle_image_classifier')[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.singlep'¶
-
training: bool¶
-
-
class
mlreco.models.singlep.DUQParticleClassifier(cfg, name='duq_particle_classifier')[source]¶ Bases:
mlreco.models.singlep.ParticleImageClassifierUncertainty Estimation Using a Single Deep Deterministic Neural Network https://arxiv.org/pdf/2003.02037.pdf Joost van Amersfoort, Lewis Smith, Yee Whye Teh, Yarin Gal.
Pytorch Implementation for SparseConvNets with MinkowskiEngine backend.
-
MODULES= ['network_base', 'particle_image_classifier', 'mink_encoder']¶
-
__init__(cfg, name='duq_particle_classifier')[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.singlep'¶
-
training: bool¶
-
-
class
mlreco.models.singlep.EvidentialParticleClassifier(cfg, name='evidential_image_classifier')[source]¶ Bases:
mlreco.models.singlep.ParticleImageClassifier-
MODULES= ['network_base', 'particle_image_classifier', 'mink_encoder']¶
-
__init__(cfg, name='evidential_image_classifier')[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.singlep'¶
-
training: bool¶
-
-
class
mlreco.models.singlep.BayesianParticleClassifier(cfg, name='bayesian_particle_classifier')[source]¶ Bases:
torch.nn.modules.module.Module-
MODULES= ['network_base', 'mcdropout_encoder']¶
-
__init__(cfg, name='bayesian_particle_classifier')[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.singlep'¶
-
training: bool¶
-
-
class
mlreco.models.singlep.ParticleTypeLoss(cfg, name='particle_type_loss')[source]¶ Bases:
torch.nn.modules.module.Module-
__init__(cfg, name='particle_type_loss')[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
forward(out, type_labels)[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.singlep'¶
-
training: bool¶
-
-
class
mlreco.models.singlep.MultiLabelCrossEntropy(cfg, name='duq_particle_classifier')[source]¶ Bases:
torch.nn.modules.module.Module-
__init__(cfg, name='duq_particle_classifier')[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
static
calc_gradient_penalty(x, y_pred)[source]¶ Code From the DUQ main Github Repository: https://github.com/y0ast/deterministic-uncertainty-quantification
Author: Joost van Amersfoort
-
forward(out, type_labels)[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.singlep'¶
-
training: bool¶
-
-
class
mlreco.models.singlep.EvidentialLearningLoss(cfg, name='evidential_learning_loss')[source]¶ Bases:
torch.nn.modules.module.Module-
__init__(cfg, name='evidential_learning_loss')[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
__module__= 'mlreco.models.singlep'¶
-
training: bool¶
-
forward(out, type_labels, iteration=0)[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.
-