EpiAwareADTools
Automatic-differentiation safety machinery for the EpiAware modelling stack.
Why EpiAwareADTools?
EpiAwareADTools is the EpiAware org's shared home for AD-safety machinery and AD workarounds. It is deliberately framed as fixes we host while we try to fix things upstream: every entry is documented with the upstream package or issue where it ideally belongs, and each is deleted once that upstream fix lands.
Two families make up the current surface.
The tape-strip pair
primalandprimal_distributionreduce an AD-wrapped scalar or distribution to its underlying primal, keeping a non-differentiable hyperparameter (an integration window, a clamp location) off the AD path on every backend.The AD-safe evaluation hooks
cdf_ad_safe,logcdf_ad_safe,ccdf_ad_safe,logccdf_ad_safe, andpdf_ad_safeare extension points a wrapper package overloads for its own component types. TheirGammamethods route through an analytic gamma-CDF derivative that stands in for the differentiabilitySpecialFunctions.gamma_incleaves unimplemented.
Per-backend behaviour for ForwardDiff, ReverseDiff, Enzyme, Mooncake, and ChainRulesCore is supplied by package extensions loaded when each backend is present.
Getting started
See the documentation for a full walkthrough.
using EpiAwareADTools, Distributions
# AD-safe Gamma CDF, differentiable in shape/scale on every supported backend.
cdf_ad_safe(Gamma(2.0, 1.0), 3.0)
# Strip an AD wrapper back to its primal value.
primal(3.0)3.0Where to learn more
Want to get started running code? Check out the Getting started documentation.
Want to understand the API? Check out our API reference.
Want to contribute to
EpiAwareADTools? Check the open issues and the Contributing section below.Want to see our code? Check out our GitHub Repository.
Getting help
For usage questions, ask on the Julia Discourse (the SciML or usage categories) or the epinowcast community forum, our home for epidemiological modelling questions. Please use GitHub issues for bug reports and feature requests only.
Contributing
We welcome contributions and new contributors! This package follows ColPrac and the SciML style.
Supporting and citing
If you would like to support EpiAwareADTools, please star the repository — such metrics help secure future funding.
If you use EpiAwareADTools in your work, please cite it:
@software{EpiAwareADTools_jl,
author = {Sam Abbott and EpiAware contributors},
title = {EpiAwareADTools.jl},
year = {2026},
url = {https://github.com/EpiAware/EpiAwareADTools.jl}
}A citable DOI will be added with the first tagged release.
Code of conduct
Please note that the EpiAwareADTools project is released with a Contributor Code of Conduct. By contributing, you agree to abide by its terms.