cosmicjellyfish.fishermatrix.jaxcosmo_derivatives#
Derivative providers for the JAX-native observables of the jaxcosmo backend.
Two providers implement
cosmicjellyfish.fishermatrix.derivatives.DerivativeProvider:
JaxAutodiffProviderdifferentiates the JAX observable withjax.jacfwd;JaxFiniteDifferenceProviderapplies the same finite-difference engine used by the standard CosmicJellyfish pipeline to the same JAX observable.
Having both is what makes a controlled validation possible: autodiff against finite differences of one implementation isolates the derivative method, while either of them against the legacy NumPy observable isolates the observable implementation.
Usage#
>>> from cosmicjellyfish.fishermatrix.jaxcosmo_derivatives import JaxAutodiffProvider
The providers are stateful on purpose: the JAX observable and its compiled Jacobians are cached
between calls (and are not picklable), so a fresh provider must be created in every worker
process. The probes GCph + WL (photometric) and GCsp (spectroscopic) are supported;
the provider picks the JAX observable from request.observables_type.
Classes
Exact forward-mode derivatives of the JAX observables ( |
|
Finite differences of the JAX observable, using the standard CosmicJellyfish engine. |