ramanathanlab / mdlearn

Machine learning for molecular dynamics
MIT License
12 stars 7 forks source link

SD4 interface #39

Open braceal opened 3 years ago

braceal commented 3 years ago

Add this logic to SD4 as a member function. Consider adding a .fit() interface.

coords_all = np.reshape(coords, (len(coords), coords.shape[1] * coords.shape[2])).T
avg_coords_all = np.mean(coords_all, 1)
tmp_all = np.reshape(
    np.tile(avg_coords_all, coords.shape[0]),
    (coords.shape[0], coords.shape[1] * coords.shape[2]),
).T
devs_md_all = coords_all - tmp_all
ZPrj4 = W.dot(devs_md_all)