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

Jammy flow integration #728

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

RasmusOrsoe
Copy link
Collaborator

@RasmusOrsoe RasmusOrsoe commented May 29, 2024

This PR adds support for Normalizing Flows via the jammy_flows package, and therefore supersedes #649. The benefit of using jammy_flows is that it contains many different normalizing flows, and that we avoid maintaining that code ourselves :-).

The package is not listed as a direct dependency but used as an optional support package.

Specifically, this PR introduces the following major changes:

  1. StandardFlowTask now uses jammy_flows to construct pdfs of any kind that it supports. These pdfs can be both conditional and non-conditional. Conditional flows can be conditioned on latent model output, event-level information or pulse-level information.
  2. A new model class is added: NormalizingFlow which work with the StandardFlowTask. Usage is similar to StandardModel.
  3. An example of training a conditional flow is added under examples/04_training/07_train_normalizing_flow.py
  4. has_jammy_flows_package() is added under graphnet.utils.imports to check if its installed, and is used in a few places to make sure that the code runs also for people who choose not to install jammy_flows.

Minor changes:

  1. repeat_labels is added as an argument to GraphDefinition - if True, event-level information, .e.g energy is repeated row-wise to match the number of pulses in the event. This feature was added in this PR to make it possible to build flows that learn pulse-level pdfs conditioned on event-level information.
  2. Installation matrix is updated to provide a note on the installation of jammy flows
  3. Github workflows is adjusted to run with jammy_flows installed.
  4. **kwargs for Trainer is added for predict-methods in EasySyntax to allow the same level of control over Trainer arguments as we have for .fit

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.

None yet

1 participant