refactor: move kb interrupt handling to autoencoder classes

This commit is contained in:
Lenoctambule
2026-04-10 22:20:35 +02:00
parent 5ff6cfe55e
commit 7a822782a5
4 changed files with 17 additions and 21 deletions

View File

@@ -18,3 +18,12 @@ def regularize(v: np.ndarray) -> np.ndarray:
if v_min - v_max == 0:
return v
return (v - v_min) / (v_max - v_min)
def interruptable(func):
def inner(*args, **kwargs):
try:
return func(*args, **kwargs)
except KeyboardInterrupt:
pass
return inner