Skip to content

feat: SIR correction for VIPosterior #1721

@janfb

Description

@janfb

Summary

VIPosterior.sample() had documented support for SIR debiasing via method="sir" and K parameters, but the implementation was never written. The sampling code was always just self.q.sample(sample_shape) - the method parameter was accepted but ignored.

The documentation was removed in June 2022 (12d59715), but tests continued passing these parameters because **kwargs silently swallowed them.

Question

Is SIR debiasing for VIPosterior something we want to implement (for real this time)?

Arguments for:

  • Corrects approximation error in q without retraining
  • Cheap post-hoc improvement
  • Already implemented in ImportanceSamplingPosterior (could reuse logic)

Arguments against:

  • Well-trained VI (especially fKL, IW methods) already minimizes this gap
  • Users who need this can use ImportanceSamplingPosterior with trained q as proposal
  • Was documented but never prioritized for implementation

any thoughts @manuelgloeckler @michaeldeistler ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureadding new features to the toolboxhackathon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions