Giter VIP home page Giter VIP logo

cnnumpy's Introduction

Introduction

  • CNNumpy is a Convolutional Neural Network written in pure Numpy (educational purpose only).
  • There are 2 implementation versions:
    • Slow: The naive version with nested for loops.
    • Fast: The im2col/col2im version.
  • The slow implementation takes around 4 hours for 1 epoch where the fast implementation takes only 6 min for 1 epoch.
  • For your information, with the same architecture using Pytorch, it will take around 1 min for 1 epoch.
  • For more details, here are my blog posts explaining in depth what's going on under the hood for each implementation (slow and fast).
  • In the demo-cnnumpy-fast.ipynb notebook, the im2col/col2im implementation can achieve an accuracy up to 97.2% in 1 epoch (~6 min). Here are some results:

Installation

  • Create a virtual environment in the root folder using virtualenv and activate it.
# On Linux terminal, using virtualenv.
virtualenv myenv
# Activate it.
source myenv/bin/activate
  • Install requirements.txt.
pip install -r requirements.txt
# Tidy up the root folder.
python3 setup.py clean

Usage of demo notebooks

To play with the demo-notebooks/ files, you need to make sure jupyter notebook can select your virtual environnment as a kernel.

  • Follow "Installation" instructions first and make sure your virtual environment is still activated.
  • Run the following line in the terminal.
python -m ipykernel install --user--name=myenv
  • Run the notebook file only from demo_notebooks/ and then select Kernel > Switch Kernel > myenv. You are now ready to go !

cnnumpy's People

Contributors

3outeille 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.