spine.model.singlep

Image classification module.

This module includes:
  • Single full image classification

  • Individual cluster classification

  • UQ implementations of the full image classification

Classes

BayesianParticleClassifier(*args, **kwargs)

DUQParticleClassifier(*args, **kwargs)

Uncertainty 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.

EvidentialLearningLoss(*args, **kwargs)

EvidentialParticleClassifier(*args, **kwargs)

MultiLabelCrossEntropy(*args, **kwargs)

MultiParticleImageClassifier(*args, **kwargs)

MultiParticleTypeLoss(*args, **kwargs)

class spine.model.singlep.MultiParticleImageClassifier(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

forward(input[, clusts])

Run a batch of data through the forward function.

process_model_config(num_classes, **encoder)

Initialize the underlying encoder and the final layer.

split_input

split_input_as_tg_batch

MODULES = ['particle_image_classifier', 'network_base', 'mink_encoder']
split_input_as_tg_batch(point_cloud, clusts=None)[source]
split_input(point_cloud, clusts=None)[source]
forward(input, clusts=None)[source]

Run a batch of data through the forward function.

Parameters:

data (TensorBatch) – (N, 1 + D + N_f) tensor of voxel/value pairs - N is the the total number of voxels in the image - 1 is the batch ID - D is the number of dimensions in the input image - N_f is the number of features per voxel

class spine.model.singlep.DUQParticleClassifier(*args: Any, **kwargs: Any)[source]

Uncertainty 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.

Methods

__call__(*args, **kwargs)

Call self as a function.

forward(input)

Run a batch of data through the forward function.

process_model_config(num_classes, **encoder)

Initialize the underlying encoder and the final layer.

bilinear

embed

update_buffers

MODULES = ['network_base', 'particle_image_classifier', 'mink_encoder']
embed(x)[source]
bilinear(z)[source]
forward(input)[source]

Run a batch of data through the forward function.

Parameters:

data (TensorBatch) – (N, 1 + D + N_f) tensor of voxel/value pairs - N is the the total number of voxels in the image - 1 is the batch ID - D is the number of dimensions in the input image - N_f is the number of features per voxel

update_buffers()[source]
class spine.model.singlep.EvidentialParticleClassifier(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

forward(input)

Run a batch of data through the forward function.

process_model_config(num_classes, **encoder)

Initialize the underlying encoder and the final layer.

MODULES = ['network_base', 'particle_image_classifier', 'mink_encoder']
forward(input)[source]

Run a batch of data through the forward function.

Parameters:

data (TensorBatch) – (N, 1 + D + N_f) tensor of voxel/value pairs - N is the the total number of voxels in the image - 1 is the batch ID - D is the number of dimensions in the input image - N_f is the number of features per voxel

class spine.model.singlep.BayesianParticleClassifier(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

evidential_forward

forward

mc_forward

standard_forward

MODULES = ['network_base', 'mcdropout_encoder']
evidential_forward(input)[source]
mc_forward(input, num_samples=None)[source]
standard_forward(input, verbose=False)[source]
forward(input)[source]
class spine.model.singlep.MultiParticleTypeLoss(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

forward

forward_tg

forward_tg(out, valid_labels)[source]
forward(out, type_labels)[source]
class spine.model.singlep.MultiLabelCrossEntropy(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

calc_gradient_penalty(x, y_pred)

Code From the DUQ main Github Repository: https://github.com/y0ast/deterministic-uncertainty-quantification

forward

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]
class spine.model.singlep.EvidentialLearningLoss(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

forward

forward(out, type_labels, iteration=0)[source]