This is the repository of the code for DynProfiler: A Python package to analyze and interpret the entire signaling dynamics leveraged by deep learn-ing techniques
- Python (version not specified)
- Pytorch (version not specified)
- Captum (version not specified)
git clone https://github.com/okadalabipr/DynProfiler.git
Please set the path so that this package can be imported.
import sys
sys.path.append( )
Please define the model configuration and prepare input data. After running dynpro.embed()
, you can check the embedding result file as npy
.
import dynprofiler as dynpro
## Please configure the model by refferring to data/inputs
import yaml
train_params = yaml.safe_load(open("data/inputs/train_params.yml"))
model_params = yaml.safe_load(open("data/inputs/model_params.yml"))
dataset_params = yaml.safe_load(open("data/inputs/dataset_params.yml"))
outdir = "data/outputs"
## If you train the model using random sampling, please specify the mean and std.
import numpy as np
inp_mean = np.load("data/inputs/input_mean.npy")
inp_std = np.load("data/inputs/input_std.npy")
## Run
dynpro.embed({"mean": inp_mean, "std": inp_std},
outdir,
**train_params, **model_params, **dataset_params)
Please define the model configuration and prepare input data and labels.
You can run Step2 alone without having executed the self-supervised pre-training in Step1.
After running dynpro.interpret()
, you can check the resulting npy
file that represent the time-dependent attributions of each variable.
import dynprofiler as dynpro
## Please configure the model by refferring to data/inputs
import yaml
train_params = yaml.safe_load(open("data/inputs/train_params.yml"))
model_params = yaml.safe_load(open("data/inputs/model_params.yml"))
dataset_params = yaml.safe_load(open("data/inputs/dataset_params.yml"))
outdir = "data/outputs"
## Load Data
import numpy as np
inp_mean = np.load("data/inputs/input_mean.npy")
labels = np.load("data/inputs/labels.npy")
## Run
dynpro.interpret({"mean": inp_mean}, outdir, labels,
**train_params, **model_params, **dataset_params)
Tutorial Jupyter Notebook is provided as Tutorial.ipynb
(You can run in )
This includes:
- Embed the dynamics
- Perform Classification from the dynamics
- Extracting important dynamics
- Reproduction codes for Fig. 2
- Large files, such as input simulated dynamics and model weights, are not stored here. If needed, please contact the author.