Awesome
Vision Mamba Mender
<div align="center"><img width="200" src="logo.jpg"/></div>Requirements
- causal_conv1d:
pip install causal-conv1d
- mamba:
pip install mamba-ssm
pip install -U openmim
mim install mmcv
pip install mmsegmentation
pip install mmengine
pip install ftfy
Algorithms
π Preparation
- Train a pre-trained model:
bash scripts/train.sh
- Select high-confidence samples and low-confidence samplesοΌ
bash scripts/sample_selection.sh
- Extract intermediate features from the model, including activations and gradients of samples:
bash scripts/feature_selection.sh
π Interpreting
- Visualize external interactions of states or internal interactions of states
bash state_external_visualize.sh
bash state_internal_visualize.sh
- Binarize external interactions of states or internal interactions of states
bash state_external_mask.sh
bash state_internal_mask.sh # Steps necessary for calibration!
- Compute interpretability scores for external interactions of states or internal interactions of states
bash state_external_score.sh
bash state_internal_score.sh
π§ Calibrating
- Calibrate external interactions of states or internal interactions of states
bash scripts/train_repair.sh
Future Plans
This repository contains the initial version of the code for the Vision Mamba Mender paper. Please stay tuned for further refinements and detailed explanations in future updates.
Others
- The directory structure of the files outputted by the algorithm:
output_path # Overall output directory as defined by you
βββ exp_name # Experiment name defined by you
βββ models
βͺ βββ xxx.pth
βββ samples
βͺ βββ htrain # Selected high-confidence samples
βͺ βββ ltrain # Selected low-confidence samples
βββ features
βͺ βββ hdata # Selected intermediate features of the high-confidence samples
βͺ βͺ βββ xxx.pkl
βͺ βββ ldata # Selected intermediate features of the low-confidence samples
βββ visualize
βͺ βββ hdata
βͺ βͺ βββ external # Visualization results of external interactions of states
βͺ βͺ βͺ βββ xxx.JPEG/PNG
βͺ βͺ βββ internal # Visualization results of internal interactions of states
βͺ βββ ldata # Same as above
βββ masks
βͺ βββ hdata
βͺ βͺ βββ external # Binarization results of external interactions of states
βͺ βͺ βͺ βββ xxx.pt
βͺ βͺ βββ internal # Binarization results of internal interactions of states
βͺ βββ ldata # Same as above
βββ scores
βββ hdata
βͺ βββ external # Interpretability scores of external interactions of states
βͺ βͺ βββ xxx.PNG
βͺ βββ internal # Interpretability scores of internal interactions of states
βββ ldata # Same as above