NeMoS 0.2.7 Release Notes
NeMoS 0.2.7 Release Notes
New Features
Pytree Regularization Strength (by @wulfdewolf)
Enabled fine-grained regularization strength at group or individual-parameter level. regularizer_strength now accepts any pytree structure matching the model parameter tree:
# Group-wise: different strength per feature group
glm = nmo.glm.GLM(regularizer="Ridge", regularizer_strength=dict(f1=0.1, f2=0.5))
# Parameter-wise: per-coefficient strength
glm = nmo.glm.GLM(
regularizer="Ridge",
regularizer_strength=dict(f1=[0.1, 0.3, 0.3, 0.1, 1.0], f2=[0.2, 0.1])
)Previously, a single scalar applied uniformly to all parameters. A new how-to guide
(docs/how_to_guide/finegrained_regularization.md) documents the full range of options,
including per-neuron regularization in population models.
Custom Solver API (by @bagibence)
Users can now register and use their own solvers via a formal protocol and registry:
SolverProtocol: runtime-checkable protocol defining the interface any custom solver must
implement; NeMoS raises an informative error if a solver does not conform.SolverSpec: specification object for pairing a solver class with an algorithm/backend pair
in the registry.Regularizer.allow_solver(): class method to declare which solvers a regularizer supports.- Enhanced registry public API:
register(),set_default(),get_solver(),
list_available_algorithms(),list_algo_backends(). - Solver validation module (
solvers/_validation.py) for runtime conformance checks. - How-to guide (
docs/how_to_guide/custom_solvers.md) with end-to-end examples.
Scale Parameter Optimization in GLM-HMM EM (by @BalzaniEdoardo)
The EM algorithm now jointly optimizes the scale parameter of observation models that support it
(Gaussian, Gamma). Both analytical M-step updates and gradient-based updates are supported
depending on the observation model.
GLM-HMM Initialization Utilities (by @BalzaniEdoardo)
New public utilities for initializing GLM-HMM parameters, including Dirichlet prior sampling for
initial/transition probabilities and per-neuron tiled intercept initialization. These simplify
constructing valid starting states for the EM algorithm.
Bounds Handling for Basis Functions (by @BalzaniEdoardo, @wulfdewolf)
fill_valueparameter on all eval-mode bases: controls the value substituted for
out-of-bounds samples (defaultjnp.nan). Thereprshowsfill_valueonly whenbounds
is set.- Multi-dimensional bounds:
boundsnow accepts a list of(min, max)tuples, one per input
dimension, for multi-input composite bases.Noneentries disable bounds for a given dimension. FourierBasisexplicitly disallows bounds (periodicity makes clipping semantics undefined).
Bug Fixes
- Feature mask in cross-validation (#484): feature mask was incorrectly dropped when cloning a
model during cross-validation. - Optax-based SGD learning rate (#488): sign error in the Optax gradient descent learning rate
caused divergence. - Bounds:
None-bounds NaN masking (#498):where-based NaN masking was applied
unconditionally, injecting NaNs into unbounded bases. - Bounds:
_is_single_bounddetection (bounds-hotfix):Noneentries in a bounds sequence
were misclassified, breaking partially-unbounded 1D bounds. - GLM-HMM M-step (#506): miscellaneous fix in GLM-HMM M-step.
Breaking Changes
- FISTA solver state:
iter_numrenamed tonum_stepsinProxGradState, consistent with
Optimistix conventions. Code that accesses solver state fields directly will need updating.
Improvements
_n_input_dimensionalityinternal attribute renamed to_n_inputsacross all basis classes.Regularizer.check_solverno longer parses solver names via string matching; compatibility is
now determined through the registry andallow_solver.AtomicBasisMixinsignature inconsistency between__init__andset_input_shapefixed.- Lazy imports for solver and basis modules reduce import-time overhead.
simulation.pyrefactored to reduce code duplication.
What's Changed
- Hotfix: Feature mask behavior in cross-validation by @BalzaniEdoardo in #484
- Improved Class Level Docstrings for GLMs by @BalzaniEdoardo in #487
- add citation dataset by @BalzaniEdoardo in #490
- Fix type annotation by @BalzaniEdoardo in #492
- Fix bounds for
MultiplicativeBiasby @wulfdewolf in #458 - 197 pytree regularizer strength by @wulfdewolf in #433
- Add Scale Parameter Optimization to GLM-HMM EM Algorithm by @BalzaniEdoardo in #456
- Optimistix 0.1.0 compatibility by @bagibence in #496
- Quick solver fixes by @bagibence in #488
- Add support for custom solvers by @bagibence in #479
- Optimize simulate recurrent by @BalzaniEdoardo in #499
- Fix signature inconsistency by @BalzaniEdoardo in #501
- Initialization utilities for the GLM-HMM parameters by @BalzaniEdoardo in #461
- Bugfix by @BalzaniEdoardo in #506
- fix tutorial by @BalzaniEdoardo in #507
- Lazy imports by @BalzaniEdoardo in #500
- Bounds handling by @BalzaniEdoardo in #498
- Lazy import solvers by @bagibence in #509
- Skip sklearn method doc by @BalzaniEdoardo in #508
- Development by @BalzaniEdoardo in #513
- Quick changes before release by @bagibence in #514
- Bounds hotfix by @wulfdewolf in #504
- Development by @BalzaniEdoardo in #515
New Contributors
- @wulfdewolf made their first contribution in #458
Full Changelog: 0.2.6...0.2.7