Skip to main content

No project description provided

Project description

VERSION

MAJOR.MINOR.PATCH

USAGE EXAMPLES

VIDEO

  • to be inserted

EXAMPLE

from Pynapse import Dense, Activation_Sigmoid, Network, Net_Save, Activation_ReLU, Bin_Round
import numpy as np

layers = [
    Dense(2, 10),             # 2 inputs, 10 output connections
    Activation_ReLU(),        # ReLU activation function
    Dense(10, 1),             # 10 inputs (output from previous layer), 1 output neuron
    Activation_Sigmoid()      # Sigmoid activation function for output to be between 1 and 0
]


net = Network(layers)                               # Set the network to use the provided layers

X = np.array([[0,0], [0,1], [1,0], [1,1]])          # Training data for a simple OR function
y = np.array([[0],[1],[1],[1]])                     # Results to aim for

net.train(X, y, epochs=200, lr=0.1)                 # Train the network with the provided data

Net_Save.save('model.json', layers)                 # Save the network to a json file

print(net.forward(np.array([[1,0]])))               # Putting data through the network, result should be near one based off the data    e.g. [[0.91807402]]
print(net.forward(np.array([[1,0]]))[0][0])         # You can remove brackets like this     e.g. 0.9180740216494526

prediction = net.forward(np.array([[1,0]]))[0][0]   # You can remove brackets in a variable like this
print(prediction)

prediction = Bin_Round.Bin_Round(net.forward(np.array([[1,0]])))
print(prediction)                                   # Round the output of the output of the output layer to binary 1 or 0    e.g. 1

WHY CALLED "Pynapse"

This module has been called "Pynapse" gor Python and Synapse

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

pynapse-0.4.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

Pynapse-0.4.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file pynapse-0.4.0.tar.gz.

File metadata

  • Download URL: pynapse-0.4.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pynapse-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ca2cfe28ae81363456f8254be405c008f2d3db09a09e8c36dc32adeb2694c26b
MD5 1c6db8e70bf89016b63f86bdf8a63a59
BLAKE2b-256 8faa763d7ef1b58ba5d103f60f4f86ff642c83b68b300daa39c3f2535372d9b0

See more details on using hashes here.

File details

Details for the file Pynapse-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: Pynapse-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for Pynapse-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e05658e502ef65dd5fc6f13d964d38623cf5a94dac0beba20ac61ec1a5274a0a
MD5 25306075513d7c986f7d7210440a0e24
BLAKE2b-256 1be14f65e1363d493fce34280c5b4be81eb67facda472d37dd802ec1160a42bd

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