bis_protein_structure.TORSION2.torsion_angle_loss

bis_protein_structure.TORSION2.torsion_angle_loss(a, a_gt, tor_masks)[source]

Computes the loss for torsion angles based on the difference between predicted angles and ground truth angles, including penalties for angle normalization.

Parameters:
  • a (torch.Tensor) – The predicted torsion angles, shape [*, N, 7, 2].

  • a_gt (torch.Tensor) – The ground truth torsion angles, shape [*, N, 7, 2].

  • tor_masks (torch.Tensor) – A boolean tensor indicating the validity of torsion angles.

Returns:

A dictionary containing the total loss, backbone loss, and sidechain loss.

Return type:

dict