yamle.methods.mcdropout module#
- class yamle.methods.mcdropout.MCDropoutMethod(p=0.5, mode='all', no_input_replacement=False, conv_filter_dropout=False, depth_portion_to_replace_start=None, depth_portion_to_replace_end=None, depth_indices=None, *args, **kwargs)[source]#
Bases:
MCSamplingMethodThis class is the extension of the base method for which the prediciton is performed using Monte Carlo dropout.
The dropout layers are added either to all layers or only to the last layer. Dropout is always on.
- Parameters:
p¶ (float) – The dropout probability to be used for Monte Carlo dropout.
mode¶ (str) – Where to add dropout layers, can be either all, last, partial or custom.
no_input_replacement¶ (bool) – Whether to replace the input with dropout.
conv_filter_dropout¶ (bool) – Whether to place 2D dropout on the convolutional filters.
depth_portion_to_replace_start¶ (float) – The depth portion of the model to start replacing with dropout.
depth_portion_to_replace_end¶ (float) – The depth portion of the model to end replacing with dropout.
depth_indices¶ (Tuple[int]) – The indices of the layers to replace with dropout.
- class yamle.methods.mcdropout.MCStandOutMethod(alpha=0.5, beta=0.5, mode='all', no_input_replacement=False, depth_portion_to_replace_start=None, depth_portion_to_replace_end=None, *args, **kwargs)[source]#
Bases:
MCSamplingMethodThis class is the extension of the base method for which the prediciton is performed using StandOut.
The dropout layers are added either to all layers or only to the last layer. Dropout is always on.
- Parameters:
alpha¶ (float) – The alpha parameter to be used for StandOut.
beta¶ (float) – The beta parameter to be used for StandOut.
mode¶ (str) – Where to add dropout layers, can be either all, last or partial.
no_input_replacement¶ (bool) – Whether to replace the input with dropout.
depth_portion_to_replace_start¶ (float) – The depth portion of the model to start replacing with dropout.
depth_portion_to_replace_end¶ (float) – The depth portion of the model to end replacing with dropout.
- class yamle.methods.mcdropout.MCDropConnectMethod(p=0.5, mode='all', no_input_replacement=False, depth_portion_to_replace_start=None, depth_portion_to_replace_end=None, *args, **kwargs)[source]#
Bases:
MCSamplingMethodThis class is the extension of the base method for which the prediciton is performed using Monte Carlo dropconnect.
Note that, dropconnect or dropping of the weights is always on.
- Parameters:
p¶ (float) – The dropconnect probability to be used for Monte Carlo dropconnect.
mode¶ (str) – Where to add dropconnect layers, can be either all, partial or last.
no_input_replacement¶ (bool) – Whether to replace the input with dropout.
depth_portion_to_replace_start¶ (float) – The depth portion of the model to start replacing with dropout.
depth_portion_to_replace_end¶ (float) – The depth portion of the model to end replacing with dropout.
- class yamle.methods.mcdropout.MCDropBlockMethod(p=0.5, mode='all', block_size_percentage=0.1, no_input_replacement=False, depth_portion_to_replace_start=None, depth_portion_to_replace_end=None, *args, **kwargs)[source]#
Bases:
MCSamplingMethodThis class is the extension of the base method for which the prediciton is performed using Monte Carlo Drop Block.
After every convolutional layer, a DropBlock layer is added. It drops a contiguous region of the feature map.
- Parameters:
p¶ (float) – The dropblock probability to be used for Monte Carlo Drop Block.
mode¶ (str) – Where to add dropblock layers, can be either all of partial.
block_size_percentage¶ (float) – The percentage of the block size to be dropped relative to the input size.
no_input_replacement¶ (bool) – Whether to replace the input with dropblock.
depth_portion_to_replace_start¶ (float) – The depth portion of the model to start replacing with dropout.
depth_portion_to_replace_end¶ (float) – The depth portion of the model to end replacing with dropout.
- class yamle.methods.mcdropout.MCStochasticDepthMethod(p=0.5, *args, **kwargs)[source]#
Bases:
MCSamplingMethodThis class is the extension of the base method for which the prediciton is performed using Monte Carlo Stochastic Depth.
Stochastic depth is added to every residual block where the residual function is randomly dropped for each sample. It is assumed that the residual blocks are created one after another with respect to the depth, such that the probability of dropping a residual block depends on the depth of the residual block.
- Parameters:
p¶ (float) – The initial stochastic depth probability p_L to be used for Monte Carlo Stochastic Depth.