yamle.methods.dun module#

class yamle.methods.dun.DUNMethod(alpha, warm_starting_epochs, *args, **kwargs)[source]#

Bases: MemberMethod

This class is the extension of the base method for which the prediciton is performed through the method of: Depth Uncertainty in Neural Networks where the _output layer is used repatedly to get the prediction per each hidden layer.

Parameters:
  • alpha (float) – The alpha parameter for the KL divergence.

  • warm_starting_epochs (int) – The number of epochs to train the model without changing the depth weights.

property alphas: Tensor#

This method is used to get the alphas of the model.

property prior_betas: Tensor#

This method is used to get the prior betas of the model.

on_train_epoch_end()[source]#

This method is used to:

Reset the model at the end of each training epoch. Step the learning rate schedulers if automatic optimization is not selected. Plot the training results if plotting is selected. Apply the regularizer at the end of each training epoch if a regularizer is selected.

Return type:

None

state_dict()[source]#

This method is used to get the state of the method.

Return type:

Dict[str, Any]

load_state_dict(state_dict)[source]#

This method is used to load the state of the method.

Return type:

None

static add_specific_args(parent_parser)[source]#

This method is used to add the specific arguments for the DUN method.

Return type:

ArgumentParser