How samankhamesian/guide works
GUIDE is a research framework for learning and evaluating patient-specific behavioral recommendations for type 1 diabetes. Its central workflow prepares patient glucose and behavior data, uses a learned glucose predictor inside a simulation environment, and trains and evaluates reinforcement-learning policies that propose meal or insulin actions. The environment applies bolus safeguards and calculates rewards. The repository also includes multiple offline and online algorithms, action/reward ablations, adherence analysis, and GLIMMER rollout and counterfactual evaluations. Relationships are limited to README claims and source-index references or excerpts; unsampled implementation details are not assumed.
Main entry points: environment.py RL environment · main.py CQL-BC runner · cql_agent.py CQL-BC agent · preprocess.py Feature preparation
Components 26
Patient data
- Feature preparation
preprocess.py - Glucose predictor
predictor.py
Simulation
- Patient simulator
simulator.py - RL environment
environment.py - Bolus safeguard
bolus_safeguard.py - Domain configuration
config.py
RL algorithms
- Replay buffer
replay_buffer.py - CQL-BC runner
model/cql_bc/main.py - CQL-BC agent
model/cql_bc/cql_agent.py - TD3-BC networks
model/td3_bc/td3_bc_agent.py - PPO runner
model/ppo/main.py - PPO agent
model/ppo/ppo_agent.py - PPO buffer
model/ppo/buffer.py - SAC runner
model/sac/main.py - Online SAC runner
model/sac_online/main.py - SAC agent
model/sac/sac_agent.py - Random-policy runner
model/random/main.py - Random agent
model/random/random_agent.py - TD3-BC runner
model/td3_bc/main.py
Evaluation studies
- Action/reward ablations
ablation_study/ablation_common.py - Adherence analysis
adherence_study/main_adherence.py - GLIMMER rollout
glimmer_evaluation/glimmer_24h_rollout.py - Counterfactual evaluation
glimmer_evaluation/glimmer_counterfactual.py - Metrics and behavior analysis
utils.py
Other components
- Researcher
- Patient data
Connections 34
- Researcher → CQL-BC runner: runs training
- Patient data → Feature preparation: provides records
- Feature preparation → Patient simulator: prepares inputs
simulator.py - Patient simulator → Feature preparation: uses data controller
simulator.py - Patient simulator → Glucose predictor: uses predictor
simulator.py - RL environment → Patient simulator: delegates simulation
environment.py - RL environment → Bolus safeguard: checks proposed bolus
environment.py - CQL-BC runner → RL environment: creates environment
model/cql_bc/main.py - CQL-BC runner → CQL-BC agent: creates and trains
model/cql_bc/main.py - CQL-BC runner → Replay buffer: fills replay data
model/cql_bc/main.py - CQL-BC agent → TD3-BC networks: uses actor and critic
model/cql_bc/cql_agent.py - CQL-BC agent → Replay buffer: samples batches
model/cql_bc/cql_agent.py - PPO runner → RL environment: creates environment
model/ppo/main.py - PPO runner → PPO agent: trains and evaluates
model/ppo/main.py - PPO runner → PPO buffer: trains from buffer
model/ppo/main.py - SAC runner → RL environment: creates environment
model/sac/main.py - SAC runner → SAC agent: trains and evaluates
model/sac/main.py - Online SAC runner → RL environment: creates environment
model/sac_online/main.py - Online SAC runner → SAC agent: creates agent
model/sac_online/main.py - Online SAC runner → Replay buffer: stores transitions
model/sac_online/main.py - Random-policy runner → RL environment: creates environment
model/random/main.py - Random-policy runner → Random agent: uses policy
model/random/main.py - TD3-BC runner → RL environment: creates environment
model/td3_bc/main.py - TD3-BC runner → TD3-BC networks: creates agent
model/td3_bc/main.py - TD3-BC runner → Replay buffer: fills replay data
model/td3_bc/main.py - Action/reward ablations → RL environment: runs restricted actions
ablation_study/ablation_common.py - Action/reward ablations → CQL-BC agent: retains CQL-BC
ablation_study/ablation_common.py - Adherence analysis → RL environment: evaluates policies
adherence_study/main_adherence.py - Adherence analysis → CQL-BC agent: uses CQL-BC
adherence_study/main_adherence.py - GLIMMER rollout → Glucose predictor: uses predictor
glimmer_evaluation/glimmer_24h_rollout.py - GLIMMER rollout → Feature preparation: uses preprocessing
glimmer_evaluation/glimmer_24h_rollout.py - Counterfactual evaluation → Glucose predictor: uses predictor
glimmer_evaluation/glimmer_counterfactual.py - Counterfactual evaluation → Feature preparation: uses preprocessing
glimmer_evaluation/glimmer_counterfactual.py - CQL-BC runner → Metrics and behavior analysis: reports evaluation
model/cql_bc/main.py