Skip to content

temex12/RPATH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPATH: Routing Pathway Analysis for Temporal Hierarchies

Post-hoc explainability framework for Time Series Mixture-of-Experts models.

Overview

RPATH provides interpretability tools for time series MoE models through:

  • Pathway Extraction - Captures complete routing decisions across all layers
  • Expert Profiling - Characterizes expert specializations via concept probing
  • Temporal Saliency - Identifies critical timesteps influencing routing
  • Counterfactual Explanations - Shows minimal input changes that alter routing
  • Uncertainty Quantification - Provides confidence estimates for explanations

Validated on Time-MoE-50M across benchmark datasets (ETTh1, ETTh2, ETTm1, ETTm2, Weather).

Project Structure

RPATH/
├── posthoc_rpath/           # Core framework
│   ├── core/                # Pathway extraction and metrics
│   ├── advanced/            # Saliency, counterfactuals, dashboards
│   ├── clustering/          # Archetype discovery
│   ├── concepts/            # Temporal concept detection
│   ├── collaboration/       # Expert network analysis
│   ├── dynamics/            # Temporal evolution analysis
│   ├── interventions/       # Routing intervention tools
│   ├── evaluation/          # Validation metrics
│   └── pattern_attribution/ # Pattern-expert correlation
├── scripts/                 # Utility and visualization scripts
├── dataset/                 # Benchmark datasets
└── demo_causal_routing_explanation.py

Installation

git clone https://github.com/temex12/RPATH.git
cd RPATH
pip install -r requirements.txt

Usage

# Run causal explanation demo
python demo_causal_routing_explanation.py --dataset ETTh1 --sample_idx 0 --expert 1 --layer 5

# Run pattern attribution pipeline
python posthoc_rpath/pattern_attribution/run_phase9_pipeline.py --datasets ETTh1 --n_samples 5

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors