spine.model.bayes_uresnet

Classes

BayesianUResNet(*args, **kwargs)

UResNet with Uncertainty Quantification

DUQSegmentationLoss(*args, **kwargs)

DUQUResNet(*args, **kwargs)

Single Pass Deep Uncertainty Quantification Network Original Paper: https://arxiv.org/abs/2003.02037

SegmentationLoss(*args, **kwargs)

class spine.model.bayes_uresnet.BayesianUResNet(*args: Any, **kwargs: Any)[source]

UResNet with Uncertainty Quantification

The backbone model consists of UResNet Encoder-Decoder format with standard residual layers for the shallow half and dropout residual layers for the deep half of the network.

Configuration:
  • mode (str) – string indicator for slight changes in network behavior/architecture. Supports three options:

    • standard: standard dropout segmentation network. This also

    includes MCDropout segnet, since training behavior is identical for both standard and mcdropout networks. - evd: Changes network into evidential segmentation network

  • num_samples (int) – if used as MCDropout Segnet, the number of stochastic forward samples to be taken.

  • num_classes (int) – number of segmentation classes (default: 5)

Methods

__call__(*args, **kwargs)

Call self as a function.

evidential_forward(input)

Forwarding operation for evidential segmentation network.

mc_forward(input[, num_samples])

Forwarding operation for MC Dropout segmentation network.

standard_forward(input)

Forwarding operation for standard dropout segmentation network.

forward

MODULES = []
mc_forward(input, num_samples=None)[source]

Forwarding operation for MC Dropout segmentation network.

Parameters:

num_samples – number of stochastic forward samples to be taken

evidential_forward(input)[source]

Forwarding operation for evidential segmentation network.

standard_forward(input)[source]

Forwarding operation for standard dropout segmentation network.

forward(input)[source]
class spine.model.bayes_uresnet.DUQUResNet(*args: Any, **kwargs: Any)[source]

Single Pass Deep Uncertainty Quantification Network Original Paper: https://arxiv.org/abs/2003.02037

Implementation adapted from the DUQ main Github Repository: https://github.com/y0ast/deterministic-uncertainty-quantification

Author: Joost van Amersfoort

Methods

__call__(*args, **kwargs)

Call self as a function.

bilinear

embed

forward

update_buffers

MODULES = []
embed(x)[source]
bilinear(z)[source]
forward(input)[source]
update_buffers()[source]
class spine.model.bayes_uresnet.SegmentationLoss(*args: Any, **kwargs: Any)[source]

Methods

__call__(*args, **kwargs)

Call self as a function.

forward(outputs, label[, iteration, weight])

segmentation[0], label and weight are lists of size #gpus = batch_size.

forward(outputs, label, iteration=0, weight=None)[source]

segmentation[0], label and weight are lists of size #gpus = batch_size. segmentation has as many elements as UResNet returns. label[0] has shape (N, dim + batch_id + 1) where N is #pts across minibatch_size events.

class spine.model.bayes_uresnet.DUQSegmentationLoss(*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]