Update ALSA.py
Browse filesNLSAencoder -> NLSA
ALSA.py
CHANGED
|
@@ -39,13 +39,13 @@ from numpy.lib.stride_tricks import sliding_window_view
|
|
| 39 |
|
| 40 |
# NLSA encoder
|
| 41 |
try:
|
| 42 |
-
from .nlsa_encoder import
|
| 43 |
except Exception:
|
| 44 |
try:
|
| 45 |
-
from nlsa_encoder import
|
| 46 |
except Exception:
|
| 47 |
# if you named the file NLSA.py and class NLSAEncoder lives there
|
| 48 |
-
from NLSA import
|
| 49 |
|
| 50 |
# GPLM decoder
|
| 51 |
try:
|
|
@@ -205,7 +205,7 @@ class ALSA:
|
|
| 205 |
self.L = int(self.cfg.L)
|
| 206 |
|
| 207 |
# ---- 1) Encoder ----
|
| 208 |
-
self.enc =
|
| 209 |
F_train,
|
| 210 |
L=int(self.cfg.L),
|
| 211 |
rank=int(self.cfg.rank),
|
|
@@ -219,7 +219,7 @@ class ALSA:
|
|
| 219 |
|
| 220 |
self.r = 0 if self.enc.psi_ is None else int(self.enc.psi_.shape[1])
|
| 221 |
if self.r <= 0:
|
| 222 |
-
raise ValueError("
|
| 223 |
|
| 224 |
# Output mean from encoder centering
|
| 225 |
self.center = bool(self.cfg.center)
|
|
|
|
| 39 |
|
| 40 |
# NLSA encoder
|
| 41 |
try:
|
| 42 |
+
from .nlsa_encoder import NLSA # type: ignore
|
| 43 |
except Exception:
|
| 44 |
try:
|
| 45 |
+
from nlsa_encoder import NLSA # type: ignore
|
| 46 |
except Exception:
|
| 47 |
# if you named the file NLSA.py and class NLSAEncoder lives there
|
| 48 |
+
from NLSA import NLSA # type: ignore
|
| 49 |
|
| 50 |
# GPLM decoder
|
| 51 |
try:
|
|
|
|
| 205 |
self.L = int(self.cfg.L)
|
| 206 |
|
| 207 |
# ---- 1) Encoder ----
|
| 208 |
+
self.enc = NLSA(
|
| 209 |
F_train,
|
| 210 |
L=int(self.cfg.L),
|
| 211 |
rank=int(self.cfg.rank),
|
|
|
|
| 219 |
|
| 220 |
self.r = 0 if self.enc.psi_ is None else int(self.enc.psi_.shape[1])
|
| 221 |
if self.r <= 0:
|
| 222 |
+
raise ValueError("NLSA produced r=0 diffusion dims. Increase rank or set drop_first=False.")
|
| 223 |
|
| 224 |
# Output mean from encoder centering
|
| 225 |
self.center = bool(self.cfg.center)
|