Git Product home page Git Product logo

nn2rules's Introduction

NN2Rules

Introduction

We present an algorithm, NN2Rules, to convert a trained neural network into a rule list. Rule lists are more interpretable since they align better with the way humans make decisions. NN2Rules is a decompositional approach to rule extraction, i.e., it extracts a set of decision rules from the parameters of the trained neural network model. We show that the decision rules extracted have the same prediction as the neural network on any input presented to it, and hence the same accuracy. A key contribution of NN2Rules is that it allows hidden neuron behavior to be either soft-binary (eg. sigmoid activation) or rectified linear (ReLU) as opposed to existing decompositional approaches that were developed with the assumption of soft-binary activation.

For more detailed introduction of NN2Rules, please check out our paper.

Demo

Run the follwing python scripts to decompose a simple neural network into rules:

Step 1: Generate data:

python3 data_prep/data_prep_contraception.py

Step 2: Train a neural network model:

python3 train.py 3

Step 3: Explain the neural network using NN2Rules:

python3 explain.py

Citation

Please cite NN2Rules in your publications if it helps your research:

@article{nn2rules2022,
  title={NN2Rules: Extracting Rule List from Neural Networks},
  author={Lal, G Roshan and Mithal, Varun},
  journal={arXiv preprint arXiv:2207.12271},
  year={2022}
}

nn2rules's People

Contributors

groshanlal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rayazax

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.