Deep Neural Network from scratch - Classification
The neural network class. Add layer by given weight matrix, bias vector, as well as activation function. Model function calculates the forward chain, while gradient function
1 | class NeuralNetwork: |
Generate non-linear separable dataset.
1 | def generate_data(n, p=0.8): |
The neural network has 6 hidden layers, each with 20 neurons, ReLU activation function for the hidden layers, and soft-max for the output layer:
1 | dnn = NeuralNetwork(2) |
Result: