Coverage for src / autoencodix / configs / stackix_config.py: 67%

12 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-05-21 10:09 +0200

1from .default_config import DefaultConfig 

2from pydantic import Field, model_validator 

3 

4import warnings 

5 

6 

7class StackixConfig(DefaultConfig): 

8 """ 

9 A specialized configuration inheriting from DefaultConfig. 

10 For Stackix, `save_memory` is always False (feature not supported). 

11 """ 

12 

13 beta: float = Field( 

14 default=0.1, 

15 ge=0, 

16 description="Beta weighting factor for VAE loss", 

17 ) 

18 

19 save_memory: bool = Field( 

20 default=False, 

21 description="Always False — not supported for Stackix.", 

22 ) 

23 

24 @model_validator(mode="before") 

25 def _force_save_memory_false(cls, values): 

26 if values.get("save_memory") is True: 

27 warnings.warn( 

28 "`save_memory=True` is not supported for StackixConfig — forcing to False., Set the checkpoint_interval to number of epochs if you want to save memory", 

29 UserWarning, 

30 stacklevel=2, 

31 ) 

32 values["save_memory"] = False 

33 return values