deepmodeling / Uni-Mol

Official Repository for the Uni-Mol Series Methods
MIT License
723 stars 126 forks source link

pad fixing for unimol and docking pose #211

Closed nbrosse closed 7 months ago

nbrosse commented 7 months ago

Some pad fixing issues for unimol and docking pose. Note that for unimol pretraining, it does not seem to impact a lot the metrics on the small tests I made. However, for docking pose, you can notice that the predictions of the holo distance matrices are wrong on the diagonal, you have to replace the diagonal with 0 if you want to correct it. And indeed, the model does not see the diagonal during training because of the 0 padding.

Naplessss commented 7 months ago

Already Merged, thanks for your contribute!

PoloWitty commented 6 months ago

The code in https://github.com/dptech-corp/Uni-Mol/blob/73946479da134ba025567ff329c3501ccd2e4591/unimol/unimol/utils/docking_utils.py#L184

np.fill_diagona()l will operate inplace instead of return a value, so the code holo_distance_predict = np.fill_diagonal(holo_distance_predict, 0) will make holo_distance_predict=None .

The code should be changed to

np.fill_diagonal(holo_distance_predict, 0) # no assignment
ZhouGengmo commented 6 months ago

The code in

https://github.com/dptech-corp/Uni-Mol/blob/73946479da134ba025567ff329c3501ccd2e4591/unimol/unimol/utils/docking_utils.py#L184

np.fill_diagona()l will operate inplace instead of return a value, so the code holo_distance_predict = np.fill_diagonal(holo_distance_predict, 0) will make holo_distance_predict=None .

The code should be changed to

np.fill_diagonal(holo_distance_predict, 0) # no assignment

Thanks for pointing that out. Fixed. https://github.com/dptech-corp/Uni-Mol/pull/219

nbrosse commented 6 months ago

@PoloWitty Thanks for the fix and sorry for the mistake !