Skip to content

Mustufain/Convolution-Neural-Network-

Repository files navigation

Convolution Neural Network

Implementations of CNNs from scratch using Numpy.

Note: The purpose of this repository is to understand what goes benath the layers. In no way it should be used for production purposes nor it aims to replace the existing frameworks.

What does it have?

Network Architecture

  1. Convolution
  2. Relu
  3. Max pool
  4. Convolution
  5. Flatten
  6. Dense
  7. Softmax

Adam optimizer is used for training the network.

Usage

  1. pyenv virtualenv 3.6.5 my-virtual-env-3.6.5 ; create a virtual environment
  2. pyenv activate my-virtual-env-3.6.5 ; activate the virtual environment
  3. pip install -r requirements.txt ; Install dependencies
  4. python run.py ;
  5. python run.py --debug ; Run the network in debug mode which does the gradient checking to make sure backpropogation is correct.
  6. pytest ; Runs all the tests for smooth running of forward propogation.

Docker

You can also use docker for running the network.

Prerequisites

  1. Install Docker
  2. Pull the docker image : docker pull mustufain/cnn-docker
  3. Train CNN : docker run -t mustufain/cnn-docker
  4. Gradient Check CNN : docker run -t mustufain/cnn-docker --debug
  5. Run all test for checking forward propogation : docker run --entrypoint "pytest" mustufain/cnn-docker

Credits

  1. Andrew Ng course on Coursera.
  2. Alex net
  3. Adam optimizer