Core methods (priority sampling, gradients) for Variational Open-Domain QA/LM.
Warning: refactoring in progress, coming soon!
This package provides sampling methods to estimate the weighted mean of a function
Estimating the mean via Monte Carlo consists of
- Sampling
$K$ indices$\mathbf{z}_1, \ldots, \mathbf{z}_K$ from$p(\mathbf{z})$ with weights$\mathbf{s}_1, \ldots, \mathbf{s}_K$ . - Computing the weighted mean estimate:
$$\hat{\mu} = \sum_{i=1}^K s_i h(\mathbf{z}_i)$$
This package provides three samplers:
multinomial
: the standard multinomial sampler (vod.multinomial_sampler
).topk
: a top-k sampler (vod.topk_sampler
).priority
: a priority sampler (vod.priority_sampler
).
This package implements the VOD objective and its differentiable loss terms. See vod.vod_objective
.