GithubHelp home page GithubHelp logo

grseb9s / deeplearningtoymodels Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roboball/deeplearningtoymodels

0.0 1.0 0.0 28.01 MB

toy models for different kind of Neural Networks: CNN,RNN

MATLAB 65.54% Python 34.46%

deeplearningtoymodels's Introduction

Deep Learning Toy Models

Toy Models in Matlab and Python for different kind of Neural Networks

  • CNN: 3 layer network, MNIST data
  • RNN: 8 layer network, 8 bit binary digits

CNN

This is a simple 3 layer Convolutional Neural Network trained on MNIST data. Forward and backward pass are all programmed into one CNNtoymodel.m file (no libraries are needed). By intent there is only limited modularisation of functions. So it should be easy for you to see what is going on in the training loop and test loop by a glance at the MATLAB workspace. However, if you wish to check for the correctness of the model, you can also run an identical Tensorflow implementation by excecuting the CNNtoymodel.py in Python.

For more background info and practical excercises check out my CNN Technical Report (in German).

Run and Usage

  • Matlab: Just download the CNN folder and run CNNtoymodel.m in Matlab.
  • Python: Alternatively run the CNNtoymodel.py in Python.

For python you need to install the following dependencies:
numpy, tensorflow (I use version 12), random, matplotlib and scipy

One epoch, learning rate=0.01, batch size training=50, batch size test=2000 should give about 80% training accuracy and 67% test accuracy. Limitations of this model are that it uses only 2D filterbanks instead of 4D volumes. Further the model does not use any advanced CNN optimization techniques like Momentum or Dropout. Feel free to improve the model.

RNN

The Recurrent Neural Network is an 8 layer network. The purpose of this model is to learn adding two 8 bit binary digits. The Matlab code is re-implementation of the Python Code by Iamtrask. Like in the example above just run the file and you will able to see all variables and calculations in the Matlab workspace. If you like to dig deeper into the theory of this binary RNN, I recommend you to read this blog about binary RNN background info.

Run and Usage

  • Matlab: Just download the RNN folder and run RNNtoymodel.m in Matlab.
  • Python: Alternatively run the RNNtoymodel.py in Python.

Enjoy Roboball

deeplearningtoymodels's People

Contributors

roboball avatar

Watchers

 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.