yamle.methods.early_exit module#

class yamle.methods.early_exit.EarlyExitMethod(alpha=1.0, beta=0.0, gamma=0.3, *args, **kwargs)[source]#

Bases: MemberMethod

This class is the extension of the base method for which the prediciton is performed through the method of: early exits from the architecture which are auxiliary heads that are added to the model at different depths.

Parameters:
  • alpha (float) – The term to scale the loss of the auxiliary heads. Default: 1.0.

  • beta (float) – The term to scale the diversity loss which is a cross entropy between all exit pairs. Default: 0.0.

  • gamma (float) – The term to scale the hidden feature size when creating the auxiliary heads. Default: 0.3.

static add_specific_args(parent_parser)[source]#

This method is used to add the specific arguments of the EarlyExitMethod.

Return type:

ArgumentParser