yamle.losses.loss module#
- class yamle.losses.loss.BaseLoss(reduction_per_member='mean', reduction_per_sample='mean', reduction_per_feature='none', task=None)[source]#
Bases:
ABCThis is the base class for all losses.
- Parameters:
reduction_per_member¶ (str) – The reduction to be used for the loss. Given that the input has the shape (batch_size, num_members, …), the loss will be reduced over the num_members dimension.
reduction_per_sample¶ (str) – The reduction to be used for the loss. Given that the input has the shape (batch_size, num_members, …), the loss will be reduced over the batch_size dimension.
reduction_per_feature¶ (str) – The reduction to be used for the loss. Given that the input has the shape (batch_size, num_members, num_features, …), the loss will be reduced over the num_features dimension.
- tasks = ['regression', 'classification', 'text_classification', 'segmentation', 'depth_estimation', 'pre_training', 'reconstruction']#
- set_reduction_per_member(reduction_per_member)[source]#
This method is used to set the reduction per member.
- Return type:
None
- set_reduction_per_sample(reduction_per_sample)[source]#
This method is used to set the reduction per sample.
- Return type:
None