qumphy.models.utils.mcdropout module

class qumphy.models.utils.mcdropout.MCDropout(p=0.5, mcdropout=False, inplace=False)[source]

Bases: Dropout

Implementation of MCDropout to the torch dropout layer. This adds a mcdropout flag, which turns dropout always on in training and evaluation mode.

Parameters:
  • p (float) – probability of an element to be zeroed. Default: 0.5

  • mcdropout (bool) – if True, will always perform dropout

  • inplace (bool) – if True, will perform dropout in-place

forward(input)[source]
Return type:

Tensor