sparsetrace commited on
Commit
140ce5b
·
verified ·
1 Parent(s): cc26f43

Update ALSA.py

Browse files

NLSAencoder -> NLSA

Files changed (1) hide show
  1. ALSA.py +5 -5
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 NLSAEncoder # type: ignore
43
  except Exception:
44
  try:
45
- from nlsa_encoder import NLSAEncoder # type: ignore
46
  except Exception:
47
  # if you named the file NLSA.py and class NLSAEncoder lives there
48
- from NLSA import NLSAEncoder # type: ignore
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 = NLSAEncoder(
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("NLSAEncoder 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)
 
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)