Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add algorithm model validators #361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jdeschamps
Copy link
Member

Description

Following #354: final_activation was allowed to be set although it would break CARE, N2N and N2V.

This PR adds a Pydantic validator preventing final activation for these algorithms. It also takes the opportunity to improve the Pydantic models by moving the validators to a different module and using annotations for cleaner code.

  • What: CARE, N2N and N2V do not allow final activation in the UNet.
  • Why: This would otherwise break the algorithm training.
  • How: Add model validators in the respective Pydantic models.

Changes Made

  • Added: model_validators.py.
  • Modified: Algorithms model.

Related Issues


Please ensure your PR meets the following requirements:

  • Code builds and passes tests locally, including doctests
  • New tests have been added (for bug fixes/features)
  • Pre-commit passes
  • PR to the documentation exists (for bug fixes / features)

@jdeschamps jdeschamps marked this pull request as ready for review January 17, 2025 21:02
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.

Validate UNet final_activation in N2V, CARE and N2N algorithm configurations
1 participant