You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This strategy generally provides biased gradients, but can still be an efficient approximation.
198
+
199
+
References:
200
+
[1] Karkus P, Hsu D, Lee WS (2018). “Particle filter networks with application to visual localization.” In Proc. Conf. Robot Learn., pp. 169–178. PMLR, Zurich, CH.
201
+
202
+
Args:
203
+
key: Random key.
204
+
x: Particles to resample.
205
+
log_w: Log weights of the particles.
206
+
softness: Softness parameter.
207
+
208
+
Returns:
209
+
x_resampled: Resampled particles.
210
+
log_w_resampled: Log weights of the resampled particles.
211
+
"""
134
212
n=x.shape[0]
135
213
log_n=jnp.log(n)
136
214
log_softness=jnp.log(softness)
@@ -151,11 +229,44 @@ def filter_dpf(
151
229
us: Array|None=None,
152
230
ts: Array|None=None,
153
231
hyperparams: DPFHyperParams=DPFHyperParams(),
154
-
):
155
-
"""Differentiable particle filter with configurable resampling (default stop-gradient)."""
"""Differentiable particle filter with configurable resampling.
234
+
235
+
A differentiable particle filter (DPF) is a particle filter with the (discrete, non-differentiable) resampling step replaced in some way to allow for gradient-based optimization.
236
+
This implementation supports three different resampling methods:
237
+
- Multinomial resampling (biased)
238
+
- Soft resampling [1] (biased; interpolates between multinomial and uniform resampling)
239
+
- Stop-gradient resampling [2] (unbiased for score estimates)
240
+
241
+
Currently, only bootstrap proposals are supported.
242
+
243
+
References:
244
+
[1] Karkus P, Hsu D, Lee WS (2018). “Particle filter networks with application to visual localization.” In Proc. Conf. Robot Learn., pp. 169–178. PMLR, Zurich, CH.
245
+
[2] Scibior A, Wood F (2021). “Differentiable particle filtering without modifying the forward pass.” arXiv:2106.10314
246
+
247
+
Args:
248
+
key: Random key.
249
+
params: Parameters of the CDNLSSM.
250
+
ys: Emissions.
251
+
us: Inputs.
252
+
ts: Times.
253
+
hyperparams: Hyperparameters of the filter.
254
+
255
+
Returns:
256
+
particles: Particles.
257
+
log_weights: Log weights.
258
+
ess_history: (if return_ess_history is True) Effective sample size history.
0 commit comments