Skip to main content

AINO Is Neural Operation: A lightweight, educational neural network library.

Project description

AINO (Aino is Neural Operation)

AINO Banner

"Aino is Neural Operation." > A custom-built Deep Learning framework built from scratch using pure Python and NumPy.


🌟 Inspiration

This project was born out of curiosity after watching this inspiring video:
MIT Introduction to Deep Learning | 6.S191

I didn't want to just "import tensorflow" and call it a day. I wanted to see directly how the magic happens under the hood. I wanted to feel the weight of the matrices, understand the flow of the gradients, and build the brain neuron by neuron.

The Tech Stack

So, I built AINO using only NumPy.

  • No Black Boxes: Every Forward Pass and Backpropagation step is manually calculated.
  • Modular Design: Built with Object-Oriented Programming (Perceptron -> Layer -> NeuralNetwork).
  • Custom File Format: Saves and loads trained models using the custom .dit format.

Features

  • Flexible Architecture: Define any number of layers and neurons (e.g., [3, 20, 10, 1]).
  • Activation Functions: Supports Sigmoid, ReLU, Tanh, and more soon.
  • Tasks: Capable of both Classification (e.g., Iris Dataset) and Regression (e.g., Rocket Trajectory Prediction).
  • Training Engine: Includes .fit() and .predict() methods similar to Scikit-Learn.

🧠 What I Learned

Building AINO from the ground up gave me insights that high-level libraries often hide:

  1. Object-Oriented Neural Architecture: Instead of abstract tensors, I built the network hierarchically. I learned how a Neural Network manages Layers, and how a Layer orchestrates individual Perceptrons. This OOP approach helped me visualize exactly how data flows through the structure.

  2. The Calculus of Backpropagation: I implemented the Chain Rule manually. By coding the backward() method in Layer and update_weight() in Perceptron, I understood how error gradients propagate from the output back to the input, and how weights ($w$) and biases ($b$) are adjusted using the learning rate ($n$).

  3. Activation Functions & Derivatives: I manually coded the mathematical formulas for Sigmoid, Tanh, and ReLU, along with their specific derivatives needed for the gradient descent step. I learned why ReLU is crucial for preventing vanishing gradients in deeper networks.

  4. NumPy Vectorization: Handling matrix multiplication (np.dot) and shape alignment was challenging. I learned how to efficiently process inputs and weights as vectors rather than looping through every single value.

  5. Model Serialization (The .dit Format): I learned how to persist state. By implementing the save() and load() methods, I figured out how to extract weights/configs from objects, store them in a binary format (.npz), and reconstruct the exact object architecture from that file later.

💻 Usage Example

import aino

model = aino.NeuralNetwork([2, 3, 1], activation_type='sigmoid')
model.fit(X_train, y_train, epochs=100, n=0.1)
model.predict(X_test)
model.save('aino.dit')

Built with ❤️ use Python and Numpy.

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

aino-1.0.1.tar.gz (131.3 kB view details)

Uploaded Source

Built Distribution

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

aino-1.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file aino-1.0.1.tar.gz.

File metadata

  • Download URL: aino-1.0.1.tar.gz
  • Upload date:
  • Size: 131.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aino-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a0bbcafd28c47d8a1f64e5ef811d9f76acbc60123a92212ed5b4d97f7544b23f
MD5 f5ac867fb69bba1a9a80884176b22d6f
BLAKE2b-256 75ebc1fa7ff5692008641f00f9520bf6b077cf8aa359fd41545994c14b5b4996

See more details on using hashes here.

File details

Details for the file aino-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: aino-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aino-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9930ab1fb9d9d8d5f85dc54cfc10cc7d087ac2d73596fcb50ca17610c4afb03d
MD5 5d2b8ef35cab16ce42ed2f764df2937f
BLAKE2b-256 db29a50f854b83beed530bd59fbc1a691a809cce0584724270fe2ae11b732ce6

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