GithubHelp home page GithubHelp logo

kastnerkyle / science_rcn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vicariousinc/science_rcn

0.0 1.0 0.0 39.95 MB

Reference implementation of a two-level RCN model

Home Page: https://www.vicarious.com/Common_Sense_Cortex_and_CAPTCHA.html

License: MIT License

Makefile 1.53% C++ 23.05% C 0.93% Python 74.49%

science_rcn's Introduction

Reference implementation of Recursive Cortical Network (RCN)

Reference implementation of a two-level RCN model on MNIST classification. See the Science article "A generative vision model that trains with high data efficiency and breaks text-based CAPTCHAs" and Vicarious Blog for details.

Note: this is an unoptimized reference implementation and is not intended for production.

Setup

Note: Python 2.7 is supported. The code was tested on OSX 10.11. It may work on other system platforms but not guaranteed.

Before starting please make sure gcc is installed (brew install gcc) and up to date in order to compile the various dependencies (particularly numpy).

Clone the repository:

git clone https://github.com/vicariousinc/science_rcn.git

Simple Install:

cd science_rcn
make

Manual Install (setting up a virtual environment beforehand is recommended):

cd science_rcn
python setup.py install

Run

If you installed via make you need to activate the virtual environment:

source venv/bin/activate

To run a small unit test that trains and tests on 20 MNIST images using one CPU (takes ~2 minutes, accuracy is ~60%):

python science_rcn/run.py

To run a slightly more interesting experiment that trains on 100 images and tests on 20 MNIST images using multiple CPUs (takes <1 min using 7 CPUs, accuracy is ~90%):

python science_rcn/run.py --train_size 100 --test_size 20 --parallel

To test on the full 10k MNIST test set, training on 1000 examples (could take hours depending on the number of available CPUs, average accuracy is ~97.7+%):

python science_rcn/run.py --full_test_set --train_size 1000 --parallel --pool_shape 25 --perturb_factor 2.0

Blog post

Check out our related blog post.

Datasets

We used the following datasets for the Science paper:

CAPTCHA datasets

MNIST datasets

MNIST licensing

Yann LeCun (Courant Institute, NYU) and Corinna Cortes (Google Labs, New York) hold the copyright of MNIST dataset, which is a derivative work from original NIST datasets. MNIST dataset is made available under the terms of the Creative Commons Attribution-Share Alike 3.0 license.

science_rcn's People

Contributors

vicarious-opensource 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.