-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing weights for VAMP dimensionality reduction #259
Comments
Hey JD, that is an excellent question! I thought a little about this and I don't think there is something that speaks against having weights for VAMP per se. It is just that the weighting was ordinarily used to reweigh many short off-equilibrium trajectories to equilibrium statistics in conjunction with the KoopmanWeightingEstimator. May I ask what you want to achieve with the weights? Cheers, |
Hi Moritz, Thanks for the response! Glad to hear there's no theoretical reason it's not doable. We're doing dimensionality reduction on sets of many off-equilibrium MD trajectories, using WESTPA weighted ensemble enhanced sampling. Weighted ensemble trajectories naturally carry weights with them, so we'd like to use those in the dimensionality reduction. I've implemented weighted TICA with deeptime, but because we're often simulating unidirectional steady-state flows, I don't think the reversibility assumptions in TICA are appropriate, so we'd like to try VAMP. |
Our covariance computation is a bit more complicated than the usual est_instantaneous = Covariance(remove_data_mean=True, lagtime=100, compute_c00=True, compute_c0t=True, reversible=False, bessels_correction=False)
est_lagged = Covariance(remove_data_mean=True, compute_c00=True, reversible=False, bessels_correction=False)
for X, Y, weights_x, weights_y in your_data_with_lagtime_100:
est_instantaneous.partial_fit((X, Y), weights=weights_x)
est_lagged.partial_fit(Y, weights=weights_y)
model_inst = est_instantaneous.fetch_model()
model_lagged = est_lagged.fetch_model()
from deeptime.covariance import CovarianceModel
model_combined = CovarianceModel(
cov_00=model_inst.cov_00,
cov_0t=model_inst.cov_0t,
cov_tt=model_lagged.cov_00,
mean_0=model_inst.mean_0,
mean_t=model_lagged.mean_t,
bessels_correction=model_inst.bessels_correction,
lagtime=model_inst.lagtime,
symmetrized=False,
data_mean_removed=True
)
from deeptime.decomposition import VAMP
VAMP().fit(model_combined) |
Thanks, I think I can work with this! That pseudocode is really helpful to see, I appreciate you taking the time to share it. |
Hi @jdrusso did you have a chance to implement this? |
Thanks for checking in -- unfortunately I haven't, I had to swap focus to some other things. I know @jpthompson17 was also interested, not sure if he's done anything with it since |
Is your feature request related to a problem? Please describe.
The
TICA
andVAMP
decomposition classes both provide similar interfaces for.fit_from_timeseries(data)
. However, theTICA
class allows aweights
argument.The
VAMP
decomposition, however, does not support weights, and throws an error if they're provided (see:deeptime/deeptime/covariance/util/_running_moments.py
Line 245 in 11182ac
Describe the solution you'd like
Support for weights in VAMP.
I see some similarity between
moments_XXXY()
andmoments_block()
, but it seems like there was probably a reason for omitting support for weights from VAMP -- is that correct?The text was updated successfully, but these errors were encountered: