sbi
sbi copied to clipboard
Refactor NeuralPosterior interface
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_probbut 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_batchedandsampleare 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
xsomewhere else, e.g., have a separate abstraction ofx(Observation)?
@schroedk will probably be very helpful for working on this.