sbi icon indicating copy to clipboard operation
sbi copied to clipboard

Refactor NeuralPosterior interface

Open janfb opened this issue 10 months ago • 0 comments

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.

janfb avatar Feb 24 '25 15:02 janfb