uw-ipd / tmol

TMol
Apache License 2.0
30 stars 3 forks source link

Adding block pair energy terms. #286

Closed jflat06 closed 7 months ago

jflat06 commented 9 months ago

This is almost ready to go, but is currently stuck on an issue with dunbrack block pair reweighted gradcheck failing. I haven't been able to figure this out, so it may help to get some other eyes on the code.

jflat06 commented 8 months ago

@fdimaio

I think this is good to go.

All of the wholepose/block tests are passing on all energy terms.

You can see the data format of the new baselines in tmol/tests/data/term_baselines. I formatted it in yaml like we had talked about. I can tweak the formatting if we want alterations.

I also did a small monkeypatch to torch to format the gradcheck failure output a bit better (Example):

E                       torch.autograd.gradcheck.GradcheckError: Difference between analytical and numerical tensors exceeds tolerances:
E                       index     | analytical     | numerical   | difference   
E                       [0 0]     | -0.09107021    | 0.0         | 0.09107021   
E                       [1 0]     | 0.0971392      | -0.23841858 | 0.3355578    
E                       [2 0]     | 0.14213827     | 0.0         | 0.14213827   
E                       [3 0]     | 0.01525695     | 0.0         | 0.01525695   
E                       [4 0]     | -0.07564153    | -0.47683716 | 0.40119565   
E                       [5 0]     | -0.07978861    | -0.47683716 | 0.39704853   
E                       [6 0]     | -0.349249      | -0.47683716 | 0.12758815   
E                       [7 0]     | -0.42451367    | -0.47683716 | 0.05232349   
E                       [8 0]     | 0.2448904      | 0.0         | 0.2448904    

This only shows you the failing comparisons and their index. The baseline comparisons also use this formatting.