Skip to content

Feat(MicroSplit API): next-gen MicroSplit#972

Open
jdeschamps wants to merge 5 commits into
mainfrom
dev/microsplit_api
Open

Feat(MicroSplit API): next-gen MicroSplit#972
jdeschamps wants to merge 5 commits into
mainfrom
dev/microsplit_api

Conversation

@jdeschamps

@jdeschamps jdeschamps commented Jun 11, 2026

Copy link
Copy Markdown
Member

MSplit refactoring compatible with CAREamics v0.2.

CatEek and others added 5 commits May 12, 2026 12:32
## Disclaimer

- [ ] I am an AI agent.
- [x] I have used AI and I thoroughly reviewed every line.
- [ ] I have not used AI extensively.


## Description

> [!NOTE]  
> **tldr**: Refactor MicroSplit noise-model and loss configuration,
replacing
> fragmented likelihood configs with a unified logic.


### Background - why do we need this PR?

The previous implementation spread noise-model related code across 3
separate
Pydantic models (`GaussianLikelihoodConfig`, `NMLikelihoodConfig`, and
`MultiChannelNMConfig`), three loss types (`musplit`, `denoisplit`,
`denoisplit_musplit`), and multiple `VAEModule` attributes
(`gaussian_likelihood`, `noise_model_likelihood`). This made it hard to
reason
about which combination of configs was valid, made code very hard to
read and error prone.

### Overview - what changed?

- Likelihood configuration objects are removed; their parameters live
directly
  in `LVAELossConfig`.
- `predict_logvar` is now a plain `bool` everywhere (was `Literal[None,
  "pixelwise"]`).
- `GaussianMixtureNMConfig` exposes a `from_npz` classmethod instead of
accepting a `path` field that triggered side-effectful validation.(That
is questionable and likely to be changed)
- `VAEModule` holds data statistics directly and passes them into the
loss
  function, removing the intermediary likelihood objects.
- `NoiseModelTrainer` is added(Not yet used).
- musplit_loss, denoisplit_loss, and denoisplit_musplit_loss are
replaced
by a single microsplit_loss, controlled by `musplit_weight` /
`denoisplit_weight`.. The SupportedLoss enum retains only hdn and
microsplit.


Performance tested on a subset of ht_lif24

### Please ensure your PR meets the following requirements:
- [x] Code builds and passes tests locally, including doctests
- [x] New tests have been added (for bug fixes/features)
- [ ] Pre-commit passes
- [ ] PR to the documentation exists (for bug fixes / features)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vera Galinova <32124316+veegalinova@users.noreply.github.com>
Co-authored-by: Joran Deschamps <6367888+jdeschamps@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants