This repository represents an attempt to implement a simple, configurable, deep neural network from scratch, using nothing but pure python code along with some SciPy tools. Primary resource used is Welch Labs neural networks demystified series on YouTube. This is by no means an efficient implementation, and its only purpose is learning.
This example demonstrates usage on a iris flower data set. IrisDF is a helper class that loads and preprocesses the data using scikit-learn API.
from nn.sdnn import DNN
from nn.iris import IrisDF
df = IrisDF() # load dataset
N = DNN(shape=[4, 10, 6, 3]) # create a neural network with input layer size of 4, two hidden layers, and 2 output classes (one-hot encoded)
N.train(df.X_train, df.y_train) # train the network
Behaviour of the cost/loss function over the number of iterations in the oprimization process for the given example is shown on the graph bellow.
More usage examples are avaiable in the test directory of this repo, in the form of jupyter notebooks.