HeatmapKLLossο
- class lightning_pose.losses.losses.HeatmapKLLoss[source]ο
Bases:
HeatmapLossKullback-Leibler loss between heatmaps.
Attributes Summary
Methods Summary
compute_loss(targets,Β predictions)Compute per-keypoint KL divergence between target and predicted heatmaps.
Attributes Documentation
- loss_name: str = 'heatmap_kl'ο
Methods Documentation
- compute_loss(targets: Float[Tensor, 'num_valid_keypoints heatmap_height heatmap_width'], predictions: Float[Tensor, 'num_valid_keypoints heatmap_height heatmap_width']) Float[Tensor, 'num_valid_keypoints'][source]ο
Compute per-keypoint KL divergence between target and predicted heatmaps.
- Parameters:
targets β ground-truth heatmaps.
predictions β model-predicted heatmaps.
- Returns:
per-keypoint KL divergence values.
- __init__(data_module: BaseDataModule | UnlabeledDataModule | None = None, log_weight: float = 0.0, **kwargs: Any) 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)ο