HeatmapKLLoss

class lightning_pose.losses.losses.HeatmapKLLoss[source]

Bases: HeatmapLoss

Kullback-Leibler loss between heatmaps.

Attributes Summary

loss_name

Methods Summary

compute_loss(targets,Β predictions)

Attributes Documentation

loss_name = 'heatmap_kl'

Methods Documentation

compute_loss(targets: Tensor, {'__torchtyping__': True, 'details': ('num_valid_keypoints', 'heatmap_height', 'heatmap_width'), 'cls_name': 'TensorType'}], predictions: Tensor, {'__torchtyping__': True, 'details': ('num_valid_keypoints', 'heatmap_height', 'heatmap_width'), 'cls_name': 'TensorType'}]) Tensor, {'__torchtyping__': True, 'details': ('num_valid_keypoints',), 'cls_name': 'TensorType'}][source]
__init__(data_module: BaseDataModule | UnlabeledDataModule | None = None, log_weight: float = 0.0, **kwargs) None[source]

Initialize HeatmapKLLoss.

Parameters:
  • data_module – data module providing access to datasets; passed to the parent class.

  • log_weight – final weight in front of the loss term in the objective function is computed as 1.0 / (2.0 * exp(log_weight)).

__new__(**kwargs)