From 0feaa2f19136f9edc63911dd91006e21ae861c84 Mon Sep 17 00:00:00 2001
From: bastien-mva <bastien.batardiere@gmail.com>
Date: Wed, 29 Mar 2023 11:50:15 +0200
Subject: [PATCH 1/3] set the ci to publish package only on main

---
 .gitlab-ci.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c3714c05..a8dd3286 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
 
-- 
GitLab


From 57e7a3b2ac3952e0196e794db5af6b3c38421ce7 Mon Sep 17 00:00:00 2001
From: bastien-mva <bastien.batardiere@gmail.com>
Date: Wed, 29 Mar 2023 13:24:28 +0200
Subject: [PATCH 2/3] add orthogonalization always when calling latent
 variables

---
 pyPLNmodels/VEM.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/pyPLNmodels/VEM.py b/pyPLNmodels/VEM.py
index 1b270c4a..e91f83f5 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)
-- 
GitLab


From 07eeef1ca5df7d738a941cfa09c5bfe0e27f9f28 Mon Sep 17 00:00:00 2001
From: bastien-mva <bastien.batardiere@gmail.com>
Date: Wed, 29 Mar 2023 13:25:31 +0200
Subject: [PATCH 3/3] version

---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 788976e5..82f479d6 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()
-- 
GitLab