Code Monkey home page Code Monkey logo

cmi_ne_dgp's Introduction

CDL -- Conditional Mutual Information Neural Estimator

CDL folder aims to run the estimator from Causal Dynamics Learning paper.

Conditional Mutual Information Neural Estimator

Introduction

In this repository you may find the method explained in [1] to estimate conditional mutual information. This technique is based on variational lower bounds for relative entropy known as Donsker-Varadhan bound (DV bound) and NWJ bound. Below is the DV bound for conditional mutual information:

We use the k- nearest neighbor technique to help us design a neural classifier that is the basis of our estimation.

The model that we used in our simulations is a Gaussian model:

The MI-Diff directory contains my independent implementation of the method proposed in the [2], where the authors estimate conditional mutual information as the difference of two mutual information terms. Among several methods in [2], the MI-Diff method performs better according to the provided simulation results. So we compare our results with this approach.

Implementation

The neural network is implemented with PyTorch. For k-nearest neighbor, we use Scikit-learn library.

How to run

To run the code and reproduce the results in the paper use the help below:

--ker = 1: also run kernel based model (>10mins) --rl = 1: use DGP defined in structurel.py where the true CMI need to be re-calculate (TODO)

estimate I(X;Y|Z)

python main.py --d 5 --k 20 --n 80000 --scenario 0 --seed 123

estimate I(X;Z|Y)

python main.py --d 3 --k 10 --n 80000 --scenario 1 --seed 123

test DPI and additivity

python main.py --d 5 --k 10 --n 80000 --scenario 2 --seed 123

Run MI-Diff method

python MIDiff.py --d 5 --n 80000 --scenario 0 --seed 123

python MIDiff.py --d 3 --n 80000 --scenario 1 --seed 123

Visualization

The provided notebook shows how to load and visualize the data

References

[1] Sina Molavipour, Germán Bassi, Mikael Skoglund, 'On Neural Estimators for Conditional Mutual Information Using Nearest Neighbors Sampling,' arXiv preprint arXiv:2006.07225, 2020.

[2] Sudipto Mukherjee, Himanshu Asnani, Sreeram Kannan, 'CCMI : Classifier based Conditional Mutual Information Estimation,' Proceedings of The 35th Uncertainty in Artificial Intelligence Conference, PMLR 115:1083-1093, 2020.

cmi_ne_dgp's People

Contributors

idevede avatar

Stargazers

 avatar

Watchers

Angela Zhou avatar  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.