diff-renewal-network 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diff_renewal_network-1.0.0/LICENSE +21 -0
- diff_renewal_network-1.0.0/PKG-INFO +421 -0
- diff_renewal_network-1.0.0/README.md +375 -0
- diff_renewal_network-1.0.0/pyproject.toml +95 -0
- diff_renewal_network-1.0.0/setup.cfg +4 -0
- diff_renewal_network-1.0.0/src/diff_renewal/__init__.py +211 -0
- diff_renewal_network-1.0.0/src/diff_renewal/__main__.py +6 -0
- diff_renewal_network-1.0.0/src/diff_renewal/api.py +654 -0
- diff_renewal_network-1.0.0/src/diff_renewal/baselines.py +282 -0
- diff_renewal_network-1.0.0/src/diff_renewal/capping.py +107 -0
- diff_renewal_network-1.0.0/src/diff_renewal/cli.py +63 -0
- diff_renewal_network-1.0.0/src/diff_renewal/design.py +129 -0
- diff_renewal_network-1.0.0/src/diff_renewal/diagnostics.py +188 -0
- diff_renewal_network-1.0.0/src/diff_renewal/laplace_solver.py +420 -0
- diff_renewal_network-1.0.0/src/diff_renewal/mean_field.py +256 -0
- diff_renewal_network-1.0.0/src/diff_renewal/memory.py +154 -0
- diff_renewal_network-1.0.0/src/diff_renewal/network.py +107 -0
- diff_renewal_network-1.0.0/src/diff_renewal/neural_clock.py +52 -0
- diff_renewal_network-1.0.0/src/diff_renewal/observations.py +15 -0
- diff_renewal_network-1.0.0/src/diff_renewal/phase_type.py +79 -0
- diff_renewal_network-1.0.0/src/diff_renewal/py.typed +0 -0
- diff_renewal_network-1.0.0/src/diff_renewal/race.py +274 -0
- diff_renewal_network-1.0.0/src/diff_renewal/reduction.py +534 -0
- diff_renewal_network-1.0.0/src/diff_renewal/renewal.py +61 -0
- diff_renewal_network-1.0.0/src/diff_renewal/semi_markov.py +199 -0
- diff_renewal_network-1.0.0/src/diff_renewal/sparse_network.py +161 -0
- diff_renewal_network-1.0.0/src/diff_renewal/traits.py +101 -0
- diff_renewal_network-1.0.0/src/diff_renewal_network.egg-info/PKG-INFO +421 -0
- diff_renewal_network-1.0.0/src/diff_renewal_network.egg-info/SOURCES.txt +41 -0
- diff_renewal_network-1.0.0/src/diff_renewal_network.egg-info/dependency_links.txt +1 -0
- diff_renewal_network-1.0.0/src/diff_renewal_network.egg-info/entry_points.txt +2 -0
- diff_renewal_network-1.0.0/src/diff_renewal_network.egg-info/requires.txt +21 -0
- diff_renewal_network-1.0.0/src/diff_renewal_network.egg-info/top_level.txt +1 -0
- diff_renewal_network-1.0.0/tests/test_fetch_data.py +78 -0
- diff_renewal_network-1.0.0/tests/test_forward_backward_audit.py +226 -0
- diff_renewal_network-1.0.0/tests/test_high_level_api.py +111 -0
- diff_renewal_network-1.0.0/tests/test_laplace_solver.py +228 -0
- diff_renewal_network-1.0.0/tests/test_mean_field_and_sparse.py +93 -0
- diff_renewal_network-1.0.0/tests/test_paper_reproducibility.py +50 -0
- diff_renewal_network-1.0.0/tests/test_phase_type_and_race.py +70 -0
- diff_renewal_network-1.0.0/tests/test_positive_reduction_and_baselines.py +160 -0
- diff_renewal_network-1.0.0/tests/test_reduction_and_theory.py +53 -0
- diff_renewal_network-1.0.0/tests/test_traits_and_design.py +95 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aurélien Pélissier
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: diff-renewal-network
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Differentiable Renewal Networks: exact marked-race compilation, sensitivity-aware positive reduction, stiffness-free Laplace-Schur-Talbot solvers, conditional neural clocks, and Fisher experimental design in JAX/Diffrax.
|
|
5
|
+
Author: Aurélien Pélissier
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/AI-MathPhys/diff-renewal-network
|
|
8
|
+
Project-URL: Repository, https://github.com/AI-MathPhys/diff-renewal-network
|
|
9
|
+
Project-URL: Issues, https://github.com/AI-MathPhys/diff-renewal-network/issues
|
|
10
|
+
Project-URL: Paper, https://github.com/AI-MathPhys/diff-renewal-network/blob/main/manuscript/Diff_Renewal_Network_manuscript.pdf
|
|
11
|
+
Project-URL: Reproducibility, https://github.com/AI-MathPhys/diff-renewal-network/blob/main/REPRODUCIBILITY.md
|
|
12
|
+
Keywords: renewal-processes,semi-markov,phase-type-distributions,non-markovian,differentiable-physics,model-reduction,balanced-truncation,optimal-experimental-design,fisher-information,neural-ode,state-space-models,jax,diffrax
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: jax>=0.4.38
|
|
29
|
+
Requires-Dist: diffrax>=0.7.0
|
|
30
|
+
Requires-Dist: numpy>=1.26
|
|
31
|
+
Requires-Dist: scipy>=1.12
|
|
32
|
+
Provides-Extra: theory
|
|
33
|
+
Requires-Dist: sympy>=1.13; extra == "theory"
|
|
34
|
+
Provides-Extra: experiments
|
|
35
|
+
Requires-Dist: matplotlib>=3.8; extra == "experiments"
|
|
36
|
+
Requires-Dist: pandas>=2.1; extra == "experiments"
|
|
37
|
+
Requires-Dist: requests>=2.28; extra == "experiments"
|
|
38
|
+
Requires-Dist: pymupdf>=1.24; extra == "experiments"
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
41
|
+
Requires-Dist: build>=1.2; extra == "dev"
|
|
42
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
43
|
+
Provides-Extra: all
|
|
44
|
+
Requires-Dist: diff-renewal-network[dev,experiments,theory]; extra == "all"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# Differentiable Renewal Networks (`diff-renewal-network`)
|
|
48
|
+
|
|
49
|
+
[](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/LICENSE)
|
|
50
|
+
[](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/pyproject.toml)
|
|
51
|
+
[](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/pyproject.toml)
|
|
52
|
+
[](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/manuscript/Diff_Renewal_Network_manuscript.pdf)
|
|
53
|
+
|
|
54
|
+
Standalone Python library (`diff-renewal-network`, imported as `diff_renewal`) built on public **JAX**, **Diffrax**, **NumPy**, and **SciPy**, together with the complete paper experimental suite (`experiments/`, 34 scripts), 46 SHA-256-verified benchmark archives (`results/`), publication figures (`figures/`, 5 main + 10 supplementary), and 17 LaTeX tables (`output/tables/`) accompanying:
|
|
55
|
+
|
|
56
|
+
> **Differentiable renewal networks: when predictive minimality fails parameter learning**
|
|
57
|
+
> Aurélien Pélissier · [Manuscript PDF (53 pp.)](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/manuscript/Diff_Renewal_Network_manuscript.pdf) · [Reproducibility Map](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/REPRODUCIBILITY.md) · [Dataset Licenses](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/DATA_LICENSES.md)
|
|
58
|
+
|
|
59
|
+
Learning non-Markovian dynamics from population snapshots requires encoding elapsed residence-time memory inside a differentiable forward model, yet states that suffice for trajectory prediction can distort parameter gradients. **Differentiable Renewal Networks (DRNs)** turn structured non-Markovian networks into end-to-end differentiable, probability-conserving master equations—while establishing exact separation laws between predictive minimality and sensitivity preservation, resolving the gap with positive sensitivity-aware compression, scaling via marked-race and Laplace–Schur–Talbot solvers, and generalizing zero-shot to unseen elapsed residence ages and mid-visit interventions.
|
|
60
|
+
|
|
61
|
+
<p align="center">
|
|
62
|
+
<img src="https://raw.githubusercontent.com/AI-MathPhys/diff-renewal-network/main/figures/Figure_1_DRN.png" width="94%" alt="Figure 1: Differentiable renewal networks separate prediction from parameter learning"/>
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
*Figure 1 — Differentiable renewal networks separate prediction from parameter learning. Elapsed residence time shifts future exit probabilities within the same observable state (**a**–**c**). On a symmetric 3-state cycle with identical Erlang-16 clocks (**d**), 15 shared phase modes cancel identically from every observable occupation trajectory (48 → 33 predictive states, error < 10<sup>−12</sup>), yet perturbing a single clock restores all 15 canceled poles in the physical sensitivity transfer (**e**–**f**).*
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Key Results & Manuscript Overview
|
|
70
|
+
|
|
71
|
+
1. **Prediction Is Not Learning (Fig. 1; Supplementary Theorems 1–3, 6 & Corollary 1):**
|
|
72
|
+
- For an irreducible renewal network with duration-independent routing, reduced survival numerators <i>N<sub>i</sub></i>(<i>s</i>), and minimal clock orders <i>n<sub>i</sub></i>, the minimal predictive occupation dimension is <i>d</i><sub>occ</sub> = ∑ <i>n<sub>i</sub></i> − deg gcd(<i>N</i><sub>1</sub>, …, <i>N<sub>V</sub></i>), whereas the minimal sensitivity-preserving dimension is <i>d</i><sub>sens</sub> = ∑ <i>n<sub>i</sub></i>.
|
|
73
|
+
- Near exact cancellation at parameter displacement δ, balanced truncation yields vanishing <i>O</i>(δ) forward error alongside a non-vanishing Ω(1) sensitivity error, so the sensitivity-to-forward distortion ratio diverges at least as δ<sup>−1</sup>. The same obstruction hits modal pruning in diagonal S4D state-space models, stalling Adam at MSE `0.021` vs. `6.1 × 10⁻¹⁴` unpruned.
|
|
74
|
+
|
|
75
|
+
2. **Sensitivity-Aware Positive Model Compression (Fig. 2; Supplementary Theorems 4–5):**
|
|
76
|
+
- **Pos-Sens** and **Hyper-Pos-Sens** approximate each waiting-time law with a smaller strictly Metzler positive Coxian chain calibrated jointly against the survival function and its parameter derivatives while preserving the mean residence time.
|
|
77
|
+
- Across **400 paired snapshot datasets** (10,000 cells each), trajectory-exact symmetry reduction exceeds 14% median relative shape error at heterogeneity ε = 0.15, and signed sensitivity-interpolating reductions produce negative early-time probabilities in **400/400** fits. At the same 33-state dimension, **Pos-Sens** maintains valid probabilities in **400/400** fits (`0/400` negativity), cuts maximum shape-Jacobian defect by **6.3×** vs. Signed 33 and **9.1×** vs. Symmetry 33 at ε = 0.25, matches the full 48-state accuracy for ε ≤ 0.15, and reduces median fit time (`69.5 ms` vs. `89.5 ms`).
|
|
78
|
+
|
|
79
|
+
<p align="center">
|
|
80
|
+
<img src="https://raw.githubusercontent.com/AI-MathPhys/diff-renewal-network/main/figures/Figure_2_sensitivity_aware_compression.png" width="88%" alt="Figure 2: Sensitivity-aware compression supports reliable parameter learning"/>
|
|
81
|
+
</p>
|
|
82
|
+
|
|
83
|
+
*Figure 2 — Near-cancellation balanced-truncation obstruction (**a**), S4D modal pruning failure (**b**), positive sensitivity-aware Coxian clock calibration (**c**), network-level Jacobian fidelity (**d**), paired parameter recovery under phase-type and misspecified Gamma ground truth (**e**, **f**), and fit latency / probability validity across all 400 datasets (**g**).*
|
|
84
|
+
|
|
85
|
+
3. **Scalable Inference & Fisher Experimental Design (Fig. 3; Supplementary Propositions 1–2, 4–5 & Theorem 7):**
|
|
86
|
+
- **Exact marked-race compilation** eliminates Cartesian explosion for <i>d</i> competing <i>K</i>-stage mixed-Erlang clocks: <i>K</i><sup><i>d</i></sup> → 1 + <i>d</i>(<i>K</i> − 1) (up to **1,074×** local state reduction; relative gradient error < 4 × 10<sup>−8</sup>), with multi-rate Hyper-Erlang extensions for bursty dynamics.
|
|
87
|
+
- **Matrix-free `SparseDRN`** scales exact reverse-mode Diffrax gradients to *V* = 1,024 states (4,096 learnable parameters) in **~0.45 s/grad** on CPU with **<1 MB** operator storage (`0.97 MB`, `644 MB` peak autodiff RSS).
|
|
88
|
+
- **Stiffness-free `Talbot-DRN`** (`laplace_solver.py`) inverts the observable-space Laplace resolvent along a Weideman–Trefethen contour (`4.06 × 10⁻¹⁰` error at 10<sup>5</sup>× stiffness; `29,493×` faster than explicit `Tsit5` at *V* = 64 stiff; **`38.4 ms/grad`** median benchmark on real *V* = 98 MOOC vs. `789.5 ms` dense `expm`).
|
|
89
|
+
- **Two-preparation identifiability & Fisher allocation** recover Gamma parameters on **59/60** benchmarks at **19.3×** cold speedup over NoMaSS, achieve **15/15** joint recovery for 16–48 unknown parameters (vs. **0/15** Monte Carlo search), and extrapolate human bone-marrow hematopoiesis (Days 1–5 → Day 7, 7 lineages, 10 donors) to **0.0082 nats** pooled KL (vs. `0.0413` Markov, `0.036–0.115` neural).
|
|
90
|
+
|
|
91
|
+
<p align="center">
|
|
92
|
+
<img src="https://raw.githubusercontent.com/AI-MathPhys/diff-renewal-network/main/figures/Fig3_scalable_inference.png" width="94%" alt="Figure 3: Sensitivity-preserving representations enable scalable inference from population observations"/>
|
|
93
|
+
</p>
|
|
94
|
+
|
|
95
|
+
*Figure 3 — Gradient scaling of tensor, compiled marked-race, and matrix-free sparse solvers (**a**), paired Fisher-guided shape recovery vs. NoMaSS (**b**), high-dimensional parameter recovery (**c**), and human bone-marrow hematopoiesis Day-7 extrapolation (**d**–**f**).*
|
|
96
|
+
|
|
97
|
+
4. **Conditional Neural Clocks & Transfer Beyond Training Conditions (Fig. 4):**
|
|
98
|
+
- Analytical survivor conditioning, Pr(τ > <i>a</i> + <i>t</i> | τ > <i>a</i>) = <i>S</i>(<i>a</i> + <i>t</i>) / <i>S</i>(<i>a</i>), enables models trained exclusively on fresh cohorts (<i>a</i> = 0) to forecast previously unseen aged cohorts zero-shot.
|
|
99
|
+
- **Conditional neural renewal clocks** map state, traits, and time-varying exposure to flexible phase-type waiting-time laws. On moment-matched clocks (identical mean and variance, distinct early-exit shapes), conditional DRNs reach **0.00197 nats** median excess KL (vs. `0.01095` moment-matched PH and `0.0523–0.1285` across Mamba, LTC, S4D, Latent ODE, and Neural-CME), lower mid-visit pulse RMSE to **1.54 pp** (vs. `7.45–9.75 pp`), and adapt to unseen networks via just **4 coefficients** (`0.00844` nats at 400 target cells; `0.00166` nats at 8,000 cells).
|
|
100
|
+
|
|
101
|
+
<p align="center">
|
|
102
|
+
<img src="https://raw.githubusercontent.com/AI-MathPhys/diff-renewal-network/main/figures/Fig4_neural_renewal_transfer.png" width="92%" alt="Figure 4: Explicit renewal structure enables transferable neural dynamics"/>
|
|
103
|
+
</p>
|
|
104
|
+
|
|
105
|
+
*Figure 4 — Moment-matched clocks (**a**), conditional neural clock & analytical age conditioning (**b**), balanced excess KL under phase-type and lognormal-mixture truth (**c**), mid-visit exposure pulse prediction (**d**, **e**), and 4-coefficient few-shot adaptation (**f**).*
|
|
106
|
+
|
|
107
|
+
5. **Temporal Memory Across Real-World Systems & Neural Complementarity (Fig. 5 & Table 1; Supplementary Proposition 3):**
|
|
108
|
+
- Zero-shot aged-cohort generalization outperforms fresh-only and elapsed-age warm-started neural baselines on MOOC (`0.2024` vs. `1.3743` 2L-Mamba, **6.8×**; `1.14–1.78` warm-started), IT Helpdesk (`0.0397` vs. `0.2428` LTC, **6.1×**; `0.052–0.083` warm-started), Sleep-EDF (`0.0622` vs. `0.0844`), and *E. coli* cycles (`0.0569` vs. `0.4106`).
|
|
109
|
+
- Nonlinear occupancy-dependent `MeanFieldDRN` forecasts the 1978 influenza decline (Days 9–14) at **0.0168 nats** KL (vs. `0.0573` Markov, `0.0393` Neural-CME). Multi-visit persistence tests distinguish persistent latent clock speeds (N2 sleep, Si et al. *E. coli*) from near-renewal cycles (Tanouchi et al. *E. coli*).
|
|
110
|
+
- **Honest regimes where neural sequence models lead:** near-Markovian StackOverflow badges (`0.0658` zero-shot / `0.0527` joint for 1L-Mamba), jointly supervised Helpdesk (`0.0056`), and longer-horizon DeFi panels (`30–120 min`) driven by external volatility—yet replacing a 2L-Mamba output head with an analytical 4-component renewal clock improves deep-age (`>60 min`) cross-chain transfer (BSC → Base NLL **`0.0570`** vs. `0.0652`).
|
|
111
|
+
|
|
112
|
+
<p align="center">
|
|
113
|
+
<img src="https://raw.githubusercontent.com/AI-MathPhys/diff-renewal-network/main/figures/Fig5_real_world_memory.png" width="92%" alt="Figure 5: Temporal memory improves generalization when residence time is informative"/>
|
|
114
|
+
</p>
|
|
115
|
+
|
|
116
|
+
*Figure 5 — Zero-shot vs. jointly supervised aged-cohort KL with elapsed-age neural warm starts (**a**), MOOC entry-anchored panel coarsening (**b**), cross-visit persistence test (**c**), 1978 influenza forecast (**d**), multi-horizon DeFi NLL differences (**e**), and matched-encoder Mamba + renewal head vs. sigmoid head cross-chain transfer (**f**).*
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Cross-Domain Benchmark Summary (Table 1)
|
|
121
|
+
|
|
122
|
+
Lower is better (`KL` in nats, except DeFi binary event `NLL` / log-loss). Verified verbatim against `results/claim_ledger.json` by `python -m experiments.run_suite --group reproduce`:
|
|
123
|
+
|
|
124
|
+
| Domain (Task) | Metric | Full DRN | Univ. Pos-Sens | CTMC | Best Neural (age=0) | Warm-Start Best | Ratio vs. Neural |
|
|
125
|
+
| :--- | :--- | ---: | ---: | ---: | ---: | ---: | ---: |
|
|
126
|
+
| **MOOC** (*V* = 98, 0-shot ≥6h) | KL | **0.2024** | 0.2690 | 1.8756 | 1.3743 (`2L-Mamba`) | 1.1419 (`2L-Mamba`) | **6.8×** |
|
|
127
|
+
| **MOOC** (Joint / 24h entry-anch.) | KL | **0.1489** (**0.3897**) | 0.1518 (0.4673) | 0.6467 (1.0851) | 0.1515 (`2L-Mamba`) / 0.4661 (`1-Hawkes`) | — | **1.02× / 1.20×** |
|
|
128
|
+
| **DeFi** (BSC→Base / Δ*t* = 10m) | NLL | **0.3134** (**0.4325**) | — | 0.3592 (0.4512) | 0.3194 (`2L-Mamba`) / 0.4342 (`2L-Mamba`) | — | **#1 / #1** |
|
|
129
|
+
| **DeFi Hybrid** (BSC→Base, >60m) | NLL | **0.0570** (`2L-Mamba+M4`) | — | — | 0.0652 (`2L-Mamba Sigmoid`) | — | **−0.0082 nats** |
|
|
130
|
+
| **IT Helpdesk** (*V* = 5, 0-shot ≥7d) | KL | **0.0397** ± .004 | 0.0468 ± .003 | 0.1556 | 0.2428 (`LTC`) | 0.0522 (`LTC`) | **6.1×** |
|
|
131
|
+
| **IT Helpdesk** (Chrono / Δ*t* = 14d) | KL | **0.1341** (0.0686) | 0.1896 (**0.0434**) | 0.3381 (0.1904) | 0.5807 (`Latent ODE`) / 0.2507 (`LTC`) | — | **4.3× / 5.8×** |
|
|
132
|
+
| **1978 Influenza** (Days 9–14 extrap.) | KL | **0.0168** | — | 0.0573 | 0.0393 (`Neural-CME`) | — | **2.3×** |
|
|
133
|
+
| **Hematopoiesis** (Pooled / Donor D7) | KL | **0.0082** (0.1480) | 0.0102 (0.1506) | 0.0413 (0.1923) | 0.0362 (`LTC`) / **0.1434** (`Latent ODE`) | — | **4.4×** / 0.97× |
|
|
134
|
+
| **Sleep-EDF** (*V* = 5, 0-shot ≥5m) | KL | **0.0622** ± .013 | 0.0875 ± .017 | 0.1111 | 0.0844 (`Neural-CME`) | 0.1115 (`Neural-CME`) | **1.36×** |
|
|
135
|
+
| ***E. coli* Cycle** (*V* = 3, 0-shot) | KL | **0.0569** ± .003 | — | 0.3247 | 0.4106 (`S4D`) | — | **7.2×** |
|
|
136
|
+
| **StackOverflow** (*V* = 22, 0-sh. / Jnt.) | KL | 0.1319 (0.0669) | 0.1531 (0.0691) | 0.0802 (0.0706) | **0.0658** (**0.0527**, `1L-Mamba`) | — | 0.50× |
|
|
137
|
+
|
|
138
|
+
*(On jointly supervised Helpdesk, `Mamba` attains the lowest KL at `0.0056` nats; on StackOverflow zero-shot, `ME-G1` attains `0.0815` vs. `0.1319` for `Frailty-DRN`.)*
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Installation (`pip` Package)
|
|
143
|
+
|
|
144
|
+
Requires **Python 3.10+**. Core runtime dependencies are **JAX**, **Diffrax**, **NumPy**, and **SciPy**.
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Install from PyPI:
|
|
148
|
+
pip install diff-renewal-network
|
|
149
|
+
|
|
150
|
+
# Or install directly from GitHub:
|
|
151
|
+
pip install "git+https://github.com/AI-MathPhys/diff-renewal-network.git"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Optional dependency extras:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
pip install "diff-renewal-network[theory]" # SymPy for symbolic proof verification
|
|
158
|
+
pip install "diff-renewal-network[experiments]" # matplotlib, pandas, requests, PyMuPDF
|
|
159
|
+
pip install "diff-renewal-network[dev]" # pytest, build, twine
|
|
160
|
+
pip install "diff-renewal-network[all]" # all extras
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Editable Install for Development & Paper Reproduction
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
git clone https://github.com/AI-MathPhys/diff-renewal-network.git
|
|
167
|
+
cd diff-renewal-network
|
|
168
|
+
python -m venv .venv && source .venv/bin/activate
|
|
169
|
+
python -m pip install -e ".[all]"
|
|
170
|
+
|
|
171
|
+
# Verify installation and run the fast (<2 s) numerical self-check
|
|
172
|
+
drn-info --check
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> **Precision tip:** Enable 64-bit JAX floats (`jax.config.update("jax_enable_x64", True)`) before running high-accuracy ODE solves, Laplace–Talbot contour inversions, or sensitivity evaluations.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Python Library Quickstart (`diff_renewal`)
|
|
180
|
+
|
|
181
|
+
### 1. Build, Simulate, Differentiate, Fit & Design Experiments (`RenewalNetwork`)
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
import jax
|
|
185
|
+
jax.config.update("jax_enable_x64", True)
|
|
186
|
+
import numpy as np
|
|
187
|
+
from diff_renewal import RenewalNetwork
|
|
188
|
+
|
|
189
|
+
# 4-node branching diamond: 0 -> {1, 2} -> 3 (sink)
|
|
190
|
+
net = RenewalNetwork(
|
|
191
|
+
n_nodes=4,
|
|
192
|
+
edges=[(0, 1), (0, 2), (1, 3), (2, 3)],
|
|
193
|
+
stages=12,
|
|
194
|
+
node_names=("Stem", "LineageA", "LineageB", "Mature"),
|
|
195
|
+
)
|
|
196
|
+
print(f"States: {net.tensor_state_size} (tensor) -> {net.compact_state_size} (marked race, {net.compression_ratio:.2f}x smaller)")
|
|
197
|
+
|
|
198
|
+
# Forward prediction across two initial preparations
|
|
199
|
+
true_means = np.array([1.8, 2.4, 1.5, 2.1])
|
|
200
|
+
true_shapes = np.array([4.5, 6.0, 4.0, 5.5])
|
|
201
|
+
preps = np.array([[1.0, 0.0, 0.0, 0.0], [0.0, 0.5, 0.5, 0.0]])
|
|
202
|
+
ts = np.linspace(0.5, 5.0, 10)
|
|
203
|
+
|
|
204
|
+
probs = np.asarray(net.predict(true_means, true_shapes, preps, ts))
|
|
205
|
+
probs_0, jac = net.jacobian(true_means, true_shapes, preps[0], ts) # exact (T, V, 2E) Jacobian
|
|
206
|
+
|
|
207
|
+
# Fit (means, shapes) directly from noisy multinomial snapshot counts via L-BFGS-B
|
|
208
|
+
rng = np.random.default_rng(42)
|
|
209
|
+
counts = np.stack([[rng.multinomial(2000, p / p.sum()) for p in row] for row in probs])
|
|
210
|
+
fit = net.fit(preps, ts, counts, maxiter=120)
|
|
211
|
+
print("Recovered means :", np.round(fit.means, 3))
|
|
212
|
+
print("Recovered shapes:", np.round(fit.shapes, 3))
|
|
213
|
+
|
|
214
|
+
# Scenario-robust A-optimal Fisher observation design targeting clock shapes
|
|
215
|
+
design = net.optimal_design(fit.means, fit.shapes, preps, ts, budget=4000, interest="shapes")
|
|
216
|
+
print(f"A-optimal trace: {design['initial_criterion']:.4f} -> {design['criterion']:.4f}")
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### 2. Prediction-vs-Learning Separation & Positive Compression
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
from diff_renewal import calibrate_clock_compressor, sensitivity_separation_demo
|
|
223
|
+
|
|
224
|
+
rep = sensitivity_separation_demo(n_nodes=3, stages=16, mean=2.0)
|
|
225
|
+
print(f"{rep.full_states} -> {rep.reduced_states} states ({rep.canceled_modes} canceled poles)")
|
|
226
|
+
print(f"Max occupation error : {rep.max_occupation_error:.2e}") # 1.43e-14
|
|
227
|
+
print(f"Max rate sensitivity defect: {rep.max_rate_sensitivity_defect:.4f}") # 0.2620
|
|
228
|
+
|
|
229
|
+
comp = calibrate_clock_compressor(stages_red=8, stages_full=16, k_min=1.4, k_max=7.8)
|
|
230
|
+
stage_rates, entry = comp.clock(mean=2.0, shape=6.0) # strictly positive Metzler Coxian chain
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### 3. Stiffness-Free Fresh & Zero-Shot Aged Rollout (`TalbotRenewalNetwork`)
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
import jax.numpy as jnp
|
|
237
|
+
from diff_renewal import TalbotRenewalNetwork
|
|
238
|
+
|
|
239
|
+
routing = np.array([
|
|
240
|
+
[0.0, 0.0, 1.0],
|
|
241
|
+
[1.0, 0.0, 0.0],
|
|
242
|
+
[0.0, 1.0, 0.0],
|
|
243
|
+
])
|
|
244
|
+
solver = TalbotRenewalNetwork(routing, n_talbot=16)
|
|
245
|
+
|
|
246
|
+
# Simultaneous fresh (age = 0) and aged (age = 2.0) forecasts at 10,000x stiffness
|
|
247
|
+
p_fresh, p_aged = solver.predict(
|
|
248
|
+
fast_rates=jnp.array([1000.0, 1200.0, 900.0]),
|
|
249
|
+
slow_rates=jnp.array([0.12, 0.10, 0.15]),
|
|
250
|
+
fast_weights=jnp.array([0.35, 0.25, 0.40]),
|
|
251
|
+
slow_entry=jnp.tile(jnp.array([0.7, 0.2, 0.1, 0.0]), (3, 1)),
|
|
252
|
+
horizons=[0.5, 2.0, 5.0],
|
|
253
|
+
age=2.0,
|
|
254
|
+
return_both_fresh_and_aged=True,
|
|
255
|
+
)
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Runnable example scripts in [`examples/`](https://github.com/AI-MathPhys/diff-renewal-network/tree/main/examples):
|
|
259
|
+
- [`examples/quickstart_drn.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/examples/quickstart_drn.py) — End-to-end `RenewalNetwork` simulation, Jacobian, L-BFGS-B fitting, and A-optimal Fisher design.
|
|
260
|
+
- [`examples/sensitivity_separation_demo.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/examples/sensitivity_separation_demo.py) — Exact 48-vs-33 Erlang-16 separation + universal `Pos-Sens` calibration.
|
|
261
|
+
- [`examples/talbot_stiff_network_demo.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/examples/talbot_stiff_network_demo.py) — Stiff (10,000×) Hyper-Erlang network with simultaneous fresh & aged forecasts and reverse-mode autodiff.
|
|
262
|
+
- [`examples/minimal_renewal_network.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/examples/minimal_renewal_network.py) — Low-level comparison of `solve_renewal_network` vs. `solve_compact_renewal_network`.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Library Architecture (`src/diff_renewal/`)
|
|
267
|
+
|
|
268
|
+
| Module | Paper Result / Scope | Key Public Exports |
|
|
269
|
+
| :--- | :--- | :--- |
|
|
270
|
+
| [`api.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/api.py) | High-level ergonomic API | `RenewalNetwork`, `TalbotRenewalNetwork`, `FitResult`, `ClockCompressor`, `SensitivitySeparationReport`, `calibrate_clock_compressor`, `sensitivity_separation_demo` |
|
|
271
|
+
| [`phase_type.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/phase_type.py) | Mixed-Erlang & Coxian clocks | `erlang_generator`, `coxian_generator`, `smooth_erlang_logits`, `mixed_erlang_components`, `mixed_erlang_moments`, `phase_type_dynamics` |
|
|
272
|
+
| [`renewal.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/renewal.py) | Sequential chain solver | `solve_erlang_chain` |
|
|
273
|
+
| [`race.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/race.py) | Propositions 1 & 2 | `mixed_erlang_race`, `hyper_erlang_race`, `compact_network_state_size`, `hyper_race_state_size`, `solve_compact_renewal_network` |
|
|
274
|
+
| [`network.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/network.py) | Reference <i>K</i><sup><i>d</i></sup> tensor solver | `network_layout`, `network_state_size`, `solve_renewal_network` |
|
|
275
|
+
| [`sparse_network.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/sparse_network.py) | Matrix-free <i>O</i>(<i>V</i> + <i>KE</i>) `SparseDRN` | `compile_sparse_regular_network`, `apply_sparse_generator`, `solve_sparse_renewal_network` |
|
|
276
|
+
| [`laplace_solver.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/laplace_solver.py) | Proposition 5 (`Talbot-DRN` & `Frailty-DRN`) | `weideman_talbot_contour`, `hyper_erlang_aged_phases_and_log_surv`, `solve_renewal_talbot`, `solve_frailty_renewal_talbot`, `solve_coxian_hyper_talbot`, `laplace_schur_implicit_solve` |
|
|
277
|
+
| [`mean_field.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/mean_field.py) | Proposition 4 (`MeanFieldDRN`) | `solve_mean_field_renewal`, `seicr_mean_field_predict`, `simulate_interacting_seicr_gillespie` |
|
|
278
|
+
| [`semi_markov.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/semi_markov.py) | Incoming-edge lifted DRN | `build_edge_memory_hyper_generator`, `edge_memory_param_size`, `init_edge_memory_params` |
|
|
279
|
+
| [`reduction.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/reduction.py) | Theorems 1–6 (`Pos-Sens` / `Hyper-Pos-Sens`) | `cycle_symmetry_matrices`, `make_cycle_engine`, `build_interpolatory_basis`, `make_interpolatory_engine`, `calibrate_positive_33_surrogate`, `make_positive_33_engine`, `calibrate_universal_pos_clock`, `universal_pos_clock`, `build_universal_pos_network_generator`, `build_universal_hyper_pos_network_generator`, `resolvent_sensitivity_diagnostic` |
|
|
280
|
+
| [`neural_clock.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/neural_clock.py) | Conditional Neural Clocks | `ClockNetwork`, `init_clock_network`, `neural_clock`, `survivor_phases` |
|
|
281
|
+
| [`traits.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/traits.py) | Trait regressions & shape JVP | `trait_mean_shape`, `endpoint_coefficients`, `moment_matched_logits`, `trait_network_probabilities` |
|
|
282
|
+
| [`design.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/design.py) | Fisher experimental design | `a_optimal_value_gradient`, `optimize_fisher_allocation`, `largest_remainder` |
|
|
283
|
+
| [`diagnostics.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/diagnostics.py) | Fisher & adjoint accounting | `multinomial_score_design`, `coarsened_fisher`, `efficient_fisher`, `adjoint_residual_estimate`, `adjoint_sensitivity_residual` |
|
|
284
|
+
| [`memory.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/memory.py) | Proposition 3 (SOE memory) | `MemoryCutoff`, `fit_positive_soe`, `fixed_partition_cutoff`, `static_preserving_cutoff`, `solve_memory` |
|
|
285
|
+
| [`capping.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/capping.py) | Phase-capping bounds | `cap_mixed_erlang`, `capped_network_tv_bound`, `capped_clock_bank_gradient_bound` |
|
|
286
|
+
| [`observations.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/observations.py) | Snapshot likelihood | `multinomial_nll` |
|
|
287
|
+
| [`baselines.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/baselines.py) | Neural ODE/SSM baselines | `init_population_baseline`, `predict_population_baseline`, `make_baseline_engine` (`latent_ode`, `ltc_ode`, `s4d_ode`, `neural_cme`, `mamba_ode`) |
|
|
288
|
+
| [`cli.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/src/diff_renewal/cli.py) | Diagnostic CLI | `drn-info [--check]` / `python -m diff_renewal [--check]` |
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Reproducing Paper Experiments & Assets (`experiments/`)
|
|
293
|
+
|
|
294
|
+
All 34 scripts in [`experiments/`](https://github.com/AI-MathPhys/diff-renewal-network/tree/main/experiments) build directly on `diff_renewal`. Use the unified dispatcher `experiments/run_suite.py`:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# List every group and script
|
|
298
|
+
python -m experiments.run_suite --list
|
|
299
|
+
|
|
300
|
+
# Fast (<3 s): verify all 46 SHA-256 archived JSONs + deterministic replays -> results/claim_ledger.json
|
|
301
|
+
python -m experiments.run_suite --group reproduce
|
|
302
|
+
|
|
303
|
+
# Independent symbolic (SymPy) + float64 proof suite (Theorems 1–7, Propositions 1–5, Corollary 1)
|
|
304
|
+
python -m experiments.run_suite --group verify
|
|
305
|
+
|
|
306
|
+
# Rebuild all 17 LaTeX tables (output/tables/) and diagnostic figure panels (output/figures/)
|
|
307
|
+
python -m experiments.run_suite --group figures
|
|
308
|
+
|
|
309
|
+
# Run any topic group
|
|
310
|
+
python -m experiments.run_suite --group theory # BT near-cancellation, real BT failure, Talbot & S4D pruning
|
|
311
|
+
python -m experiments.run_suite --group compression # 400-dataset cyclic Pos-Sens 33 benchmark
|
|
312
|
+
python -m experiments.run_suite --group scaling # Marked-race & SparseDRN scaling (up to V = 1,024)
|
|
313
|
+
python -m experiments.run_suite --group neural # Multi-start Latent ODE, LTC, S4D, Neural-CME, Mamba, THP
|
|
314
|
+
python -m experiments.run_suite --group biology # Hematopoiesis FACS, Sleep-EDF, E. coli, 1978 Influenza
|
|
315
|
+
python -m experiments.run_suite --group systems # IT Helpdesk, MOOC (V = 98), StackOverflow (V = 22), warm-starts
|
|
316
|
+
python -m experiments.run_suite --group defi # 183,881-window multi-pool DeFi & 2L-Mamba+M4 hybrid
|
|
317
|
+
python -m experiments.run_suite --group audits # Cross-domain uniformity & baseline controls
|
|
318
|
+
|
|
319
|
+
# Run the full pytest test suite (10 test modules, 31 tests)
|
|
320
|
+
pytest -q
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
See [`REPRODUCIBILITY.md`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/REPRODUCIBILITY.md) for the complete claim-by-claim, figure-by-figure (Figs. 1–5 & S1–S10), and table-by-table mapping to scripts and SHA-256 archives.
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Public Empirical Datasets & Data-Download Script
|
|
328
|
+
|
|
329
|
+
Raw third-party datasets are **not** bundled or redistributed in this MIT-licensed repository because they remain governed by their respective upstream licenses and terms of use. Full license terms, attribution requirements, and restrictions are documented in **[`DATA_LICENSES.md`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/DATA_LICENSES.md)** and checked by **[`experiments/fetch_data.py`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/experiments/fetch_data.py)**:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Inspect all 12 datasets, sizes, access tiers, and upstream licenses
|
|
333
|
+
python -m experiments.fetch_data --list
|
|
334
|
+
python -m experiments.fetch_data --licenses
|
|
335
|
+
|
|
336
|
+
# Download ONLY permissively licensed datasets (CC0 / CC BY / Apache-2.0 / ODC-By 1.0)
|
|
337
|
+
python -m experiments.fetch_data --all-auto --only-permissive --accept-licenses
|
|
338
|
+
|
|
339
|
+
# Download all 7 automatically fetchable datasets (explicitly acknowledging upstream terms)
|
|
340
|
+
python -m experiments.fetch_data --all-auto --accept-licenses
|
|
341
|
+
|
|
342
|
+
# Wire every experiment script to data_cache/
|
|
343
|
+
eval "$(python -m experiments.fetch_data --env)"
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
> **Note on PhysioNet & restricted datasets:** Both PhysioNet datasets (`sleep-edfx` v1.0.0 and `bidsleep-dataset` v1.0.1) are **Open Access** (no credentialed DUA required) under **ODC-By 1.0** (attribution required; only small sleep-stage annotation files are fetched, never multi-GB raw PSG waveforms). By contrast, **Hematopoiesis FACS** (Bast et al., 2021) carries **CC BY-NC-ND 4.0** (no `LICENSE` file in its GitHub repo), ***E. coli* Si et al. (2019)** carries the non-commercial **Elsevier Open-Access User License v1.0** (manual download only), **IT Helpdesk** carries the fallback **4TU General Terms of Use**, and **MOOC** carries no explicit open license. `experiments/fetch_data.py` refuses to download any external dataset without `--accept-licenses`.
|
|
347
|
+
|
|
348
|
+
- **MOOC Student Interaction Network (*V* = 98):** 7,047 students, 411,749 interactions, 1,355 sparse edges (Kumar et al., *KDD*, 2019) — *no explicit license specified (academic/research release)*.
|
|
349
|
+
- **StackOverflow Badge Awards (*V* = 22):** 2,203 users, 142,777 badge events, official EasyTPP splits (Mei & Eisner, *NeurIPS*, 2017) — *Apache-2.0 packaging; underlying Stack Exchange dump CC BY-SA*.
|
|
350
|
+
- **Multi-Chain DeFi Quiet-Pool Panels (BSC & Base, Jan–Jul 2025):** 16 panels across 35 pools, 183,881 windows (`164,376` test windows), SHA-256 pinned in `results/archived/r7_defi_neural_clock.json` — *public EVM logs + Binance reference prices (subject to Binance Terms)*.
|
|
351
|
+
- **IT Helpdesk Event Log (*V* = 5):** 4,576 tickets, MD5 `a91d74377c55be5cbdfda05dae69db30` (Polato, 4TU.ResearchData, 2017; DOI `10.4121/uuid:0c60edf1-6f83-4e75-9367-4c63b3e9d5bb`) — *4TU General Terms of Use*.
|
|
352
|
+
- **1978 English Boarding School Influenza Outbreak:** Daily prevalence counts, *N* = 763 boys over 14 days (Anonymous, *BMJ*, 1978) — *built-in factual historical count table*.
|
|
353
|
+
- **Human Hematopoiesis FACS (*V* = 7):** 78 samples across 10 bone-marrow donors over Days 1–7 (Bast et al., *iScience*, 2021) — *CC BY-NC-ND 4.0 article; no repo LICENSE (non-commercial)*.
|
|
354
|
+
- **Mouse Embryonic Stem-Cell Differentiation (`ESC → EPI → NPC`):** R1 cell line (Stumpf et al., *Cell Systems*, 2017; Pélissier et al., *Briefings in Bioinformatics*, 2026) — *CC BY 4.0 (built-in pilot proportions)*.
|
|
355
|
+
- ***E. coli* Mother-Machine Lineages:** Tanouchi et al. (*Scientific Data*, 2017; 18,972 cycles; *CC0 1.0*) and Si et al. (*Current Biology*, 2019; 9,449 cycles; *Elsevier OA User License v1.0, manual download*).
|
|
356
|
+
- **Human Multi-Night Sleep Staging:** Sleep-EDF Expanded v1.0.0 (Kemp et al., *IEEE TBME*, 2000; 75 subjects; *PhysioNet Open Access, ODC-By 1.0*), BIDSleep v1.0.1 (Song et al., *IEEE TBME*, 2026; 253 nights; *PhysioNet Open Access, ODC-By 1.0*), and Ying et al. (*Scientific Data*, 2025; 58 recordings; *OSF `gx36m` data CC0 1.0, article CC BY-NC-ND 4.0*).
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## Building & Publishing the `pip` Package
|
|
361
|
+
|
|
362
|
+
The repository uses PEP 621 metadata (`pyproject.toml`), dynamic versioning (`diff_renewal.__version__`), and PEP 561 typing (`py.typed`). The built wheel contains **only** `src/diff_renewal/` (~64 KB); `experiments/`, `results/`, `figures/`, and `manuscript/` stay outside the installed wheel.
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
# Build sdist (.tar.gz) and universal wheel (.whl) and validate metadata
|
|
366
|
+
python -m build
|
|
367
|
+
python -m twine check --strict dist/*
|
|
368
|
+
|
|
369
|
+
# Upload to PyPI (or TestPyPI with --repository testpypi)
|
|
370
|
+
python -m twine upload dist/*
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Repository Structure
|
|
376
|
+
|
|
377
|
+
```text
|
|
378
|
+
diff-renewal-network/
|
|
379
|
+
├── src/diff_renewal/ # Standalone JAX/Diffrax pip library (19 modules + py.typed)
|
|
380
|
+
├── experiments/ # Paper experiments, data fetcher, proof verifier & run_suite.py
|
|
381
|
+
│ ├── theory/ # Theorem 6 BT separation, real BT failure, Prop. 5 Talbot & Cor. 1 S4D
|
|
382
|
+
│ ├── compression/ # 400-dataset Pos-Sens 33 calibration & parameter recovery
|
|
383
|
+
│ ├── scaling/ # Marked-race & SparseDRN scaling up to V = 1,024 nodes
|
|
384
|
+
│ ├── neural_clocks/ # Multi-start Latent ODE, LTC, S4D, Neural-CME, Mamba & THP
|
|
385
|
+
│ ├── biology/ # Hematopoiesis FACS, Sleep-EDF, E. coli & 1978 Influenza
|
|
386
|
+
│ ├── systems/ # IT Helpdesk, MOOC (V = 98), StackOverflow (V = 22) & warm-starts
|
|
387
|
+
│ ├── defi/ # 183,881-window multi-pool DeFi & 2L-Mamba+M4 hybrid
|
|
388
|
+
│ └── audits/ # Cross-domain uniformity & baseline controls
|
|
389
|
+
├── examples/ # 4 standalone runnable library quickstarts
|
|
390
|
+
├── tests/ # Pytest unit, float64 gradient, API, fetcher & reproducibility suite (31 tests)
|
|
391
|
+
├── results/ # manifest.json, claim_ledger.json, theory_verification.json & 46 archives
|
|
392
|
+
├── figures/ # 5 main (PNG/PDF) + 10 supplementary (PDF) manuscript figures
|
|
393
|
+
├── output/tables/ # 17 generated LaTeX benchmark tables (.tex)
|
|
394
|
+
├── manuscript/ # Compiled 53-page manuscript PDF snapshot
|
|
395
|
+
├── CITATION.cff # Structured software/paper citation metadata
|
|
396
|
+
├── DATA_LICENSES.md # Upstream dataset licenses, PhysioNet & non-commercial notes
|
|
397
|
+
├── REPRODUCIBILITY.md # Complete claim/figure/table-to-script-and-archive map
|
|
398
|
+
├── pyproject.toml # PEP 621 pip package definition
|
|
399
|
+
└── LICENSE # MIT License
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## Citation
|
|
405
|
+
|
|
406
|
+
If you use `diff-renewal-network` or reproduce results from the manuscript, please cite:
|
|
407
|
+
|
|
408
|
+
```bibtex
|
|
409
|
+
@article{pelissier2026drn,
|
|
410
|
+
title = {Differentiable renewal networks: when predictive minimality fails parameter learning},
|
|
411
|
+
author = {P{\'e}lissier, Aur{\'e}lien},
|
|
412
|
+
year = {2026},
|
|
413
|
+
url = {https://github.com/AI-MathPhys/diff-renewal-network}
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Machine-readable citation metadata is also provided in [`CITATION.cff`](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/CITATION.cff).
|
|
418
|
+
|
|
419
|
+
## License
|
|
420
|
+
|
|
421
|
+
Released under the [MIT License](https://github.com/AI-MathPhys/diff-renewal-network/blob/main/LICENSE).
|