Skip to content

Commit d51b506

Browse files
committed
Prepare release
1 parent 20f90ac commit d51b506

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

dbgsom/BaseSom.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from typing_extensions import Self
1111

12+
from line_profiler import profile
13+
1214
# from matplotlib import pyplot as plt
1315
# import matplotlib
1416

@@ -938,10 +940,11 @@ def exponential_decay(
938940
return sigma
939941

940942

941-
@nb.njit(
942-
# parallel=True,
943-
fastmath=True
944-
)
943+
# @nb.njit(
944+
# # parallel=True,
945+
# fastmath=True
946+
# )
947+
@profile
945948
def numba_voronoi_set_centers(winners: npt.NDArray, data: npt.NDArray, shape: tuple):
946949
"""
947950
Calculates the centers of the Voronoi regions based on the winners and data arrays.
@@ -968,7 +971,9 @@ def numba_voronoi_set_centers(winners: npt.NDArray, data: npt.NDArray, shape: tu
968971
return voronoi_set_centers
969972

970973

971-
@nb.njit(fastmath=True)
974+
@nb.njit(fastmath=True,
975+
# parallel=True,
976+
)
972977
def numba_quantization_error(
973978
data: npt.NDArray, winners: npt.NDArray, length, weights: npt.NDArray
974979
):

dbgsom/SomClassifier.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
check_is_fitted,
1313
check_X_y,
1414
)
15-
from dbgsom.BaseSom import BaseSom
15+
from .BaseSom import BaseSom
1616

1717

1818
class SomClassifier(BaseSom, TransformerMixin, ClassifierMixin):
@@ -206,12 +206,13 @@ def predict_proba(self, X: npt.ArrayLike) -> np.ndarray:
206206
sample_probabilities = np.array(probabilities_rows)
207207

208208
else:
209-
X_transformed = self.transform(X)
210-
node_probabilities = self._extract_values_from_graph("probabilities")
211-
# Sample Probabilities do not sum to 1
212-
sample_probabilities_unnormalized = X_transformed @ node_probabilities
213-
sample_probabilities = sample_probabilities_unnormalized / (
214-
sample_probabilities_unnormalized.sum(axis=1)[np.newaxis].T
215-
)
209+
pass
210+
# X_transformed = self.transform(X)
211+
# node_probabilities = self._extract_values_from_graph("probabilities")
212+
# # Sample Probabilities do not sum to 1
213+
# sample_probabilities_unnormalized = X_transformed @ node_probabilities
214+
# sample_probabilities = sample_probabilities_unnormalized / (
215+
# sample_probabilities_unnormalized.sum(axis=1)[np.newaxis].T
216+
# )
216217

217218
return sample_probabilities

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
long_description = f.read()
55

66
setup(
7-
name="dbgsom",
8-
version="1.0.1",
7+
name="DBGSOM",
8+
version="1.1.0",
99
description="A directed batch growing approach to enhance the topology preservation of self-organizing maps ",
1010
long_description=long_description,
1111
author="Sandro Martens",
1212
author_email="sandro.martens@web.de",
1313
license="MIT",
14-
packages=["dbgsom"],
14+
packages=["DBGSOM"],
1515
install_requires=[
1616
"numpy",
1717
"networkx",

0 commit comments

Comments
 (0)