A python implementation of the build block of the Neural Network, The Perceptron
Project description
Python-Perceptron
An Basic implementation of the perceptron, the build block a neural net.
Usage
pip install PyPerceptron
Example
Here's how to instanitate the Perceptron
from Perceptron.perceptron import Perceptron
p = Perceptron(number_inputs, learning_rate, Activation_fn, Loss_fn)
from Perceptron.perceptron import Perceptron
from Perceptron.functions.activationFunctions.heaviside import Heaviside
from Perceptron.functions.lossFunctions.quadratic_loss import QuadraticLoss
dataset = [[2.7810836, 2.550537003, 0],
[1.465489372, 2.362125076, 0],
[3.396561688, 4.400293529, 0],
[1.38807019, 1.850220317, 0],
[3.06407232, 3.005305973, 0],
[7.627531214, 2.759262235, 1],
[5.332441248, 2.088626775, 1],
[6.922596716, 1.77106367, 1],
[8.675418651, -0.242068655, 1],
[7.673756466, 3.508563011, 1]]
p = Perceptron(2, 0.1, Heaviside(), QuadraticLoss()) # number of inputs, learning rate, activation function, loss funciton
p.train(dataset, 3, 30)
for d in dataset:
assert p.evaluate(d[0], d[1]) == d[2]
To find out more about the math behind the perceptron, check out the notebook with the fully explanation.
If you wanna see more about how to use the perceptron checkout the demos.
Author
Paolo D'Elia
Contributing
Feel free report issues and contribute to the project, making it better.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyPerceptron-1.0.1.tar.gz.
File metadata
- Download URL: PyPerceptron-1.0.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9488fb7f62d280365a4af7eba2cae5238ac8580d370c8f359d148183b39a34c2
|
|
| MD5 |
76c5d896fe2ee50473dbfe32bf493996
|
|
| BLAKE2b-256 |
1dcb285ede05b25eab46ca8f58d1416a74e23864a4ff64d50598272c490c66a7
|
File details
Details for the file PyPerceptron-1.0.1-py3-none-any.whl.
File metadata
- Download URL: PyPerceptron-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8ebb29d8437c0794f04d216a9606edf3c413b9b760e0c180c5b8b9b356ed020
|
|
| MD5 |
d5e82b2c4b5c3ded785e9ff52365c2e5
|
|
| BLAKE2b-256 |
621c71af145dda1d80506b06d3b018d89ec259269a15c11e26ee27a8e162b02b
|