luigibonati / mlcolvar

A unified framework for machine learning collective variables for enhanced sampling simulations
MIT License
91 stars 24 forks source link

An issue with deep-TICA on reducing the descriptor set #105

Closed jinmei-1 closed 8 months ago

jinmei-1 commented 9 months ago

https://groups.google.com/g/plumed-users/c/LQJiFVrYdzE We have successfully trained a deep-TICA model using the .rbias, which is suitable for our protein-ligand system. We selected 4536 descriptors, representing the interatomic distances between heavy atoms. However, during simulations with these 4536 descriptors, we observed lower computational efficiency. Similar to the Chignolin Folding case you mentioned in your article "Deep learning the slow modes for rare events sampling," we read your suggestions on reducing the descriptor set. In your article, you mentioned reducing the number of descriptors to 210 by selecting the most relevant ones through sensitivity analysis of the primary CVs. We referred to your article and code https://colab.research.google.com/drive/1dG0ohT75R-UZAFMf_cbYPNQwBaOsVaAA#scrollTo=05ARhiNhSI_D and encountered some issues during testing. We hope you can provide assistance: 1、We faced issues in the variance calculation part and are unsure if the script is suitable for deep-TICA data. How should we modify it to adapt to deep-TICA data?

compute std to correct for different magnitudes

standardize_inputs = True #@param {type:"boolean"} if multiply_by_stddev:
if standardize_inputs:
dist2 = (dist - Mean) / Range
else:
dist2 = dist
in_std = np.std(dist2, axis=0) 2、We encountered problems in the weight summation part of the function, specifically, we found that model.nn[0].weight[:,i].abs().sum().item() throws an error: "TypeError: 'FeedForward' object is not subscriptable." Could you guide us on how to resolve this issue? 3、Could you share the code mentioned in the Chignolin Folding case in the article "Deep learning the slow modes for rare events sampling" applicable to reducing the descriptor set for deep-TICA data? We appreciate your assistance and look forward to your guidance. Meanwhile, we are sharing our test code with you for a better understanding of our issues. test-code.zip