Skip to content

Commit

Permalink
bug fix: proper clipping in the Q
Browse files Browse the repository at this point in the history
  • Loading branch information
yihengwuKP committed Sep 10, 2024
1 parent 251c6f4 commit 2460ced
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysages/colvars/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def native_contact_fraction(r, contact_pairs, references, gamma, lambda_d, clip,
reference_distances_contacts = reference_distances[contact_pairs[:, 0], contact_pairs[:, 1]]
diff = distances_contacts - lambda_d * reference_distances_contacts
if clip:
diff = np.clip(diff, None, clip_val)
diff = np.clip(diff, None, clip_val / gamma)
Q_contribution = 1 / (1 + np.exp(gamma * diff))

N_contacts = contact_pairs.shape[0]
Expand Down

0 comments on commit 2460ced

Please sign in to comment.