Deep Artificial Neural Network (ANN)
A custom, deep Artificial Neural Network built from scratch in Python using only NumPy.
It features an incredibly deep architecture with 100 hidden layers (100 neurons each) designed to learn complex binary patterns.
- Inputs: 5
- Hidden Layers: 100 layers x 100 neurons and its expandable
- Output: 1
- Activation Functions: Leaky ReLU (hidden layers) & Sigmoid (output layer)
- Optimizations: Gradient clipping and normalized batch updates to prevent vanishing gradients.
Make sure you have NumPy installed:
pip install numpypython ann.pyTo change the size, depth, or number of neurons in the network, you need to edit the 'ann.py' file directly.
Find this specific section in the code:
#Network size: 5 inputs -> 100 middle layers with 100 neurons each -> 1 output layer_sizes = [5] + [100] * 100 + [1] num_layers = len(layer_sizes) - 1
How to change it:
- To change the number of layers: Change the second '100' (e.g., [100] * 50 for 50 layers).
- To change the number of neurons per layer: Change the first '100' (e.g., [200] * 100 for 200 neurons per layer).
- To change inputs/outputs: Update the '5' at the start or the '1' at the end.