This repository contains the code for reproducing the results of our project in the 2020 Deep Learning class at ETH Zurich. Our project is based on the paper "Towards Robust Interpretability with Self-Explaining Neural Networks" [1]. Please find our project report here.
pip install -r requirements.txt
Folder | Filename | Description |
---|---|---|
SENN | aggregators.py | definitions of aggregation functions |
SENN | conceptizers.py | definitions of functions that encode inputs into concepts |
SENN | parametrizers.py | definitions of functions that generate relevances from inputs |
SENN | encoders.py | definitions of encoders for conceptizers |
SENN | decoders.py | definitions of decoders for conceptizers |
SENN | losses.py | definitions of loss functions e.g., robustness (stability) loss |
SENN | models.py | definition of model classes |
SENN | backbones.py | definition of backbone models for parametrizers i.e., VGG net |
SENN | utils.py | helper functions e.g., dataset definitions, custom layers |
SENN | eval_utils.py | helper functions for evaluation |
SENN | trainers.py | model training utilities |
SENN | simsiam.py | definitions of siamese networks |
SENN | argparser.py | argparser for different models |
SENN | invarsenn.py | definition of InvarSENN modules |
SENN | disentanglers.py | definition of disentangler for InvarSENN |
Scripts | senn.py | script for reproduction of results for SENN |
Scripts | vaesenn.py | script for reproduction of results for VaeSENN |
Scripts | vsiamsenn.py | script for reproduction of results for V-SiamSENN |
Scripts | invarsenn.py | script for training InvarSENN |
## MNIST dataset
python Scripts/senn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/senn.py --dataset "CIFAR10" --n_epochs 200
## MNIST dataset
python Scripts/vaesenn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/vaesenn.py --dataset "CIFAR10" --n_epochs 200
## MNIST dataset
python Scripts/vaesenn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/vaesenn.py --dataset "CIFAR10" --n_epochs 200
In order to load a pretraianed model please specify path via --path_pretrained [PATH]
flag.
## MNIST dataset
python Scripts/invarsenn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/invarsenn.py --dataset "CIFAR10" --n_epochs 200
- Edward Guenther (gedward@student.ethz.ch)
- Carina Schnuck (cschnuck@student.ethz.ch)
- Massimo Hoehn (hoehnm@student.ethz.ch)
[1] David Alvarez-Melis and Tommi S. Jaakkola. "Towards Robust Interpretability with Self-Explaining Neural Networks". 2018.