GithubHelp home page GithubHelp logo

anner-dejong / nn_buildingblocks_exercise Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 110 KB

Exercise for understanding Building Blocks of simple Neural Networks

Jupyter Notebook 79.31% Python 20.69%

nn_buildingblocks_exercise's Introduction

Welcome!

This ipython notebook implements three simple Neural Nets that try to classify the MNIST dataset:

  • Vanilla_NN:
    Vanilla Neural Network

  • Drop_BN_NN:
    Slightly fancier Neural Network with Dropout and Batch Normalization

  • Conv_NN:
    Simple Convolutional Neural Network

This code is mostly aimed for those who are familiar with the basics of Neural Networks, and want to see and understand an actual practical implementation.

As such, this code doesn't use any higher level libraries such as Tensorflow. (It only makes extensive use of Numpy.)

It also means that it is much easier to follow variables around, and see how different building blocks interact with each other to form a full-fledged net. This all comes at the drawback of not being able to use very optimized implementations.

Therefore, although the presented net seems quite robust, it is also hard to optimize and converge, and have very good performance. Again, this code is meant for understanding and 'playing around', not aimed at high-end performance.

I hope this gives an easy to follow code and a good overview of what happens inside a Neural Nets step by step, and that many people may benefit from tinkering with it.

Anner

Files description:

  • Data_MNIST:
    folder that should contain all the data, please download these yourself

  • Models.py:
    script that contains athe three networks as python classes

  • NN_utils.py:
    script that contains all library of main neural network functions

  • NeuralNets.ipynb:
    ipython notebook that instantiates the network classes from Models.py, and trains them etc. More description inside.

  • NN_SinglePage.ipynb:
    Separate, stand alone ipython notebook in case you just want a single file of code. (Requires data separate though!)

Lacking:

  • ReLU layer, other activation functions
  • Optimized initialisation of the weight variables such as Glorot/Xavier initialisation
  • Visualize different nets training characteristics next to each other
  • Create parent class, or integrate three classes into on (they are not that different)
  • Further checks why there is a lack of convergence

nn_buildingblocks_exercise's People

Contributors

anner-dejong 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.