Skip to content

okadalabipr/DynProfiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DynProfiler

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

Requirements

  • Python (version not specified)
  • Pytorch (version not specified)
  • Captum (version not specified)

Usage

git clone https://github.com/okadalabipr/DynProfiler.git

Please set the path so that this package can be imported.

import sys
sys.path.append( )

1. Embed the dynamics

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)

2. Extracting important dynamics

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

Tutorial Jupyter Notebook is provided as Tutorial.ipynb (You can run in Google Colab )
This includes:

  1. Embed the dynamics
  2. Perform Classification from the dynamics
  3. Extracting important dynamics

Fig2

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 95.3%
  • Python 4.7%