diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c3714c05635e1af83b9aa807e157ac6282e8e236..a8dd3286b07d15e1e98f5945417316e7c77ee70f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,8 @@ publish_package: - TWINE_PASSWORD=${TWINE_PASSWORD} TWINE_USERNAME=${TWINE_USERNAME} python -m twine upload dist/* tags: - docker + only: + - main # only: # - tags diff --git a/pyPLNmodels/VEM.py b/pyPLNmodels/VEM.py index 1b270c4a5adf25f0efae2b4607fa4ffee47aa83c..e91f83f50aca8ee1e3cd8673fbfb35a44b6e309a 100644 --- a/pyPLNmodels/VEM.py +++ b/pyPLNmodels/VEM.py @@ -638,16 +638,15 @@ class _PLNPCA(_PLN): @property def latent_variables(self): - return torch.matmul(self._M, self._C.T).detach() + self._ortho_C = torch.linalg.qr(self._C, "reduced")[0] + return torch.matmul(self._M, self._ortho_C.T).detach() def get_projected_latent_variables(self, nb_dim): if nb_dim > self._q: raise AttributeError( "The number of dimension {nb_dim} is larger than the rank {self._q}" ) - return torch.mm( - self.latent_variables, torch.linalg.qr(self._C, "reduced")[0][:, :nb_dim] - ).detach() + return torch.mm(self.latent_variables, self._ortho_C[:, :nb_dim]).detach() def get_pca_projected_latent_variables(self, nb_dim): pca = PCA(n_components=nb_dim) diff --git a/setup.py b/setup.py index 788976e5bc5101b09663647d915255ad20893905..82f479d606709d4dde3a9e84559cf13b3858bf9d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from setuptools import setup, find_packages -VERSION = "0.0.31" +VERSION = "0.0.32" with open("README.md", "r") as fh: long_description = fh.read()