12b360c6dae048ae2c1c235884627413c432e530,pyemma/coordinates/transform/vamp.py,VAMPModel,dimension,#VAMPModel#,106

Before Change



    def dimension(self):
         output dimension 
        if self.dim is None or (isinstance(self.dim, float) and self.dim == 1.0):
            if hasattr(self, "_rank0"):
                return min(self._rank0, self._rankt)
            else:
                raise RuntimeError("Requested dimension, but the dimension depends on the singular values of C00 and C11"
                                   " and the transformer has not yet been estimated. Call estimate() before.")
        if isinstance(self.dim, float):
            if hasattr(self, "cumvar") and self.cumvar is not None:
                return np.count_nonzero(self.cumvar >= self.dim)
            else:
                raise RuntimeError("Requested dimension, but the dimension depends on the cumulative variance and the "
                                   "transformer has not yet been estimated. Call estimate() before.")
        else:
            if hasattr(self, "_rank0"):
                return np.min([self._rank0, self._rankt, self.dim])
            else:
                warnings.warn(
                    RuntimeWarning("Requested dimension, but the dimension depends on the singular values of C00 and C11"
                                   " and the transformer has not yet been estimated. Result is only an approximation."))
                return self.dim

    def expectation(self, observables, statistics, lag_multiple=1, observables_mean_free=False, statistics_mean_free=False):

After Change


    def dimension(self):
         output dimension 
        if self.C00 is None:  // no data yet
            if isinstance(self.dim, int):  // return user choice
                warnings.warn("Returning user-input for dimension, since this model has not yet been estimated.")
                return self.dim
            raise RuntimeError("Please call set_model_params prior using this method.")

        if not self._svd_performed:
            self._diagonalize()
        return self._dimension(self._rank0, self._rankt, self.dim, self.singular_values)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: markovmodel/PyEMMA
Commit Name: 12b360c6dae048ae2c1c235884627413c432e530
Time: 2018-02-09
Author: m.scherer@fu-berlin.de
File Name: pyemma/coordinates/transform/vamp.py
Class Name: VAMPModel
Method Name: dimension


Project Name: markovmodel/PyEMMA
Commit Name: 359f406f6b641739840ef366826d7095158c7746
Time: 2018-02-04
Author: fabian.paul@mpikg.mpg.de
File Name: pyemma/coordinates/transform/vamp.py
Class Name: VAMP
Method Name: dimension


Project Name: KrishnaswamyLab/PHATE
Commit Name: c39832f06579a6a4e4680ac5f2f2d80cce8e28a7
Time: 2018-04-29
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name: PHATE
Method Name: transform