Skip to content

Commit 721d888

Browse files
authored
Dev (#5)
* Minor optimizations
1 parent 39e0170 commit 721d888

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cvmatrix/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.1"
1+
__version__ = "2.0.2"

cvmatrix/cvmatrix.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,14 +731,14 @@ def _init_total_stats(self) -> None:
731731
) and self.Y_total is not None:
732732
self.sum_Y_total = np.sum(self.Yw_total, axis=0, keepdims=True)
733733
if self.scale_X:
734-
self.sum_sq_X_total = np.expand_dims(
735-
np.einsum("ij, ij -> j", self.Xw_total, self.X_total), axis=0
734+
self.sum_sq_X_total = np.sum(
735+
self.Xw_total * self.X_total, axis=0, keepdims=True
736736
)
737737
else:
738738
self.sum_sq_X_total = None
739739
if self.scale_Y and self.Y_total is not None:
740-
self.sum_sq_Y_total = np.expand_dims(
741-
np.einsum("ij, ij -> j", self.Yw_total, self.Y_total), axis=0
740+
self.sum_sq_Y_total = np.sum(
741+
self.Yw_total * self.Y_total, axis=0, keepdims=True
742742
)
743743
else:
744744
self.sum_sq_Y_total = None

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cvmatrix"
3-
version = "2.0.1"
3+
version = "2.0.2"
44
description = "Fast computation of possibly weighted and possibly centered/scaled training set kernel matrices in a cross-validation setting."
55
authors = ["Sm00thix <oleemail@icloud.com>"]
66
maintainers = ["Sm00thix <oleemail@icloud.com>"]

0 commit comments

Comments
 (0)