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

Migration to torch distributions and scoringrules integration #70

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MicheleCattaneo
Copy link
Collaborator

@MicheleCattaneo MicheleCattaneo commented Dec 6, 2024

Proposal

  • Remove the dependency of TFP in order to move to Keras3 and rely on torch as backend and torch.distributions for the probabilistic layers.
  • Rely on scoringrules for probabilistic loss functions.

Current progress

  • Update poetry dependencies.
  • scoringrules has been tested on normal and exponential distributions with crps.
  • Update code to remove tf dependencies.
  • Update all models to the new structure
  • Update tests to the new structure.
  • Create the equivalent of DistributionLossWrapper for sample losses.
  • Ensure configuration files are compatible with the updates
  • Optional torch CPU/GPU
  • ...

Some implementation details:

  • Every distribution will implement BaseParametricDistribution
  • A probabilistic layer will implement BaseDistributionLayer, which contains an underlying distribution and is responsible for mapping its input into the correct number of parameters.
  • DistributionLossWrapper allows to wrap a function from scoringrules such that the loss can be computed between a tensor of observations and a predicted distribution.
  • There is a clear separation between models and layers.

@MicheleCattaneo MicheleCattaneo added the enhancement New feature or request label Dec 6, 2024
@MicheleCattaneo MicheleCattaneo self-assigned this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant