GithubHelp home page GithubHelp logo

codeaudit / spiking-mlp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petered/spiking-mlp

0.0 2.0 0.0 21 KB

A Spiking Multi-Layer Perceptron

License: MIT License

Python 98.63% Shell 1.37%

spiking-mlp's Introduction

A Spiking Multi Layer Perceptron

The code in this repo allows you to recreate our experiments in our new paper Deep Spiking Networks. In this paper, we introduce a new way to implement Deep Feed-Forward networks using spiking neurons - that is, neurons that only communicate by sending an "I fired" signal to their downstream neighbours. Our architecture requires only addition, indexing, and comparison (no multiplication) operations, and has the interesting property that the amount of computation required per data point is a function of the contents of the data.

The Code

The Spiking MLP is written in Java (for speed), but we call it from Python (for convenience), using JPype (as a bridge). This repo depends on Plato, which is a library of useful ML/Deep Learning stuff, mainly built on top of Theano, and DeepSpike which is our fancy new Java Spiking Deep Network repo.

Setup

This installation process has been tested on MacOS. There may be some hiccups if you do it from linux, and almost defnitely some hiccups if you try running it from windows, but all should be possible.

Step 1: Clone this repo, open up Terminal, and run setup.sh

cd /my/projects/folder/
git clone https://github.com/petered/spiking-mlp.git
cd spiking-mlp
source setup.sh

This will install a bunch of things, hopefully successfully. Check the output to see if there were any installation errors. If so, get Googling.

You'll notice a little (venv) on the left of your terminal prompt. This means you're inside the "virtual environment" for this project, which means if you run Python you can import all the modules in the project. If you leave the venv, you can type source venv/bin/activate from the spiking-mlp directory to get back in.

Step 2: Compile the Java.

There are a few ways to do this, here I list the one that I'm most familiar with, though there may be easier ways.

  • Download IntelliJ IDEA (IntelliJ is a Java IDE, like Eclipse or Netbeans).
  • File > Open..., then navigate to <your projects folder>/spiking-mlp/venv/src/deepspike/pom.xml and click "Choose". This will open the DeepSpike project.
  • From the top toolbar, select Build > Make Project. It should compile without error, and you should notice a new folder called "target" in your project root. Good, you're done with this part.

Step 3: Run Experiments

First verify that the experiments are working. In terminal, from the spiking-mlp directory, while in the (venv) (see step 1), run:

py.test

If the tests pass, you're good to go. If they fail, consult troubleshooting below, and failing that email me the problem (or better yet the solution - email's at the bottom) To run the experiments, you can tinker with the parameters at the bottom of demo_spiking_mlp_experiments.py, and run the experiments.

Troubleshooting

  • Can't locate Java? For now we've hardcoded the path to Java, so it'll only work if you're on Mac and have Java installed in the normal place and have the same Java version as we used. So if you get AssertionError: "Hmmm. It's not here. Install Java or update this function to be more clever at finding it.", you have to edit the file spiking_mlp.jpype_connect.py, function _guess_java_loc to include the new path.

Please email me at peter <dot> ed <dot> oconnor at google's email service if you have any questions/comments/bug-reports.

spiking-mlp's People

Contributors

petered avatar peterjsadowski 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.