Downloads · 30 days
0
safe-diabetes-benchmark/safe-diabetes-t2d-adolescent-cup
safe-diabetes-t2d-adolescent-cup is a reinforcement learning model from safe-diabetes-benchmark. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
September–October 2026 simulator-reset rerun. This release contains three policy checkpoints (seeds 100, 101, 102, endpoint epoch 976) and 18 matching direct CGM predictors: three policies × two action modes × three p…
Downloads · 30 days
0
Access
Public
Updated Oct 8, 2026
Repo size
2.2 MB
Likes
0
Public
Click a slice to open those files.
.json6.7 MB · 78%
From the Hugging Face model README
September–October 2026 simulator-reset rerun. This release contains three policy checkpoints (seeds 100, 101, 102, endpoint epoch 976) and 18 matching direct CGM predictors: three policies × two action modes × three predictor seeds (3101, 3102, 3103). Policy weights include their frozen observation normalizer. The policy uses 14 observations and independent categorical bolus/meal levels 0–4. A requested or simulator-accepted level is not a delivered physical dose.
Policies were trained online on this cohort's patient #001, with a one-day
horizon. Predictors used only seen #001 train/validation/test transition splits.
Predictor weights are CausalMLP, prediction_mode=direct. The legacy artifact
schema name ba_node_predictor does not mean these are BA-NODE models.
Patients #002–#010, reset/action seeds 83000, 83001, 83002; both action modes are reported separately. Each mean first averages resets and patients, then predictor seeds within each policy when applicable, then the three policy means equally. ± is sample SD across the three policy means. None/static use 81 physical episodes per mode; predictive uses 243. TIR counts CGM 70–180 mg/dL over the requested horizon; early endings remain in its denominator.
| Action mode | Shield / penalty | TIR, % | <54 mg/dL, observed % | Early endings, % | Horizon coverage, % |
|---|---|---|---|---|---|
| deterministic | None | 72.70 ± 25.18 | 3.62 ± 4.75 | 19.75 ± 34.21 | 89.36 ± 18.43 |
| deterministic | Static | 82.02 ± 12.03 | 0.63 ± 0.81 | 0.00 ± 0.00 | 100.00 ± 0.00 |
| deterministic | Predictive / 10 | 82.78 ± 11.34 | 0.44 ± 0.49 | 0.00 ± 0.00 | 100.00 ± 0.00 |
| deterministic | Predictive / selected: no_eligible_penalty | NA | NA | NA | NA |
| stochastic | None | 74.90 ± 11.33 | 4.20 ± 1.43 | 6.17 ± 10.69 | 96.90 ± 5.36 |
| stochastic | Static | 79.43 ± 13.72 | 0.39 ± 0.31 | 0.00 ± 0.00 | 100.00 ± 0.00 |
| stochastic | Predictive / 10 | 81.25 ± 12.10 | 0.39 ± 0.31 | 0.00 ± 0.00 | 100.00 ± 0.00 |
| stochastic | Predictive / selected: no_eligible_penalty | NA | NA | NA | NA |
The selected absolute penalty comes from 1/5/10/15/20 on separate seen #001
one-day validation, never the unseen test. no_eligible_penalty is a completed
scientific NA outcome. Selected10 reuses fixed10. These are existing authenticated
audit-summary results, not new reruns. Shield benefits vary by cohort, policy and
metric. TIR alone does not establish safety; early endings, coverage and low
glucose outcomes accompany it. The six-algorithm export does not include its
separate archive-wide native reward/cost supplement.
Install the dependencies for the public GlucoAlg loading revision and GlucoSim. This is a custom PyTorch/GlucoAlg policy, with these relative paths:
import json
from pathlib import Path
from huggingface_hub import snapshot_download
from glucoalg.evaluation import create_diabetes_env, load_model
root = Path(snapshot_download("safe-diabetes-benchmark/safe-diabetes-t2d-adolescent-cup"))
release = root / "releases/rerun-20261008"
config = json.loads((release / "config/seed100/config.json").read_text())
env = create_diabetes_env("t2d", "adolescent#002", seed=83000, horizon_days=7)
actor, env, normalizer = load_model(
release / "checkpoints/seed100/epoch-976.pt", config, env,
shield_type="none",
)
load_model(..., shield_type="rule_based", logit_penalty=10) selects the static
shield. Predictive shielding requires the explicit adapter and dynamics rollout
workflow described in
predictive-shield.md,
not a load_model predictive flag:
from glucoalg.dynamics.model import load_predictor
adapter = load_predictor(
release / "predictors/seed100/deterministic/model3101", device="cpu"
)
Match policy seed, action mode and predictor seed as specified in release.json.
Normalize policy observations using the saved normalizer, and pass raw
observations to shield forecasting. Config and predictor artifacts retain exact
training bytes and hashes; their old absolute paths are provenance, not portable
runtime locations. Predictor triplets must stay together unchanged.
The loading revision differs from the frozen training sources. Original-policy
training and repaired-PCPO training sources are identified separately by the
release manifest. Simulator commit: ddd674e35a32a3a6406a0c2d5e7bf3c72f56dfec. Local package validation
checks CPU loading and integrity; it is not independent scientific or clinical
validation. The models and associated documentation use MIT; this does not
change source-code licenses.
The January 2026 files are replaced on the default branch. The existing old
revision is preserved under legacy-20260131; it is distinct from this rerun.
The accompanying synthetic transition dataset
is predictor training data, not offline policy-training data. These simulator
research artifacts are not validated clinical dosing systems.
Related paper: Safety Generalization Under Distribution Shift in Safe Reinforcement Learning: A Diabetes Testbed, Minjae Kwon, Josephine Lamp and Lu Feng. The May 2026 paper version predates these September–October rerun numbers.