Example of a Python single layer perceptron neural network using sklearn datasets
The accompanying slides for this repository can be found here.
This is a Python 3 project. You can use either the single_layer_perceptron.py
file or spin up a Jupyter notebook.
First you'll need to create a virtualenv
and install the requirements.
These instructions presume a Mac setup.
For windows setup follow these instructions.
To start:
virtualenv -p python /path/to/python3 neural_networks_env
source path/to/neural_networks_env/bin/activate
(neural_networks_env) pip install -r requirements.txt
Once the requirements have been installed and you've activated your virtualenv
:
(neural_networks_env) python single_layer_perceptron.py
(neural_networks_env) jupyter notebook
-
Update your single layer perceptron to have additional layers (multilayer perceptron - MLP) e.g. three layers, use this tutorial to help you. A three layer network starts using "hidden layers" to add intermediate nodes, that additionally interact with the activation function during forward pass / updating weights.
-
Try taking your perceptron and instead of implementing it from scratch use a Python scientific programming library like Keras instead, use this tutorial to help you
-
Reflect: What does forward propagation and backward propagation provide your NN that a single layer perceptron doesn’t have?