Comments (6)
Our covariance computation is a bit more complicated than the usual (X - mean(X)).T @ (X - mean(X)) / len(X)
because of its online nature, so it might take a while until i get around to implementing this. It is a bit of a hack with double computation, but you can use the Covariance
estimator twice - once on the non-lagged data to compute weighted XX and XY (make sure to set remove_data_mean=True
) and once on lagged data (meaning you skip the first "lagtime" frames, respecting stride if you use that), also here remove the data mean. Then you have weighted XX, weighted YY, and unweighted cross covariance XY (this is never weighted). Finally combine the two CovarianceModel
instances into one by using mean and covariance of the XX, XY
model and the cov_00
of the second model. So in pseudocode:
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)
from deeptime.
Thanks, I think I can work with this! That pseudocode is really helpful to see, I appreciate you taking the time to share it.
from deeptime.
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
from deeptime.
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,
Moritz
from deeptime.
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.
from deeptime.
Hi @jdrusso did you have a chance to implement this?
from deeptime.
Related Issues (20)
- TICA fit-once transform-many HOT 6
- Automate generating bdist wheels HOT 1
- Error importing deeptime with scikit-learn 1.2.0 HOT 4
- About applying Deeptime to molecular dynamics simulation trajectories on protien HOT 3
- Handling parallel simulations HOT 1
- Implied timescales from deeptime.decomposition.TICA HOT 2
- [Bug] At least one of the given states is not contained in this model HOT 2
- VAMPnet gives highly fluctuating score results HOT 1
- Bayesian Markov models give different MFPT
- How to compute any actual quantity of the coarse-grained kinetics with employing the fuzzy memberships? HOT 7
- Installation without conda and pip HOT 3
- Which version of VAMPNets is there? HOT 1
- deeptime cannot be installed on Mac computers with Apple Silicon and Python 3.12.0. HOT 4
- Does one need identical features to compare between related systems? HOT 4
- Example/tutorial for dealing with MD trajectories HOT 1
- Applying TICA to ragged feature vectors HOT 2
- Cross Validation score for MaximumLikelihoodMSMs and BayesianMSMs HOT 2
- KoopmanWeightingEstimator partial_fit method throws ValueError HOT 2
- Regarding trajectory data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deeptime.