Skip to content

Commit 7b9572a

Browse files
committed
init
0 parents  commit 7b9572a

15 files changed

+4455
-0
lines changed

.gitignore

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
notebooks/aim_2_figs/*
4+
*.py[cod]
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*.cover
46+
47+
# Translations
48+
*.mo
49+
*.pot
50+
51+
# Django stuff:
52+
*.log
53+
54+
# Sphinx documentation
55+
docs/_build/
56+
57+
# PyBuilder
58+
target/
59+
60+
# DotEnv configuration
61+
.env
62+
63+
# Database
64+
*.db
65+
*.rdb
66+
67+
# Pycharm
68+
.idea
69+
70+
# VS Code
71+
.vscode/
72+
73+
# Spyder
74+
.spyproject/
75+
76+
# Jupyter NB Checkpoints
77+
.ipynb_checkpoints/
78+
79+
# Mac OS-specific storage files
80+
.DS_Store
81+
82+
# vim
83+
*.swp
84+
*.swo
85+
86+
# Mypy cache
87+
.mypy_cache/
88+
89+
90+
# Data
91+
data/trends/*
92+
*.npy
93+
.tmp*
94+
95+
*Icon
96+
97+
log/
98+
models/
99+
100+
/tmp*
101+
/data/
102+
/results/
103+
/kube/build/
104+
/wandb/*
105+
106+
/logger_plotting_logs/
107+
*results
108+
output.yaml

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Data-Driven Simulator for Mechanical Circulatory Support with Domain Adversarial Neural Process
2+
3+
This repository contains code for the Domain Adversarial Neural Process (DANP) and various baselines reported in the paper, *Data-Driven Simulator for Mechanical Circulatory Support with Domain Adversarial Neural Process*. The data used in this project cannot be shared publicly due to privacy and confidentiality agreements. However, we provide the necessary scripts and instructions to run the model with your own data.
4+
5+
6+
## | Installation
7+
8+
Clone the repository and install the required dependencies:
9+
10+
```bash
11+
pip install -r requirements.txt
12+
```
13+
14+
Setup [wandb](https://wandb.ai/site/) for model evaluation and dashboard.
15+
16+
## | Usage
17+
18+
### Preparing Your Data
19+
20+
Since the original data used in the paper cannot be shared, you will need to prepare your own dataset. Ensure your data is in the appropriate format as described in the `data_preparation.md` file.
21+
22+
23+
### Running the Model
24+
25+
Execute the training script with your dataset.
26+
27+
```bash
28+
python src/model/DANP.py -cohort cohort_name -seq_steps 90 -cuda cuda_number -nepochs 150 -lr 0.001 -bc 64
29+
```

data_preparation.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Data preparation
2+
3+
All our data are preprocessed into 0.1Hz signals of length of 180 time steps.
4+
5+
The DANP model in `src/model/DANP.py` takes in three pytorch tensors as input: `train_real.pt`, `test_real.pt`, and `sim_data.pt`. Each of the three tensors should be of dimension `[N, 180, 7]`, where `N` is the number of rows, depending on source data. The 7 columns are features in the following order:
6+
7+
```
8+
[MAP, motor_speed, pump_flow, LVP, heart_rate, tau_lv, contractiity]
9+
```
10+
11+
Please see the paper for more details on preprocessing.

requirements.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
matplotlib==3.9.0
2+
numpy==1.21.2
3+
scipy==1.7.3
4+
seaborn==0.13.2
5+
torch==1.10.0
6+
tqdm==4.62.3
7+
wandb==0.17.0

src/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)