Skip to main content

Its an Implementation of Percptron

Project description

Perceptron

Single Layer Perceptron(one Neuron)
A Perceptron is a simple model of a biological neuron that classifies the label of the input data based on various activation functions:

  1. Binary Step Function: \begin{equation} f(x)=\begin{cases} 0, & \text{if $x<0$}.\ 1, & \text{otherwise}. \end{cases} \end{equation} Binary Step Function

  2. Signum Function: \begin{equation} f(x)=\begin{cases} -1, & \text{if $x<0$}.\ 0, & \text{if $x=0$>}\ 1, & \text{if $x>0$}. \end{cases} \end{equation} Signum Function

  3. Linear Activation Function: $$f(x) = x$$ Linear Activation Function

  4. Sigmoid / Logistic Activation Function: $$f(x) = \frac{1}{1+e^{-x}}$$ Sigmoid / Logistic Activation Function

  5. Tanh Function (Hyperbolic Tangent): $$f(x) = \frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}$$ Tanh Function (Hyperbolic Tangent)

  6. ReLU Function: $$f(x) = max(0, x)$$ ReLU Function

  7. Exponential Linear Units (ELUs) Function: \begin{equation} f(x)=\begin{cases} x, & \text{if $x\geqslant0$}.\ \alpha(e^{x} - 1), & \text{otherwise}. \end{cases} \end{equation} Exponential Linear Units (ELUs) Function

  8. Swish: $$f(x) = \frac{x}{1 + e^{-x}}$$ Swish

  9. Gaussian Error Linear Unit (GELU): $$f(x) = 0.5x(1 + tanh[\sqrt{2/\pi}(x + 0.044715x^3)])$$ Gaussian Error Linear Unit (GELU)

fn_list = ['step', 'signum', 'linear', 'relu', 'sigmoid', 'tanh', 'elu', 'gelu', 'swish']

How to use this

from Perceptron.perceptron import Perceptron
from Perceptron.utils import prepare_data, save_plot, save_model

# get the data, convert it into a DataFrame and then use below commands
X, y = prepare_data(df)

model = Perceptron(eta = eta, epochs = epochs)
model.fit(X, y, fn, alpha=None) # alpha ranges between 0 to 1 if and only if ELU activation function is applied else alpha value remains None for other activation functions

Total_Error = model.total_loss()

save_model(model, filename = filename)

save_plot(df, plotFilename, model)

Reference

Python Package Publishing Docs

GitHub Actions CICD Docs

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

Percptron-rohandhanraj-0.0.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Percptron_rohandhanraj-0.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file Percptron-rohandhanraj-0.0.2.tar.gz.

File metadata

  • Download URL: Percptron-rohandhanraj-0.0.2.tar.gz
  • Upload date:
  • Size: 5.2 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 Percptron-rohandhanraj-0.0.2.tar.gz
Algorithm Hash digest
SHA256 83e4d41409eeadc81e93bcd3671ca9b979b6a3dd3d9354c2db2463574632246c
MD5 f8e23a2e3ef3aeed98773c67713783e9
BLAKE2b-256 289ed322fa91ed2d80bee18ab3fce5c9dd6ad8aaa773de416150ab447944c73d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: Percptron_rohandhanraj-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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 Percptron_rohandhanraj-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 be46adb6a3afaf4c325619cf75dbe15da65cde785e4ff602a31931f6f0270228
MD5 679b52f4b2ebbf2aa24bee14e403ce07
BLAKE2b-256 1502a1c81d9b9e4ee4d9d3c6a5a45600e7c16f740ea37c8c721fec715a671af5

See more details on using hashes here.

Supported by

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