Skip to content

Add/mm retain adacare#885

Open
jhnwu3 wants to merge 9 commits intomasterfrom
add/mm_retain_adacare
Open

Add/mm retain adacare#885
jhnwu3 wants to merge 9 commits intomasterfrom
add/mm_retain_adacare

Conversation

@jhnwu3
Copy link
Collaborator

@jhnwu3 jhnwu3 commented Mar 10, 2026

This pull request introduces new example scripts and documentation updates to support multimodal and hyperparameter-tuned drug recommendation models on the MIMIC-IV dataset, specifically using AdaCare and RETAIN model variants. It also improves the usability and clarity of existing example scripts.

Major additions and improvements:

1. New example scripts for drug recommendation:

  • Added drug_recommendation_mimic4_adacare.py demonstrating how to use the AdaCare model for drug recommendation on MIMIC-IV, including data loading, task setup, training, evaluation, and prediction inspection.
  • Added drug_recommendation_mimic4_adacare_optuna.py, providing an end-to-end example of hyperparameter tuning for AdaCare using Optuna, covering parameter search, training, and evaluation.
  • Added drug_recommendation_mimic4_multimodal_retain.py, showcasing the use of the new MultimodalRETAIN model for handling both sequential and non-sequential EHR features, with detailed steps and comparison to vanilla RETAIN.

2. Documentation enhancements:

  • Updated AdaCare and RETAIN model documentation to include the new MultimodalAdaCare and MultimodalRETAIN classes, improving discoverability and API reference completeness. [1] [2]

3. Usability and bug fixes in existing examples:

  • Ensured all example scripts use a consistent dataset cache directory for reproducibility and efficiency.
  • Fixed sample access in the RETAIN example to use the correct dataset indexing method, improving code reliability.

lock_path = Path(cache_dir) / "build.lock"
with FileLock(str(lock_path), timeout=7200):
# Re-check inside the lock — another process may have built it
# while we were waiting.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need help looking into file read checks like this. Mainly, for when the agent spins up multiple caching jobs at once, which leads to downstream issues like overwriting files, etc.

@jhnwu3 jhnwu3 requested review from EricSchrock and Logiquo March 10, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant