Filters¶
Sequential ensemble filters come in two layers:
- Layer 1 — analysis steps (
filterax.filters.*). A one-shot posterior update: forecast ensemble + observation + observation operator + noise covariance in, analysed ensemble out (AnalysisResult). All implementAbstractSequentialFilterand share the gaussx-backed ensemble-statistics primitives; they differ only in how the ensemble is updated. - Layer 2 — assimilation models (top-level
filterax.*, same names). The full forecast → analyse → inflate loop: each composes anAbstractDynamicsforecast (viaeqx.filter_vmap), the matching L1 analysis step, and an optionalAbstractInflatorinto a singleassimilate()call over a sequence of observation windows, returning anAssimilationResult.
So filterax.filters.ETKF is the one-shot analysis step, while
filterax.ETKF is the loop built around it. Drop down to Layer 1 when the
standard cycle does not fit (custom inflation schedules, pipekit cycling,
differentiable training).
ETKF analysis core
filterax's ETKF keeps its own rank-N_y QR + eigh analysis core —
a thin QR of the observation anomalies followed by a small
(N_y, N_y) symmetric eigendecomposition — rather than delegating to
gaussx.etkf_transform. The decomposition is of a symmetric PSD
matrix, which keeps the transform differentiability-safe under
jax.grad (see Differentiable training).
For the specialised deterministic variants (ESTKF, ETKF_Livings,
EnSRF_Serial) see Advanced filters.
Layer-1 analysis steps¶
The everyday defaults: symmetric square-root ETKF, observation-space localized LETKF, serial-free EnSRF, and the perturbed-observations stochastic EnKF.
Layer-1 sequential filter components.
Re-exports the L1 filter classes from filterax._filters._sequential so the
canonical filterax.filters.ETKF() access path matches the design docs.
Wave 4 additions:
* :class:ETKF_Livings — ETKF + mean-preserving random rotation
* :class:EnSRF_Serial — scalar serial sqrt updates
* :class:ESTKF — error-subspace transform
* :class:SquareRootKF — parametric Cholesky filter (lives in
filterax._filters._parametric for namespacing; re-exported here for
convenience).
ETKF
¶
Bases: AbstractSequentialFilter
Ensemble Transform Kalman Filter (Bishop, Etherton & Majumdar 2001).
Deterministic square-root update working entirely in the
Nₑ-dimensional ensemble subspace. Define the transform precision
in the ensemble space and its symmetric inverse square root:
Mean and perturbation weights:
The eigendecomposition is taken on the symmetrised C̃ with a
positive eigenvalue floor to keep the square root well-defined under
floating-point error.
Complexity O(Nₑ² Nᵧ + Nₑ³) per analysis — the inner solve is
routed through gaussx so structured R does not densify.
Examples:
>>> import jax.numpy as jnp
>>> import lineax as lx
>>> from filterax.filters import ETKF
>>> particles = jnp.array([[0.0, 0.0], [1.0, 1.0], [2.0, 0.0]])
>>> R = lx.DiagonalLinearOperator(0.1 * jnp.ones(2))
>>> result = ETKF().analysis(
... particles, jnp.array([1.0, 0.5]), lambda x: x, R
... )
>>> result.particles.shape
(3, 2)
Source code in src/filterax/_filters/_sequential.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
LETKF
¶
Bases: AbstractSequentialFilter
Local Ensemble Transform Kalman Filter (Hunt, Kostelich & Szunyogh 2007).
Runs an independent ETKF analysis at each state grid point using only
observations whose distance to that grid point is ≤ radius
(R-localization). For grid point i:
- Compute distances
dᵢₖ = ‖xᵢ − yₖ‖₂and tapersρᵢₖ = ρ(dᵢₖ / r)viataper_fn(default Gaspari-Cohn). - Hard cutoff at
r— observations withdᵢₖ > rare dropped entirely. (Gaspari-Cohn has compact support out to2rso a purely taper-based mask would let every nonzero-tapered observation participate. We use the explicit distance cutoff to match the documented selection rule.) - Inflate the local observation variance by
1/ρᵢₖ:R⁻¹_loc[k] = ρᵢₖ / Rₖₖ(zero whenρᵢₖ = 0). - Solve the local
Nₑ × NₑETKF transform and write back the analysis at grid pointi.
R-localization assumes R is diagonal (Hunt et al. 2007 §2).
We accept :class:lineax.DiagonalLinearOperator directly via
:func:lineax.diagonal (no densification); anything else raises
:class:NotImplementedError.
Local analyses are embarrassingly parallel; we jax.vmap over
state grid points and accumulate the per-point (w̄ᵢ, Wᵢ) weights
in a single call.
Attributes:
| Name | Type | Description |
|---|---|---|
radius |
float
|
Localization half-width |
taper_fn |
Callable[[Float[Array, '...'], float], Float[Array, '...']]
|
Distance-to-weight function with signature
|
Examples:
>>> import jax
>>> import jax.numpy as jnp
>>> import lineax as lx
>>> from filterax.filters import LETKF
>>> particles = jax.random.normal(jax.random.key(0), (4, 3))
>>> state_coords = jnp.arange(3.0)[:, None] # 1-D grid
>>> obs_coords = jnp.array([[0.0], [2.0]])
>>> R = lx.DiagonalLinearOperator(0.5 * jnp.ones(2))
>>> result = LETKF(radius=1.5).analysis(
... particles,
... jnp.array([0.1, -0.2]),
... lambda x: x[::2], # observe grid points 0 and 2
... R,
... state_coords=state_coords,
... obs_coords=obs_coords,
... )
>>> result.particles.shape
(4, 3)
Source code in src/filterax/_filters/_sequential.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | |
EnSRF
¶
Bases: AbstractSequentialFilter
Ensemble Square Root Filter (Whitaker & Hamill 2002, batch form).
Separate mean and perturbation updates that produce the exact
analysis covariance Pₐ = (I − KH) P_f in the linear-Gaussian
limit, without perturbed observations:
- Mean from the Kalman gain:
x̄ₐ = x̄_f + K (y − ȳ_f). - Perturbations via the symmetric ETKF transform applied to anomalies.
Why "EnSRF" and not "ETKF" then? In batch form (this class) the two
are numerically equivalent on the analysis ensemble — both choices
of ensemble square root produce the same posterior covariance and
the symmetric sqrt is the only PSD- and mean-preserving choice for
rows-as-members anomalies (Tippett et al. 2003). The classical
Whitaker & Hamill (2002) distinction — a one-sided reduced gain on
perturbations — only matters when observations are assimilated one at
a time. That serial variant lives in Wave 4 as
filterax.filters.EnSRF_Serial.
For now, :class:EnSRF gives users the more familiar API (mean from
K, perturbations from a sqrt-of-T) while remaining
mathematically equivalent to :class:ETKF. Pick whichever phrasing
is more idiomatic for your domain.
Complexity matches ETKF: O(Nₑ² Nᵧ + Nₑ³).
Examples:
>>> import jax.numpy as jnp
>>> import lineax as lx
>>> from filterax.filters import EnSRF
>>> particles = jnp.array([[0.0, 0.0], [1.0, 1.0], [2.0, 0.0]])
>>> R = lx.DiagonalLinearOperator(0.1 * jnp.ones(2))
>>> result = EnSRF().analysis(
... particles, jnp.array([1.0, 0.5]), lambda x: x, R
... )
>>> result.particles.shape
(3, 2)
Source code in src/filterax/_filters/_sequential.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
StochasticEnKF
¶
Bases: AbstractSequentialFilter
Stochastic Ensemble Kalman Filter (Evensen 1994).
Perturbed-observation update — each member sees an independent draw from the observation noise:
Simple and robust; the perturbations introduce extra Monte Carlo
variance whose magnitude scales as 1/√Nₑ.
PRNG key handling. The key stored on the filter is the default
source of randomness. analysis(..., key=subkey) overrides it for
a single call — this is how the Layer-2 :class:filterax.StochasticEnKF
threads a fresh sub-key per assimilation window so consecutive
perturbations stay independent. If you call analysis directly,
pass a freshly split key each cycle or you will get identical
observation perturbations every window.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
PRNGKeyArray
|
Default PRNG key used when no |
Examples:
>>> import jax.numpy as jnp
>>> import jax.random as jr
>>> import lineax as lx
>>> from filterax.filters import StochasticEnKF
>>> particles = jnp.array([[0.0, 0.0], [1.0, 1.0], [2.0, 0.0]])
>>> R = lx.DiagonalLinearOperator(0.1 * jnp.ones(2))
>>> filt = StochasticEnKF(key=jr.key(0))
>>> result = filt.analysis(
... particles, jnp.array([1.0, 0.5]), lambda x: x, R, key=jr.key(1)
... )
>>> result.particles.shape
(3, 2)
Source code in src/filterax/_filters/_sequential.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
analysis(particles: Float[Array, 'N_e N_x'], obs: Float[Array, ' N_y'], obs_op: AbstractObsOperator | ObsCallable, obs_noise: lx.AbstractLinearOperator, *, key: PRNGKeyArray | None = None, **_: Any) -> AnalysisResult
¶
Stochastic EnKF analysis step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
particles
|
Float[Array, 'N_e N_x']
|
Forecast ensemble |
required |
obs
|
Float[Array, ' N_y']
|
Observation |
required |
obs_op
|
AbstractObsOperator | ObsCallable
|
|
required |
obs_noise
|
AbstractLinearOperator
|
Observation covariance |
required |
key
|
PRNGKeyArray | None
|
Per-step PRNG key. When |
None
|
Returns:
| Type | Description |
|---|---|
AnalysisResult
|
class: |
AnalysisResult
|
posterior ensemble and the Gaussian log-likelihood of the |
AnalysisResult
|
innovation under |
Source code in src/filterax/_filters/_sequential.py
Parametric square-root filter¶
A non-ensemble reference: propagates (μ, S) with P = S Sᵀ instead of
particles, wrapping gaussx's parallel Kalman filter. Use it for
linear-Gaussian baselines and twin-experiment ground truths.
Layer-1 sequential filter components.
Re-exports the L1 filter classes from filterax._filters._sequential so the
canonical filterax.filters.ETKF() access path matches the design docs.
Wave 4 additions:
* :class:ETKF_Livings — ETKF + mean-preserving random rotation
* :class:EnSRF_Serial — scalar serial sqrt updates
* :class:ESTKF — error-subspace transform
* :class:SquareRootKF — parametric Cholesky filter (lives in
filterax._filters._parametric for namespacing; re-exported here for
convenience).
SquareRootKF
¶
Bases: Module
Square-root parametric Kalman filter (Maybeck 1979 / gaussx).
Propagates a Gaussian belief through a linear-Gaussian model:
The forecast and analysis steps are both rewritten in square-root
form on the Cholesky factor S of P so the covariance stays
PSD by construction. Internally this delegates to
:func:gaussx.parallel_kalman_filter (form='sqrt'), which runs
Blelloch's parallel scan along the time axis — cost
O(log T · (Nₓ² Nᵧ + Nₓ³)) on hardware that can exploit the
parallelism.
The constructor stores the (time-invariant) Φ, H, Q,
R and lets the user push observations through :meth:filter.
For time-varying systems pass leading-time-axis arrays directly to
:func:gaussx.parallel_kalman_filter and skip this wrapper.
Attributes:
| Name | Type | Description |
|---|---|---|
transition |
Float[Array, 'N N'] | AbstractLinearOperator
|
State transition operator |
obs_model |
Float[Array, 'M N'] | AbstractLinearOperator
|
Observation operator |
process_noise |
Float[Array, 'N N'] | AbstractLinearOperator
|
Process-noise covariance |
obs_noise |
Float[Array, 'M M'] | AbstractLinearOperator
|
Observation-noise covariance |
Source code in src/filterax/_filters/_parametric.py
filter(observations: Float[Array, 'T M'], init_mean: Float[Array, ' N'], init_cov: Float[Array, 'N N']) -> 'SquareRootFilterResult'
¶
Run the square-root Kalman filter over observations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observations
|
Float[Array, 'T M']
|
Observation sequence |
required |
init_mean
|
Float[Array, ' N']
|
Initial belief mean |
required |
init_cov
|
Float[Array, 'N N']
|
Initial belief covariance |
required |
Returns:
| Type | Description |
|---|---|
'SquareRootFilterResult'
|
class: |
'SquareRootFilterResult'
|
filtered means, filtered covariances, and the marginal |
'SquareRootFilterResult'
|
log-likelihood |
Source code in src/filterax/_filters/_parametric.py
SquareRootFilterResult
¶
Bases: Module
Output of :meth:SquareRootKF.filter.
Mirrors :class:gaussx.FilterState so callers don't depend on the
internal gaussx structure: per-step filtered / predicted means and
covariances along a leading time axis, plus the marginal
log-likelihood of the full observation sequence.
Attributes:
| Name | Type | Description |
|---|---|---|
filtered_means |
Float[Array, 'T N']
|
|
filtered_covs |
Float[Array, 'T N N']
|
|
predicted_means |
Float[Array, 'T N']
|
|
predicted_covs |
Float[Array, 'T N N']
|
|
log_likelihood |
Float[Array, '']
|
Scalar marginal log-likelihood. |
Source code in src/filterax/_filters/_parametric.py
Layer-2 assimilation models¶
The full forecast–analyse–inflate loops. Each assimilate() call stacks
per-window forecasts, posteriors, and log-likelihoods along a leading time
axis in the returned AssimilationResult.
filterax — differentiable ensemble Kalman filters and processes for JAX.
ETKF
¶
Bases: Module
Ensemble Transform Kalman Filter — full forecast-analysis loop.
Composes dynamics → L1 ETKF analysis → optional inflator over
each observation window. Localization is not applied at this level;
use :class:LETKF for localized assimilation.
Attributes:
| Name | Type | Description |
|---|---|---|
dynamics |
AbstractDynamics
|
Forward model applied with :func: |
obs_op |
AbstractObsOperator
|
Observation operator |
inflator |
AbstractInflator | None
|
Optional posterior inflator (e.g.
:class: |
config |
FilterConfig | None
|
Optional :class: |
Examples:
>>> import jax.numpy as jnp
>>> import lineax as lx
>>> from filterax import ETKF
>>> model = ETKF(dynamics=lambda x, t0, t1: x, obs_op=lambda x: x)
>>> init = jnp.array([[0.0, 0.0], [1.0, 1.0], [2.0, 0.0]])
>>> obs = [(jnp.array([0.5, 0.5]), 1.0), (jnp.array([0.6, 0.4]), 2.0)]
>>> R = lx.DiagonalLinearOperator(0.1 * jnp.ones(2))
>>> result = model.assimilate(init, obs, R)
>>> result.particles.shape, result.analysis_history.shape
((3, 2), (2, 3, 2))
Source code in src/filterax/_filters/_models.py
assimilate(init_ensemble: Float[Array, 'N_e N_x'], observations: Sequence[tuple[Float[Array, ' N_y'], float | Float[Array, '']]], obs_noise: lx.AbstractLinearOperator, t0: float | Float[Array, ''] = 0.0) -> AssimilationResult
¶
Run forecast → ETKF analysis → optional inflation over each window.
Source code in src/filterax/_filters/_models.py
LETKF
¶
Bases: Module
Local ETKF — full forecast-analysis loop with R-localization.
state_coords and obs_coords are passed at assimilate time
because they describe the assimilation problem, not the filter
configuration. radius (and the optional taper_fn) are
configured here.
Source code in src/filterax/_filters/_models.py
EnSRF
¶
Bases: Module
Ensemble Square Root Filter — full forecast-analysis loop.
Source code in src/filterax/_filters/_models.py
StochasticEnKF
¶
Bases: Module
Stochastic Ensemble Kalman Filter — full forecast-analysis loop.
The PRNG key for window step is derived as
jr.fold_in(base_key, step) so successive windows draw
independent observation perturbations even when called inside the
same assimilation. Pass seed (int) or base_key (PRNG array)
at construction; base_key overrides seed when both are
provided.
Attributes:
| Name | Type | Description |
|---|---|---|
dynamics |
AbstractDynamics
|
Forward model. |
obs_op |
AbstractObsOperator
|
Observation operator |
inflator |
AbstractInflator | None
|
Optional posterior inflator. |
seed |
int
|
Integer used as |
base_key |
PRNGKeyArray | None
|
Explicit PRNG array. Takes precedence over |
config |
FilterConfig | None
|
Optional :class: |
Source code in src/filterax/_filters/_models.py
Latent-space assimilation¶
Run the analysis in a learned (or prescribed) latent space z = E(x):
LatentETKF / LatentLETKF are L2 loops that forecast and analyse in
z-space and decode back, returning a
LatentAssimilationResult. The helper
wrappers lift the pieces of a latent problem into the standard protocols —
LatentDynamics wraps a z-space forward model, LiftedObs composes the
decoder with an x-space observation operator, and EncodedDynamics runs
x-space dynamics through an encode/decode round-trip.
filterax — differentiable ensemble Kalman filters and processes for JAX.
LatentETKF
¶
Bases: Module
ETKF analysis applied to a latent-space ensemble (D17).
Thin composition over the existing :class:ETKF Layer-1 step:
encode the initial ensemble (when supplied in x-space), run
the standard forecast → ETKF → optional inflation cycle on the
latent ensemble using LiftedObs(decoder, x_obs_op) as the
observation operator, then decode the histories back to
x-space alongside the latent representations.
The ensemble math is unchanged — the wrapper exists for ergonomics
and for compile-time correctness (it would be hard to accidentally
feed an x-space ensemble into a latent-space analysis step
once the user builds a LatentETKF).
Attributes:
| Name | Type | Description |
|---|---|---|
latent_map |
Any
|
Object exposing |
dynamics |
AbstractDynamics
|
Latent-space dynamics — either an
:class: |
obs_op |
AbstractObsOperator
|
|
inflator |
AbstractInflator | None
|
Optional deterministic inflator applied in latent space. |
config |
FilterConfig | None
|
Reserved :class: |
Source code in src/filterax/_filters/_models.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | |
assimilate(init_ensemble: Float[Array, 'N_e N_d'], observations: Sequence[tuple[Float[Array, ' N_y'], float | Float[Array, '']]], obs_noise: lx.AbstractLinearOperator, t0: float | Float[Array, ''] = 0.0, *, in_x_space: bool = True) -> LatentAssimilationResult
¶
Run forecast → ETKF analysis → optional inflation in latent space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
init_ensemble
|
Float[Array, 'N_e N_d']
|
Prior ensemble. Shape |
required |
observations
|
Sequence[tuple[Float[Array, ' N_y'], float | Float[Array, '']]]
|
Sequence of |
required |
obs_noise
|
AbstractLinearOperator
|
Observation error covariance |
required |
t0
|
float | Float[Array, '']
|
Starting time for the first forecast window. |
0.0
|
in_x_space
|
bool
|
Encode the initial ensemble first. |
True
|
Returns:
| Type | Description |
|---|---|
LatentAssimilationResult
|
class: |
LatentAssimilationResult
|
latent and decoded |
Source code in src/filterax/_filters/_models.py
LatentLETKF
¶
Bases: Module
Local ETKF in latent space (D17).
Sister of :class:LatentETKF over :class:LETKF. v0.1 implements
option (a) of latent_da.md §9.2 — no localization in latent
space — because the latent dimensions of a typical autoencoder are
global modes without an intrinsic notion of locality.
Pseudo-localization-via-mode-coords (option c) is deferred.
For the no-localization case, this class is provided for API
parity with :class:LatentETKF: it gives users a LatentLETKF
name that they can wire into pipekit alongside LatentETKF
without having to fall back to LatentETKF themselves. The
body is identical to :class:LatentETKF.
Like :class:LatentETKF, dynamics may be either an
:class:AbstractDynamics or a raw structural LatentForwardModel
(.step(z, dt) → z); the latter is auto-wrapped in
:class:LatentDynamics at construction.
Source code in src/filterax/_filters/_models.py
assimilate(init_ensemble: Float[Array, 'N_e N_d'], observations: Sequence[tuple[Float[Array, ' N_y'], float | Float[Array, '']]], obs_noise: lx.AbstractLinearOperator, t0: float | Float[Array, ''] = 0.0, *, in_x_space: bool = True) -> LatentAssimilationResult
¶
Run forecast → ETKF analysis (no localization) → inflation in z-space.
Source code in src/filterax/_filters/_models.py
IdentityLatentMap
¶
Bases: Module
φ = ψ = id regression-test fixture.
Used to verify that the latent filters reduce to their state-space
counterparts when the codec is the identity — pinning the wrapping
layer without depending on a real autoencoder. Carries a single
static dim field so callers can sanity-check shapes.
Source code in src/filterax/_filters/_latent.py
LatentDynamics
¶
Bases: AbstractDynamics
Wrap a structural LatentForwardModel as an AbstractDynamics.
The wrapped object only needs a .step(z, dt) method; nothing
else about its type is constrained (no isinstance check). The
wrapper exists so the latent dynamics can drop into any existing
Layer-2 forecast loop alongside other AbstractDynamics
instances.
Attributes:
| Name | Type | Description |
|---|---|---|
inner |
Any
|
The wrapped latent forward model. |
Source code in src/filterax/_filters/_latent.py
LiftedObs
¶
Bases: AbstractObsOperator
Compose a decoder with an x-space observation operator.
Maps z → y via z ─ψ→ x ─H→ y. Satisfies
:class:AbstractObsOperator, so it slots into ETKF / EnSRF /
LETKF / EnKS without changes — they only ever see the
(N_z, N_y) interface and don't care what's inside.
Attributes:
| Name | Type | Description |
|---|---|---|
decoder |
Any
|
Anything callable as |
inner |
AbstractObsOperator
|
Standard |
Source code in src/filterax/_filters/_latent.py
EncodedDynamics
¶
Bases: AbstractDynamics
Lift an x-space dynamics into z-space via codec round-trip.
For users with an x-space :class:AbstractDynamics (a physics
model or a diffrax ODE wrapper) but no learned M_z. One
ensemble step costs decode → inner → encode. Used as the
dynamics argument to :class:filterax.LatentETKF when no
latent dynamics is available.
Attributes:
| Name | Type | Description |
|---|---|---|
latent_map |
Any
|
|
inner |
AbstractDynamics
|
|
Source code in src/filterax/_filters/_latent.py
latent_ensemble(encoder: Any, x_ensemble: Float[Array, 'N_e N_x']) -> Float[Array, 'N_e N_z']
¶
Encode each ensemble member into latent space.
vmaps the encoder over the ensemble leading axis. The encoder
is anything callable as encoder(x) → z — typically the
.encode method bound off a :class:pipekit_cycle.LatentMap or
a bare encoder eqx.Module.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
encoder
|
Any
|
Callable |
required |
x_ensemble
|
Float[Array, 'N_e N_x']
|
|
required |
Returns:
| Type | Description |
|---|---|
Float[Array, 'N_e N_z']
|
|
Source code in src/filterax/_filters/_latent.py
decode_ensemble(decoder: Any, z_ensemble: Float[Array, 'N_e N_z']) -> Float[Array, 'N_e N_x']
¶
Decode each ensemble member back into state space.
Mirror of :func:latent_ensemble for the decode direction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
decoder
|
Any
|
Callable |
required |
z_ensemble
|
Float[Array, 'N_e N_z']
|
|
required |
Returns:
| Type | Description |
|---|---|
Float[Array, 'N_e N_x']
|
|
Source code in src/filterax/_filters/_latent.py
identity_latent_map(dim: int) -> IdentityLatentMap
¶
Construct an :class:IdentityLatentMap of the given dimension.
The returned object satisfies the structural LatentMap contract
(.encode + .decode) and is the canonical fixture for
regression tests that pin :class:filterax.LatentETKF to plain
:class:filterax.ETKF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dim
|
int
|
Common state / latent dimension. |
required |
Returns:
| Type | Description |
|---|---|
IdentityLatentMap
|
Pass-through latent map. |