Coder Social home page Coder Social logo

ecinn's Introduction

Running the code

ECINN: Efficient Counterfactuals from Invertible Neural Networks

This code is based on ECINN: Efficient Counterfactuals from Invertible Neural Networks.

Practical stuff

I have made all entrypoints accessible through the main.py file to remove clutter.

$> python main.py -h

Will show you the way. There are three modules.

  1. First, the train module should be used to train an IB-INN model.
  2. Next, the list module can be used to display indexed output folders, for ease of indexing when choosing model to explain.
  3. Finally, the counterfactual module computes counterfactual examples and stores them in the directory specified in config.ini.

Installation and submodule

The python requirements are listed in requirements.yml and can be installed with conda as follows:

$> conda env create -f requirements.yml

This will produce conda environment ecinn with necessary dependencies. It will also make a directory in the root named src. This contains the FrEIA framework for invertible neural networks in PyTorch.

Furthermore, this code makes use of the IB-INN code base. To clone the code into the submodule directory, run the following command.

$> git submodule update --init

The config.ini file

When counterfactuals are computed, they are stored as separate files that are located in subdirectories with the root being specified in the config.ini file.

FakeMNIST

In the paper, we introduce a new Dataset called the FakeMNIST dataset, where we took the MNIST data, scrambled the labels and added a little dot in the top-left corner to indicate the new label.

dataset/fakemnist.py contains a pytorch Dataloader, which deterministically scrambles labels and draws the dots in the top-left corner.

ecinn's People

Contributors

fhvilshoj avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.