Perceptron Implementation
Project description
oneNeuron_pypi
one-Neuron-pypi-LijiAlex
Description
A package to implement the functionality of a Perceptron
Package description
- oneNeuron.perceptron [A Perceptron class]
- utils.all_utils.createModel [Creates a perceptron model]
- utils.all_utils.prepare_data [Prepares a pandas data frame from numpy array data]
- utils.all_utils.save_model [Saves the perceptron model created]
- utils.all_utils.save_plot [Saves the plot of the input vs output]
Installation
pip install one-Neuron-pypi-LijiAlex
How to import the Package
from oneNeuron.perceptron import perceptron
from utils.all_utils import createModel
Sample code to create an AND model
from utils.all_utils import createModel
def main(data, eta, epoch, file_name, plot_name):
createModel(data, eta, epoch, file_name, plot_name)
if __name__ == '__main__': ##entry point
AND = {
"x1": [0,0,1,1],
"x2": [0,1,0,1],
"y": [0, 0, 0, 1]
} #data
ETA = 0.3 # learning rate between 0 and 1 (assume)
EPOCHS = 10
try:
main(data=AND, eta=ETA, epoch=EPOCHS, file_name="and.model", plot_name="and.png")
except Exception as e:
raise e # raise exception in terminal
Tips to create other models
- Copy the sample code for AND.
- Replace data with desired data.
- Give appropriate value for data,file_name and plot_name while calling main.
Sample Project using the package
https://github.com/LijiAlex/oneNeuron
What works
AND, OR, NOT, NOT, NAND
What doesn't work
XOR, XNOR
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
File details
Details for the file one_Neuron_pypi_LijiAlex-0.0.3.tar.gz
.
File metadata
- Download URL: one_Neuron_pypi_LijiAlex-0.0.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b52c983f3091624c382a54d96873e6c0df9ae7276087d981c1ed809673856b02 |
|
MD5 | b05deee22c4e853f3dabea78c2b72328 |
|
BLAKE2b-256 | 1dd65fa23c395e35bf8321738e77298996b26ce298af1b7841cdab42c98e0759 |
File details
Details for the file one_Neuron_pypi_LijiAlex-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: one_Neuron_pypi_LijiAlex-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c8850ea187808719a3fe28ed1899236ba8c83e1ef9b5b761e5d789f62d57889 |
|
MD5 | 2fcd826da331bcb388954df476bb4e2d |
|
BLAKE2b-256 | 4143201332db0fa7d18af5fae567bb3876a96b167a688422402f97f21b0cc738 |