AINO (Aino is Neural Operation)
"Aino is Neural Operation." > A custom-built, highly optimized 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 from scratch.
⚡ The Tech Stack (Hardware Agnostic)
AINO is built to be educational yet blazingly fast. It uses an Agnostic Backend:
- CPU Mode: Uses pure
NumPywith contiguous memory optimization. - GPU Mode: Automatically detects and switches to
CuPyif an NVIDIA GPU is available, providing massive parallel acceleration without changing a single line of your code. - No Black Boxes: Every Forward Pass and Backpropagation step is manually calculated.
✨ Features
- Flexible Architecture: Define any number of layers and neurons (e.g.,
[784, 128, 64, 10]). - Vectorized Operations: Dropped slow loop-based perceptrons in favor of highly optimized matrix multiplications.
- Mini-Batch Gradient Descent: Train on large datasets (like MNIST) efficiently.
- Activation Functions: Supports
Sigmoid,ReLU, andTanh. - Universal Serialization: Safely save (
.dit) and load models across different machines, whether they have a GPU or not.
🧠 What I Learned
Building AINO from the ground up gave me insights that high-level libraries often hide:
- From OOP to Vectorization: I initially built the network iterating over individual Perceptrons. I quickly learned that Python loops are slow. Refactoring the
Layerclass to use pure Matrix Calculus (np.dot) reduced training time from 32 minutes to just 19 seconds! - The Calculus of Backpropagation: I implemented the Chain Rule manually, computing derivatives for activations and understanding how error gradients propagate from the output back to the input layers.
- Memory Management & Hardware:
I learned the critical difference between RAM and VRAM, how to use
ascontiguousarrayfor CPU caching, and how to safely bridge data between CPU and GPU usingCuPy.
💻 Usage Example
from aino.model import NeuralNetwork
# Create a network for MNIST (784 inputs, 2 hidden layers, 10 outputs)
model = NeuralNetwork([784, 128, 64, 10], activation_type='tanh')
# Train using Mini-Batch Gradient Descent (Auto CPU/GPU)
model.fit(X_train, y_train, epochs=100, n=0.01, batch_size=32, verbose=True)
# Make predictions
predictions = model.predict(X_test)
# Save the universally loadable .dit model
model.save('aino_mnist.dit')
Built with ❤️ using Python.
Metadata
Release files for aino 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aino-2.2.0.tar.gz | 171.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aino-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 181.5 kB
Release files / aino-2.2.0.tar.gz
| Download URL | aino-2.2.0.tar.gz |
|---|---|
| Size | 171.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3db29b1785503e395e9f735e76c06cb182a89e7fd443d8865b71fd2fdb134c85
|
|
BLAKE2b-256 checksum How to use checksums |
37f4832ab6d21c18b16b8f1ed6d50a8837830cb6ee248048d0347acda003f217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / aino-2.2.0-py3-none-any.whl
| Download URL | aino-2.2.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b4a9d6af48d2df9c65cfdff2049d665ba66408171786cde686f16d05312fd52
|
|
BLAKE2b-256 checksum How to use checksums |
fd76a947d416b18a6bf4dc2d60a5392134922bfc46abcb4a927947724573f259
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Security for aino 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.