deepfold.losses.violation.between_residue_bond_loss

deepfold.losses.violation.between_residue_bond_loss(pred_atom_positions: Tensor, pred_atom_mask: Tensor, residue_index: Tensor, aatype: Tensor, tolerance_factor_soft: float = 12.0, tolerance_factor_hard: float = 12.0, eps: float = 1e-06) Dict[str, Tensor][source]

Flat-bottom loss to penalize structural violations between residues.

This is a loss penalizing any violation of the geometry around the peptide bond between consecutive amino acids. This loss corresponds to equation 44 & 45 (Supplementary ‘1.9.11 Structural violations’).

Parameters:
  • pred_atom_positions – Atom positions in atom37/14 representation

  • pred_atom_mask – Atom mask in atom37/14 representation

  • residue_index – Residue index for given amino acid, this is assumed to be monotonically increasing.

  • aatype – Amino acid type of given residue

  • tolerance_factor_soft – soft tolerance factor measured in standard deviations of pdb distributions

  • tolerance_factor_hard – hard tolerance factor measured in standard deviations of pdb distributions

Returns:

  • ‘c_n_loss_mean’: Loss for peptide bond length violations

  • ’ca_c_n_loss_mean’: Loss for violations of bond angle around C spanned by CA, C, N

  • ’c_n_ca_loss_mean’: Loss for violations of bond angle around N spanned by C, N, CA

  • ’per_residue_loss_sum’: sum of all losses for each residue

  • ’per_residue_violation_mask’: mask denoting all residues with violation present.

Return type:

Dict containing