Skip to content

Commit

Permalink
torsion_parametrization
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanqing-wang committed Sep 12, 2021
1 parent adec67f commit 36b88a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion espaloma/mm/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,13 @@ def periodic(

k = k[:, None, :].repeat(1, x.shape[1], 1)

energy = (k * (1.0 + cos_n_theta_minus_phases)).sum(dim=-1)
# energy = (k * (1.0 + cos_n_theta_minus_phases)).sum(dim=-1)

energy = (
torch.nn.functional.relu(k) * (cos_n_theta_minus_phases + 1.0)
-torch.nn.functional.relu(0.0-k) * (cos_n_theta_minus_phases - 1.0)
).sum(dim=-1)


return energy

Expand Down

0 comments on commit 36b88a8

Please sign in to comment.