Giter Site home page Giter Site logo

deeptime-ml / deeptime Goto Github PK

View Code? Open in Web Editor NEW
719.0 20.0 78.0 13.26 MB

Python library for analysis of time series data including dimensionality reduction, clustering, and Markov model estimation

Home Page: https://deeptime-ml.github.io/

License: GNU Lesser General Public License v3.0

Python 87.34% CMake 0.24% C++ 12.33% Cython 0.10%
time-series-analysis markov-state-model covariance-estimation markov-model python hidden-markov-model koopman-operator coherent-set-detection

deeptime's Introduction

deeptime

License: LGPL v3 Build Status codecov DOI

Deeptime is a general purpose Python library offering various tools to estimate dynamical models based on time-series data including conventional linear learning methods, such as Markov State Models (MSMs), Hidden Markov Models (HMMs) and Koopman models, as well as kernel and deep learning approaches such as VAMPnets and deep MSMs. The library is largely compatible with scikit-learn, having a range of Estimator classes for these different models, but in contrast to scikit-learn also provides Model classes, e.g., in the case of an MSM, which provide a multitude of analysis methods to compute interesting thermodynamic, kinetic and dynamical quantities, such as free energies, relaxation times and transition paths.

Installation via conda or pip. Both provide compiled binaries for Linux, Windows, and MacOS (x86_64 and arm64).

conda-forge PyPI
conda install -c conda-forge deeptime pip install deeptime

Documentation: deeptime-ml.github.io.

Main components of deeptime

Dimension reduction Deep dimension reduction SINDy
Dimension reduction Deep dimension reduction SINDy
Markov state models Hidden Markov models Datasets
MSMs HMMs Datasets

Building the latest trunk version of the package:

Using pip with a local clone and pulling dependencies:

git clone https://github.com/deeptime-ml/deeptime.git

cd deeptime
pip install .

Or using pip directly on the remote:

pip install git+https://github.com/deeptime-ml/deeptime.git@main

deeptime's People

Contributors

briandesilva avatar brookehus avatar clarktemple03 avatar clonker avatar dependabot[bot] avatar kirillshmilovich avatar maaikeg avatar marscher avatar philipyoung9561 avatar selleban avatar seyedmohamadmoosavi avatar sianxiaochn avatar thempel avatar wehs7661 avatar yuxuanzhuang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deeptime's Issues

Build fails suddenly

Hey There!

I was building some stuff recently, when suddenly my CI pipeline failed. According to the report is was because a dependency was not installed properly.

Please check it here:
Failed CI

Do you have any suggestions on what to do?

Thank you!

msm refactor design

In pyemma there is no separation between model and estimator in the msm part.

In order to create such a separation and make code more readable / maintainable, we have to decide where exactly to cut.

In general there is statistics about the input dtrajs as well as the count matrix. This can, e.g., be captured in a separate TransitionCountEstimator - TransitionCountModel pair.

A MSM in principle does not need to be estimated from data but can be constructed from a transition matrix P. In that case there would be a MarkovStateModel instance.
If however the MSM is estimated from data, a TransitionCountModel is intermediately needed and the attributes are probably still interesting for further evaluation.

The question is how to most conveniently combine these two models into one.

  1. One could make use of multiple inheritance, i.e., class EstimatedMarkovStateModel(MarkovStateModel, TransitionCountModel).
  2. Composition: The EstimatedMarkovStateModel is a glorified tuple of the MarkovStateModel and TransitionCountModel
  3. The MarkovStateModel has a (default None) reference to a TransitionCountModel
  4. General restructure: The base model is defaulted to None and only exists within an estimator once it has been fitted.

How to pass arguments in the method gather_stats of deeptime.markov.hmm.BayesianHMMPosterior

After I evaluated the deeptime.markov.hmm.BayesianHMMPosterior as:

hmm = HMM.MaximumLikelihoodHMM(initial_model=HMM.init.discrete.metastable_from_data(data,3,2000)).fit(data).fetch_model()
bayesian_hmm = HMM.BayesianHMM(initial_hmm=hmm).fit(data).fetch_model()

I would like to evaluate the average and the standard deviation of the mfpt of the transition_model but I couldn't find a way of inserting the arguments:
stats = bayesian_hmm.gather_stats('transition_model/mfpt')
I would like to use the metastable state 0,1 or others but I couldn't figure out how to pass these arguments to mfpt (in the documentation it is written you are able to)

submodels

Related to issue #40.

When getting a submodel from a count model (or markov state model), it is currently implemented through the states, ie if there are states 0,1,2,3,4 and one calls

submodel = model.submodel([1,2,3])

then the symbols of submodel are [1,2,3] but the states on submodel are [0,1,2], so taking another submodel

subsubmodel = submodel.submodel([0,1])

yields a model on symbols [1,2] but with states [0,1]. The question is whether submodel to take the states as input or the symbols, one referring to a iota range of the current number of states and one referring to the symbols of the original data represented in the model.

VAMPNet manage multiple trajectories

I had a similar discussion with you some days ago and the problem was quite well solved. For a better understanding and for a more precise usage I need to ask you something else regarding managing VAMPNet with multiple trajectories. As long as I understood it isn't important to provide a trajectory but rather a set of instantaneous and lagged frames. This raise a couple of questions:

  1. In the documentation the validation data are not shuffled: loader_val = DataLoader(val_data, batch_size=len(val_data), shuffle=False) is it necessary for correctness or for just performance purposes? If what's important is that the tuple (cur_frame,lagged_frame) is consistent then I could shuffle without losing this identity and the training should be the same
  2. In this way I could also concatenate many trajectories as long as I keep the identity between current frame and lagged frame. For example:
class Data:
    def __init__(self,trjs,lagtime):
        self.data_inst = np.concatenate([trj[:-lagtime] for trj in trjs])
        self.data_lagged = np.concatenate([trj[lagtime:] for trj in trjs])
    def __getitem__(self,item):
        return (self.data_inst[item],self.data_lagged[item])
    def __iter__(self):
        for X,Y in zip(self.data_inst,self.data_lagged):
            yield (X,Y)

This class could be what I pass to the pytorch DataLoader and I should be training the network correctly. Is this correct or am I missing something? Moreover this concatenated frames could be shuffled as well

Thank you very much for your help again, and congratulations again for this great library!
EDIT
The Data class doesn't work with the DataLoader pytorch I wanted to put there just as an example

Better error handling for custom_sde

I think the error handling of custom_sde could be improved -- currently, my kernel just dies when I pass a bad function, which is a bit inconvenient for debugging. I'm following the tutorial.

from deeptime.data import custom_sde
sde = custom_sde(dim=2, rhs=lambda x: this_function_should_not_fail(x, args),
                 sigma=np.diag([1., 1.]), h=1e-3, n_steps=100)

docs

As far as I can see the code is undocumented unless docs were available from PyEMMA. All new code, especially the user API needs to be documented with the same standard.

Largest connected set returns a state when it should return an empty set

The following should print the empty set [] but instead prints [3].

import numpy as np
from deeptime.markov import TransitionCountEstimator

estimator = TransitionCountEstimator(lagtime=1, count_mode='sliding')

full_counts_model = estimator.fit_fetch(np.asarray([0, 1, 2, 3]))
submodel = full_counts_model.submodel_largest(
        connectivity_threshold=1,
        directed=True)
print(submodel.state_symbols)

ModuleNotFoundError: No module named 'deeptime.util.data'

Hi,

I (successfully) installed โ€˜deeptimeโ€™ today (tested both Honda and pip). To test the installation, I ran the โ€™taeโ€™ example from the deeptime notebook. While the deeptime imports work, I get an import error

from deeptime.util.data import TrajectoryDataset

Since I saw a recent change in the utils, could it be a problem with the latest version?

Bring over msmtools

For the goal of eventually reducing/removing nontrivial dependencies.

This is going to involve merging the setup.py's to build extensions

Different VAMPNET results from CPU/GPU training

Describe the bug
I tried to run the ala2 notebook (https://github.com/deeptime-ml/deeptime-notebooks/blob/master/examples/ala2-example.ipynb) but ended up with quite different results with GPU v.s. CPU training. CPU had a much higher success rate and flat training curves compared to GPU. I am wondering if it is something common or if I had made any mistakes.

Results
I tested with 10 individual runs with the same parameters as in the tutorial notebook.

  • CPU
    cpu_training
    cpu_state

  • GPU
    gpu_training
    gpu_state

System
CPU: AMD EPYC 7551
GPU: RTX A5000
System: Ubuntu 20.04.1
Python 3.9
torch 1.11.0+cu113
deeptime '0.4.1+8.g38b0158.dirty' (main branch)

Fail to install through conda or pip

With conda, it hangs trying to solve the environment. With pip, I get

ERROR: Failed building wheel for deeptime Failed to build deeptime ERROR: Could not build wheels for deeptime which use PEP 517 and cannot be installed directly

I assume I can solve this by specifying an older version of wheel?

I completely deleted/reinstalled anaconda and started fresh with a new environment containing:
`name: pytorch-env
channels:

  • conda-forge
  • defaults
    dependencies:
  • _libgcc_mutex=0.1=conda_forge
  • _openmp_mutex=4.5=1_llvm
  • ca-certificates=2020.12.5=ha878542_0
  • certifi=2020.12.5=py38h578d9bd_1
  • cffi=1.14.5=py38ha65f79e_0
  • future=0.18.2=py38h578d9bd_3
  • ld_impl_linux-64=2.35.1=hea4e1c9_2
  • libblas=3.9.0=8_mkl
  • libcblas=3.9.0=8_mkl
  • libffi=3.3=h58526e2_2
  • libgcc-ng=9.3.0=h2828fa1_19
  • liblapack=3.9.0=8_mkl
  • libprotobuf=3.15.8=h780b84a_0
  • libstdcxx-ng=9.3.0=h6de172a_19
  • llvm-openmp=11.1.0=h4bd325d_1
  • mkl=2020.4=h726a3e6_304
  • ncurses=6.2=h58526e2_4
  • ninja=1.10.2=h4bd325d_0
  • numpy=1.20.2=py38h9894fe3_0
  • openssl=1.1.1k=h7f98852_0
  • pip=21.1=pyhd8ed1ab_0
  • pycparser=2.20=pyh9f0ad1d_2
  • python=3.8.8=hffdb5ce_0_cpython
  • python_abi=3.8=1_cp38
  • pytorch=1.8.0=cpu_py38hd248515_1
  • readline=8.1=h46c0cb4_0
  • setuptools=49.6.0=py38h578d9bd_3
  • sleef=3.5.1=h7f98852_1
  • sqlite=3.35.5=h74cdb3f_0
  • tk=8.6.10=h21135ba_1
  • typing_extensions=3.7.4.3=py_0
  • wheel=0.36.2=pyhd3deb0d_0
  • xz=5.2.5=h516909a_1
  • zlib=1.2.11=h516909a_1010
    prefix: /home/bharland/anaconda3/envs/pytorch-env`

PCCA and ReactiveFlux should not be Estimators

They do not use data but models or even just transition matrices as input. I don't see why they should be regarded as an estimator. It seems unnatural to do first a construction without the model they depend on but already use definitions of A, B sets (for TPT) which depends on the model that is only provided later with .fit(model).

So I think these are maybe "models" if there is any use for that, but they are outside the usual "estimator" logic.

submodels of msms

Concerns mostly PR #39. Should we introduce the ability to create a MSM submodel directly? This would involve creating a submodel of the associated count matrix if one was provided and re-estimating the transition matrix on a restricted set of states. From my perspective there is one

  • pro: easier to use, also markov state models can be submodeled, just as count models

and one

  • con: intrdocues a circular dependency between markov state model and markov state model estimator and/or needs further checks whether the restricted model is still at least weaky connected.

TransitionCountModel.states_to_symbols incorrectly handles negative indices

I have a dtraj where I am only interested in the samples from the largest connected set. All other samples should be assigned index -1.

I have a submodel of a transitioncountsmodel and use transform_discrete_trajectories_to_submodel, to assign -1 to all samples that don't belong in the connected set. Now I want to convert the new indices back to the original symbols, while preserving all -1 indices. However, the states_to_symbols assigns some incorrect index to the states indexed -1. The -1-states seem to be assigned the largest index of the connected set.

The following script reproduces the issue:

from deeptime.markov import TransitionCountEstimator
import numpy as np


estimator = TransitionCountEstimator(lagtime=1, count_mode='sliding')
dtrajs = np.asarray([[1,2,1,2,1,2,3], [4,5,4,4,5,5,4]])

counts = estimator.fit_fetch(dtrajs)

submodel = counts.submodel_largest(connectivity_threshold=1, directed=True)

restricted_dtraj = submodel.transform_discrete_trajectories_to_submodel(dtrajs)

print('items not in connected set are labelled -1:')
print(restricted_dtraj)

print('When converting back to symbols, states previously labelled with -1 are now given an incorrect index:')
for traj in restricted_dtraj:
    print(submodel.states_to_symbols(traj))

TrajectoriesDataset misleading error message

When passing a list of trajectories to TrajectoriesDataset, one of them being shorter than the given lag time, I get the following error message. We could probably improve it by doing the check in the __init__ of that method instead of later-on, so the user knows that just a subset of trajectories may be affected.

TrajectoriesDataset.from_numpy(lagtime, data)
    257 assert hasattr(data, '__len__') and len(data) > 0, "Data is empty."
    258 assert is_timelagged_dataset(data), \
    259     "Data is not a time-lagged dataset, i.e., yielding tuples of instantaneous and time-lagged data. " \
    260     "In case of multiple trajectories, deeptime.util.data.TrajectoriesDataset may be used."

File /storage/mi/thempel/anaconda3/envs/py39_feb22/lib/python3.9/site-packages/deeptime/util/data.py:370, in TrajectoriesDataset.from_numpy(lagtime, data)
    367 assert isinstance(data, list), "Input must be a list of trajectories. If you only have one trajectory, use " \
    368                                "TrajectoryDataset or wrap it into a list like [trajectory]."
    369 assert len(data) > 0 and all(data[0].shape[1:] == x.shape[1:] for x in data), "Shape mismatch!"
--> 370 return TrajectoriesDataset([TrajectoryDataset(lagtime, traj) for traj in data])

File /storage/mi/thempel/anaconda3/envs/py39_feb22/lib/python3.9/site-packages/deeptime/util/data.py:370, in <listcomp>(.0)
    367 assert isinstance(data, list), "Input must be a list of trajectories. If you only have one trajectory, use " \
    368                                "TrajectoryDataset or wrap it into a list like [trajectory]."
    369 assert len(data) > 0 and all(data[0].shape[1:] == x.shape[1:] for x in data), "Shape mismatch!"
--> 370 return TrajectoriesDataset([TrajectoryDataset(lagtime, traj) for traj in data])

File /storage/mi/thempel/anaconda3/envs/py39_feb22/lib/python3.9/site-packages/deeptime/util/data.py:288, in TrajectoryDataset.__init__(self, lagtime, trajectory)
    286 def __init__(self, lagtime, trajectory):
    287     assert lagtime > 0, "Lagtime must be positive"
--> 288     assert len(trajectory) > lagtime, "Not enough data to satisfy lagtime"
    289     super().__init__(trajectory[:-lagtime], trajectory[lagtime:])
    290     self._trajectory = trajectory

AssertionError: Not enough data to satisfy lagtime

Make docs and developer guidelines

i.e. resources for contributors and users

  • issue templates
  • PR templates
  • installation guide (to some degree there, needs instructions on how to install via conda/pip)
  • contributing guide
  • user documentation

HMM sampling for out-of-sample data bug

I am applying a learnt HMM to a different data set and want to extract representative structures. However, certain observable states are not in this data set (i.e. not in the discrete trajectories that I'm giving to this function). So this code will not work:

hmm.sample_by_observation_probabilities(dtrajs_off_sample, 50)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-181-fb63165c514a> in <module>
----> 1 hmm.sample_by_observation_probabilities(dtrajs_off_sample, 50)
      2 observable_state_indices = sample.compute_index_states(mapped)

/storage/mi/thempel/anaconda3/envs/py37_feb21/lib/python3.8/site-packages/deeptime/markov/hmm/_hidden_markov_model.py in sample_by_observation_probabilities(self, dtrajs, nsample)
    542         mapped = self.transform_discrete_trajectories_to_observed_symbols(dtrajs)
    543         observable_state_indices = sample.compute_index_states(mapped)
--> 544         return sample.indices_by_distribution(observable_state_indices, self.output_probabilities, nsample)
    545 
    546     # ================================================================================================================

/storage/mi/thempel/anaconda3/envs/py37_feb21/lib/python3.8/site-packages/deeptime/markov/_sample.py in indices_by_distribution(indices, distributions, nsample)
    146     for dist in distributions:
    147         if len(dist) != n:
--> 148             raise ValueError('Size error: Distributions must all be of length n (number of states).')
    149 
    150     # list of states

ValueError: Size error: Distributions must all be of length n (number of states).

IMO the reason is that processing of the discrete trajectories internally misses out about observable states that are a) not in the discrete trajectory and b) have state indices larger than the max state index in the given trajectories.

VAMPnet partial fit

I'd like to use VAMPnet for a large amount of data. I'm coming from pyEMMA where managing this is easy thanks to the function pyemma.coordinates.source. I see that deeptime is lacking this function but I do see the partial_fit function in almost all the functions. My problem is how this can be used in VAMPnet? The fit and partial_fit functions seem to do different things: in the first one for instance it is asked also for validation data while the second is satisfied by just the training data, same thing for the number of epochs.
Another thing is whether I should fetch the model at the end. Right now I'm trying to do a loop over my data in the following way:

import torch
import torch.nn as nn
import numpy as np
from deeptime.data import TimeLaggedDataset
from deeptime.util.torch import MLP
from torch.utils.data import DataLoader
from deeptime.decomposition.deep import VAMPNet

lobe = MLP(units=ns, nonlinearity=nn.ReLU)
vampnet = VAMPNet(lobe=lobe,learning_rate=3)
# paths is just a list of strings containing the path to .npy data
for path in paths:
    data = np.load(path)
    dataset = TimeLaggedDataset.from_trajectory(lagtime=500, data=data.astype(np.float32))
    lobe = MLP(units=ns, nonlinearity=nn.ReLU)
    vampnet = VAMPNet(lobe=lobe, learning_rate=1e-4)
    vampnet.partial_fit((dataset.data,dataset.data_lagged))
model = vampnet.fetch_model()  # I'm pretty sure this is not right at all as most of the code before

Note I'm not using the train_data and the val_data as you did in the documentation since partial_fit doesn't require it, but I'm pretty sure that I should somehow.
I think that from the documentation is not clear how you should deal with this kind of problem.
Thank you very much for your time

test oom

OOM is entirely untested at this point

Write unit tests for meta-stuff with sk-learn compatibility

e.g. pipelines, gridsearch

Collection of sklearn tools that should be supported with our estimates (best would be to have a parameterized test for this, estimators x tools):

  • pipelines (implemented for a special case)
  • grid search (other CV methods?)

Adding Koopman operator evaluation, ITS evaluation and CK test to VAMPnet module

I contacted you a few days ago regarding the VAMPnet usage. I solved everything but I think there's something missing. From the references it is reported that you could evaluate the ITS and the CKtest straight from the koopman matrix built on the transformed data from your VAMPnet. Starting from these data it isn't difficult to evaluate by your own the koopman operator, the ITS and the Chapmann-Kolmogorov test but for completeness I would ask these functions to be added so that the users could entrust your implementation, for sure much more robust and compact.

Again congratulations for this huge and extremely well organized library!

online covariance - example

hi @brookehus !

This looks like a very exciting library!

Is there an example of the online covariance calulation.

Its a problem I am looking at, at the moment.

Kind regards,
Andrew

Sort Markov matrix

Is your feature request related to a problem? Please describe.
I am doing Markov modelling for SAR/QSAR analysis of chemical compounds and would need sorted markov matrices.

I suggest to sort the Markov matrix according to the most stable state. Something like with better memory management:

def sort_markov_matrix(markov_matrix): 
    """Takes in random markov matrix
    returns sorted markov matrix 

    Args:
        markov_matrix (np.array): unsorted matrix

    Returns:
        (np.array): sorted Markov matrix
    """
    
    
    
    b = markov_matrix.copy()
    for i in range(len(markov_matrix)): 
        ref1 = markov_matrix[i,i]
        for j in range(i+1, len(markov_matrix)): 
            ref2 = markov_matrix[j, j]
            if ref2 > ref1: 
                markov_matrix[i, :] = b[j, :]
                markov_matrix[j, :] = b[i, :]
                b = markov_matrix.copy()
                for k in range(len(markov_matrix)):
                    markov_matrix[k,i] = b[k, j]
                    markov_matrix[k,j] = b[k, i]
                    b = markov_matrix.copy()
    return markov_matrix

Test with

def test_sort(): 
    a = np.array([[0.8, 0.1, 0.05, 0.05],[0.005, 0.9, 0.03, 0.015], [0.1, 0.2, 0.4, 0.3],[0.01, 0.02, 0.03, 0.94]])
    sorted_a = sort_markov_matrix(a)
    assert np.array_equal(sorted_a[0,:], np.array([0.94, 0.02, 0.01, 0.03])) == True, str(sorted_a[0,:])
    assert np.array_equal(sorted_a[1,:], np.array([0.015,0.9, 0.005, 0.03])) == True, str(sorted_a[1,:])
    assert np.array_equal(sorted_a[2,:], np.array([0.05, 0.1, 0.8, 0.05])) == True, str(sorted_a[2,:])
    assert np.array_equal(sorted_a[3,:], np.array([0.3, 0.2, 0.1, 0.4])) == True, str(sorted_a[3,:])

What do you think?

Units

Add optional dependency to pint for units

pcca and reactive flux

is it desired to have these as sort of stand-alone models? should we provide thin estimators?

Problem with ck test for VAMP models based on VAMPnet

Describe the bug
Following the tutorial I built a VAMPnet model, which I then used for building a VAMP model. I try to use the function deeptime.decomposition.VAMP.chapman_kolmogorov_validator but I get an error which seems related to CUDA.

Here's the code I used:

if torch.cuda.is_available():
    device = torch.device("cuda")
    torch.backends.cudnn.benchmark = True
else:
    device = torch.device("cpu")

...

vampnet = VAMPNet(lobe=lobe, learning_rate=5e-5, device=device)

model = vampnet.fit(loader_train, n_epochs=80,
                    validation_loader=loader_val, progress=tqdm,num_workers=12)
model = vampnet.fetch_model()
vamp_estimator = deeptime.decomposition.VAMP(lagtime=1, observable_transform=model)
for feat in feats:
    vamp_estimator.fit(feat)
cktest = vamp_estimator.chapman_kolmogorov_validator(mlags=5)
cktest.fit(feats)

Here's the error I get from the very last function (fit):

---------------------------------------------------------------------------
MaybeEncodingError                        Traceback (most recent call last)
/tmp/ipykernel_5614/40083620.py in <module>
----> 1 cktest.fit(feats)

~/miniconda3/envs/standard/lib/python3.9/site-packages/deeptime/base.py in __call__(self, *args, **kwargs)
    329         # here we invoke the immutable setting context manager.
    330         with self:
--> 331             return self.fit_method(*args, **kwargs)
    332 
    333 

~/miniconda3/envs/standard/lib/python3.9/site-packages/deeptime/decomposition/_vamp.py in fit(self, data, n_jobs, progress, **kw)
    536 
    537     def fit(self, data, n_jobs=None, progress=None, **kw):
--> 538         return super().fit(data, n_jobs, progress, _vamp_estimate_model_for_lag, **kw)

~/miniconda3/envs/standard/lib/python3.9/site-packages/deeptime/util/_validation.py in fit(self, data, n_jobs, progress, estimate_model_for_lag, **kw)
    215             estimated_models = [None for _ in range(len(args))]
    216             with joining(get_context("spawn").Pool(processes=n_jobs)) as pool:
--> 217                 for result in progress(pool.imap_unordered(_imap_wrapper, args),
    218                                        total=len(lags_for_estimation), leave=False):
    219                     estimated_models[result[0]] = result[1]

~/miniconda3/envs/standard/lib/python3.9/site-packages/deeptime/util/platform.py in __iter__(self)
     45 
     46             def __iter__(self):
---> 47                 for x in self._x:
     48                     yield x
     49 

~/miniconda3/envs/standard/lib/python3.9/multiprocessing/pool.py in next(self, timeout)
    868         if success:
    869             return value
--> 870         raise value
    871 
    872     __next__ = next                    # XXX

MaybeEncodingError: Error sending result: '(0, CovarianceKoopmanModel-140689055304384:cov=CovarianceModel-140689055772624:bessels_correction=False,
                 cov_00=array([[ 0.14842, -0.04204,  0.07373, -0.043  ,  0.07192],
       [-0.04204,  0.04164, -0.05627, -0.00437, -0.03761],
       [ 0.07373, -0.05627,  0.24251, -0.0284 ,  0.07516],
       [-0.043  , -0.00437, -0.0284 ,...ean_t=array([ 0.11889,  0.06795,  0.19451, -0.07669, -0.01361]),
                 symmetrized=False],
                    dim=None, epsilon=1e-06,
                    instantaneous_coefficients=array([[ 1.22836,  0.10245,  0.86968, -0.85672,  2.75446],
       [ 0.78748, -0.74543,  6.44766,  1.68509,  1.40851],
       [ 1.80051, -0.18341,  1.1264 ,  0.28173, -1.27747],
       [-0.13282, -1.704  ,  0.79938, -1.14148,  0.05633],
       [-0.51658, -2.02416,  0.04631,  1.5041 ,  0.30593]]),
                    instantaneous_obs=<deeptime.basis._base.Concatenation object at 0x7ff4b930a9d0>,
                    rank_0=None, rank_t=None, scaling=None,
                    singular_values=array([0.99284, 0.96986, 0.96327, 0.93159, 0.92537]),
                    timelagged_coefficients=array([[ 1.21888,  0.10375,  0.86981, -0.86834,  2.75489],
       [ 0.80913, -0.73404,  6.47044,  1.63579,  1.41194],
       [ 1.79924, -0.16619,  1.13919,  0.26392, -1.26038],
       [-0.12339, -1.69904,  0.80932, -1.14899,  0.06429],
       [-0.50191, -2.02019,  0.0393 ,  1.48308,  0.30815]]),
                    timelagged_obs=<deeptime.basis._base.Concatenation object at 0x7ff4b930aa30>,
                    var_cutoff=None])'. Reason: 'RuntimeError('Attempted to send CUDA tensor received from another process; this is not currently supported. Consider cloning before sending.')'


I even tried to use this function before creating the VAMP model: model.set_params(device='cpu') but nothing changed.

  • deeptime version:
    {'date': '2021-11-01T14:07:19+0100',
    'dirty': False,
    'error': None,
    'full-revisionid': '4aba39251baab40719b7b369097bb088f36a8e48',
    'version': '0.3.0'}]
    conda.txt

  • operating system: Debian GNU/Linux 10 (buster)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.