Skip to content

feat: interface for unconditional flow training #1432

Closed

Description

@janfb

we have interfaces to nflows and zuko for training conditional density estimators (see our ConditionalDensityEstimator class).

There are scenarios where one needs to train an unconditional flows, e.g., when learning a prior from data, or when learning the marginal p(x). We do not have straightforward way of doing this atm (e.g., only by setting context to ones throughout training).

To fix this issue, write an interface to zuko (because nflows is not maintained anymore) that enables unconditional flow training.

Activity

  1. added theissue type on Mar 13, 2025
  2. plcrodrigues commented on Mar 17, 2025

    @plcrodrigues
    Collaborator

    I would like to work on this :-)

  3. self-assigned this
    on Mar 17, 2025
  4. plcrodrigues commented on Mar 17, 2025

    @plcrodrigues
    Collaborator

    I have a question of how to organize the structure of the code for this issue. For instance, when doing NPE, we create a (conditional) density estimator as a child of ConditionalDensityEstimator and then do the actual training using the class PosteriorEstimator. I've created an UnconditionalDensityEstimator class and the assoziated Zuko code, but I don't know if I should simply do the training in the UnconditionalDensityEstimator or create another class analagous to PosteriorEstimator but for the unconditional case. @janfb ?

  5. plcrodrigues commented on Mar 18, 2025

    @plcrodrigues
    Collaborator

    Just to keep track of exchanges, here is the response by @janfb over discord:

    cool!

    I think it should be orthogonal to PosteriorEstimator because we are just learning a marginal (but I guess that's what you meant).

    then the question is whether we can should have a separate class, sth like MarginalEstimator (child of NeuralInference) for this purpose, right?
    not sure.. I think you could start with coding it up in a custom training first and then decide whether it makes sense to have a dedicated class.
    an intermediate goal would be just having a how-to-guide on how to use this unconditional DE to test for model missp.
    afterwards we can decide how much high-level convenience API we want to put around it 🙂

  6. janfb commented on Mar 25, 2025

    @janfb
    ContributorAuthor

    fixed with #1470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions