yamle.methods.temperature_scaling module#

class yamle.methods.temperature_scaling.TemperatureMethod(calibration_learning_rate, *args, **kwargs)[source]#

Bases: BaseMethod

This class is the extension of the base method for temperature scaling.

Parameters:

calibration_learning_rate (float) – The learning rate for the calibration.

tasks = ['classification', 'segmentation']#
calibrate()[source]#

This method is used to trigger the calibration.

Return type:

None

configure_optimizers()[source]#

This method is used to configure the optimizers for the model. if the model is not calibrated, then the temperature parameter is not updated.

if self.calibration is True, then only the temperature parameter is updated.

Return type:

Tuple[List[Optimizer], List[Any]]

static add_specific_args(parent_parser)[source]#

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

Return type:

ArgumentParser

test_name: Optional[str]#
prepare_data_per_node: bool#
allow_zero_length_dataloader_with_multiple_devices: bool#
training: bool#