Skip to content

Refactor NeuralPosterior interface #1407

@janfb

Description

@janfb

There seem to be a couple of problems with the NeuralPosterior class as the main interface for all the posterior classes:

  • it is treated as an abstract class, but it is not declared as such, e.g., what happens if one instantiates it and then calls sample?
  • the doc string says it has a log_prob but it does not
  • for a abstract base class, it has a lot of logic happening in this class, e.g., all the x-handling
  • sample_batched and sample are quite related but have different signatures, e.g., the order differs.

How to fix this (?):

  • get an overview how this class is used in the overall class structure
  • define as a pure abstract class and move logic about x somewhere else, e.g., have a separate abstraction of x (Observation)?

@schroedk will probably be very helpful for working on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API changesThis impacts the public API of the project (e.g. inference class).architectureInternal changes without API consequencesbugSomething isn't workinghackathon

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions