Git Product home page Git Product logo

torch-foresight's Introduction

 _______             _
|__   __|           | |                               _---~~(~~-_.
   | | ___  _ __ ___| |__ ______                    _{        )   )
   | |/ _ \| '__/ __| '_ \______|                 ,   ) -~~- ( ,-' )_
   | | (_) | | | (__| | | |                      (  `-,_..`., )-- '_,)
 __|_|\___/|_|  \___|_| |_|      _     _        ( ` _)  (  -~( -_ `,  }
|  ____|                (_)     | |   | |       (_-  _  ~_-~~~~`,  ,' )
| |__ ___  _ __ ___  ___ _  __ _| |__ | |_        `~ ->(    __;-,((()))
|  __/ _ \| '__/ _ \/ __| |/ _` | '_ \| __|             ~~~~ {_ -_(())
| | | (_) | | |  __/\__ \ | (_| | | | | |_                     `\  }
|_|  \___/|_|  \___||___/_|\__, |_| |_|\__|                      { }
                            __/ |
                           |___/

Documentation Status Build Status

This package provides a collection of modules useful for characterizing and predicting the dynamics and performance of neural nets. These consist mostly of novel metrics, derived from fields like theoretical neuroscience and information theory, aimed at helping researchers to better understand how neural networks work. The repository is meant to advance a new "Science of AI" or "Science of Deep Learning" (see neuralnet.science). It currently includes modules for computing:

With the following under development:

Check out the comprehensive documentation (click me!)

Installation

The package currently only supports Python 3 (3.5-3.7). Pytorch is required as a dependency. If pytorch is already installed, simply use:

pip install git+https://github.com/ejmichaud/torch-foresight.git

If you don't have pytorch, installing it with anaconda is recommended. An environment.yml has been provided. Use it like so:

conda env create -f environment.yml

This will create a conda environment called "foresight", and install pytorch and then this package. It can then be activated with conda activate foresight. A requirements.txt file has also been provided, if you'd like to use pip install -r requirements.txt, which will install pytorch via pip.

Usage:

Computing effective information:

import foresight.ei as ei

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

... (define model, data loaders) ...

input = next(iter(data_loader))[0].to(device) # get a batch to run model on
EI = ei.ei(model, input=input, device=device)

Effective information may prove a useful metric in characterizing the learning (generalization) and overfitting phases of a neural network. Here is an example of how it evolves during the training of a single layer (no hidden layers) softmax network:

torch-foresight's People

Contributors

ejmichaud avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.