RegressionRMSELoss

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

Bases: RegressionMSELoss

Root MSE loss between ground truth and predicted coordinates.

Attributes Summary

loss_name

Methods Summary

compute_loss(targets,Β predictions)

Compute per-keypoint Euclidean distance between predicted and target coordinates.

Attributes Documentation

loss_name: str = 'rmse'

Methods Documentation

compute_loss(targets: Float[Tensor, 'batch_x_two_x_num_keypoints'], predictions: Float[Tensor, 'batch_x_two_x_num_keypoints']) Float[Tensor, 'batch_x_num_keypoints'][source]

Compute per-keypoint Euclidean distance between predicted and target coordinates.

Parameters:
  • targets – ground-truth (x, y) keypoint coordinates, flattened.

  • predictions – predicted (x, y) keypoint coordinates, flattened.

Returns:

per-keypoint RMSE (Euclidean pixel distance).

__init__(data_module: BaseDataModule | UnlabeledDataModule | None = None, epsilon: float = 0.0, log_weight: float = 0.0, **kwargs: Any) None[source]

Initialize RegressionRMSELoss.

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

  • epsilon – loss values below this threshold are zeroed out.

  • 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)