This reposityory contains the PyTorch implementation of "Neural Image Compression and Explanation".
Learned sparse explanations from LeNet-5 on MNIST examples:
PyTorch >= 0.4.0
Follow the below 3 steps to run our algorithm:
- Train a target model to explain
python train_target_model.py
- Train NICE
python main.py --r [1]
-r: The hyperparameter to balance data loss and sparsity loss. Please read our paper for details.
- Visualize results
python visualize_explanation.py
If you found this code useful, please cite our paper.
@article{nice20,
title = {Neural Image Compression and Explanation},
author = {Xiang Li and Shihao Ji},
journal = {IEEE Access},
volume = {8},
month = {Nov.},
year = {2020}
}