Skip to main content

its a implementation of Perceptron

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

Sample Dataset - AND

x1 | x2 | y

  • | - | - 0 | 0 | 0 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

one_Neuron_pypi_LijiAlex-0.0.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

one_Neuron_pypi_LijiAlex-0.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file one_Neuron_pypi_LijiAlex-0.0.2.tar.gz.

File metadata

  • Download URL: one_Neuron_pypi_LijiAlex-0.0.2.tar.gz
  • Upload date:
  • Size: 5.4 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

Hashes for one_Neuron_pypi_LijiAlex-0.0.2.tar.gz
Algorithm Hash digest
SHA256 68b0593ba5923545ba1b6302bd80bbf8c92d188e2390d8ddb60d60cf326a6c96
MD5 5c1185ebbf9bb16309c35a1ff1abb71e
BLAKE2b-256 d974946fd00d6b2cf878d2eff505f27767032921616bc78b4fb9810838ef1117

See more details on using hashes here.

File details

Details for the file one_Neuron_pypi_LijiAlex-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: one_Neuron_pypi_LijiAlex-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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

Hashes for one_Neuron_pypi_LijiAlex-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18b33c4a97a96f048886f4ef73136739787b6b90313e427d90508fb975e9bfb1
MD5 7f49295304c1553195d021cd38b36965
BLAKE2b-256 2a09da2f5f7e29d2b94d4b71504b47f9fe2397f9c59f5646a22cc82c9f1d6fa4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page