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.
Network Architecture
- Convolution
- Relu
- Max pool
- Convolution
- Flatten
- Dense
- Softmax
Adam optimizer is used for training the network.
pyenv virtualenv 3.6.5 my-virtual-env-3.6.5
; create a virtual environmentpyenv activate my-virtual-env-3.6.5
; activate the virtual environmentpip install -r requirements.txt
; Install dependenciespython run.py
;python run.py --debug
; Run the network in debug mode which does the gradient checking to make sure backpropogation is correct.pytest
; Runs all the tests for smooth running of forward propogation.
You can also use docker for running the network.
- Install Docker
- Pull the docker image :
docker pull mustufain/cnn-docker
- Train CNN :
docker run -t mustufain/cnn-docker
- Gradient Check CNN :
docker run -t mustufain/cnn-docker --debug
- Run all test for checking forward propogation :
docker run --entrypoint "pytest" mustufain/cnn-docker
- Andrew Ng course on Coursera.
- Alex net
- Adam optimizer