Skip to main content

A minimal barebones ANN using only numpy

Project description

minimalANN

How to use?

Example :- Suppose this is the network architecture-

Network architecture

To implement the above architecture, we can use the following code -

import numpy as np
import backpropagation as bp
import network
import layer

nn = network.NeuralNetwork()

nn.layers.append(layer.Layer(1, 2, "sigmoid"))
nn.layers[0].weights = np.array([[-0.27], [-0.41]])
nn.layers[0].bias = np.array([[-0.48], [-0.13]])

nn.layers.append(layer.Layer(2, 1, "linear"))
nn.layers[1].weights = np.array([[0.09, -0.17]])
nn.layers[1].bias = np.array([[0.48]])

X = np.array([[1]])
y = np.array([1.707])

nn = nn.train(X, y, 1)
print(nn.weights)

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

minimalann-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

minimalann-1.0.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file minimalann-1.0.0.tar.gz.

File metadata

  • Download URL: minimalann-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minimalann-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b4f843ec3b3e620a3589a16554f95887445528df6c61f9491d9a3804662e6ebb
MD5 24090f634968b64ba158a6cb6a47e207
BLAKE2b-256 fc9032104d88dcd21d4b21fa4fc1c7932f5e2eddfa2cd0be5c8ab3cf122491e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for minimalann-1.0.0.tar.gz:

Publisher: workflow.yml on ABarpanda/minimalANN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file minimalann-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: minimalann-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for minimalann-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 272aee7488edddfdf65889d4199b7cefbe16652b3a426b74079d744edd9d952c
MD5 8810749ddcd4cd32e15ec76a2ee78814
BLAKE2b-256 fbec91561650ec1d86f226fe6b2341f306eff44a3cf1ee87245a2d07b6398323

See more details on using hashes here.

Provenance

The following attestation bundles were made for minimalann-1.0.0-py3-none-any.whl:

Publisher: workflow.yml on ABarpanda/minimalANN

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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