Skip to content

cfschnuck/SENN-revisited

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Learing 2020 Course Project: Enhancing Interpretability of Self-Explaining Neural Networks

Introduction

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.

Installing dependencies

pip install -r requirements.txt

Code structure

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

Reproduction of results

Reproduction of results for SENN

## MNIST dataset 
python Scripts/senn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/senn.py --dataset "CIFAR10" --n_epochs 200

Reproduction of results for VaeSENN

## MNIST dataset
python Scripts/vaesenn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/vaesenn.py --dataset "CIFAR10" --n_epochs 200

Reproduction of results for VSiamSENN

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

Additional model: InvarSENN

## MNIST dataset
python Scripts/invarsenn.py --dataset "MNIST"
## CIFAR10 dataset
python Scripts/invarsenn.py --dataset "CIFAR10" --n_epochs 200

Authors

References

[1] David Alvarez-Melis and Tommi S. Jaakkola. "Towards Robust Interpretability with Self-Explaining Neural Networks". 2018.

About

Self-Explaining Neural Networks Revisited

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages