Skip to main content

A deep learning framework built on NumPy

Project description

ronet: A NumPy-only Deep Learning Framework

License: MIT Python 3.6+

ronet is a lightweight, modular deep learning library built entirely from scratch using only numpy.

It is designed for educational purposes, demystifying the "black box" of frameworks like PyTorch or TensorFlow. It implements backpropagation, optimizers, and layer logic using raw matrix operations, making it an excellent tool for understanding the mathematics of deep learning.

🚀 Features

  • No Heavy Dependencies: Built strictly on NumPy.
  • Keras-like API: Familiar .add(), .compile(), and .train() structure.
  • Modular Design: easily extensible layers, optimizers, and loss functions.
  • Implements Core Concepts:
    • Layers: Dense (Fully Connected), Dropout, BatchNorm.
    • Activations: ReLU, Softmax, Sigmoid, Linear.
    • Optimizers: Adam, RMSProp, SGD (with Momentum), Adagrad.
    • Losses: Categorical Cross-Entropy, Binary Cross-Entropy, MSE.

You can install ronet via pip:

pip install ronet

Or clone the repository and install locally:

git clone [https://github.com/YOUR_USERNAME/ronet.git](https://github.com/YOUR_USERNAME/ronet.git)
cd ronet
pip install .

Example :

import numpy as np
from ronet.model import Model, Accuracy_Classification
from ronet.layers import Dense, Dropout
from ronet.activations import ReLU, Softmax
from ronet.loss import CrossEntropyLoss
from ronet.optimizers import Optimizer_Adam

# 1. Prepare Data (Dummy data for demonstration)
# In reality, load MNIST data here and normalize to 0-1
X_train = np.random.randn(1000, 784) # 1000 samples, 784 features
y_train = np.random.randint(0, 10, size=(1000,)) # 10 classes

# 2. Build Model
model = Model()

model.add(Dense(784, 128))
model.add(ReLU())
model.add(Dropout(0.1))

model.add(Dense(128, 64))
model.add(ReLU())

model.add(Dense(64, 10))
model.add(Softmax())

# 3. Configure
model.set(
    loss=CrossEntropyLoss(),
    optimizer=Optimizer_Adam(learning_rate=0.005, decay=1e-3),
    accuracy=Accuracy_Classification()
)

model.finalize()

# 4. Train
model.train(X_train, y_train, epochs=10, batch_size=128, print_every=1)

🧠 Architecture Overview Ronet uses a Doubly Linked List approach for its computational graph. When you call model.finalize(), the framework links layers together:

Input -> Dense -> ReLU -> Dense -> Softmax -> Loss

During the Forward Pass, data flows sequentially. During the Backward Pass, gradients flow in reverse, with each layer computing its own derivatives (Jacobians or element-wise) and passing the result to the previous layer.

📝 License Distributed under the MIT License. See LICENSE for more information.

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

ronet-0.1.3.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

ronet-0.1.3-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file ronet-0.1.3.tar.gz.

File metadata

  • Download URL: ronet-0.1.3.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for ronet-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7869adbf64a2f8820961300ea82304d4332d76c8e357821fe3cc6675314214d6
MD5 4673e411c1927735a74d6f75805c23a5
BLAKE2b-256 9a847b40bcee9e34b066ce0f4b3c24f191bac4a6a27528e7052ba2a028f39d9a

See more details on using hashes here.

File details

Details for the file ronet-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ronet-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for ronet-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 259cc55b9957fc0b6f91885405475aae419f940e966f98ca9095bfdb69d8e1d2
MD5 055e3d292341f36d4c28b3d7ad4958af
BLAKE2b-256 0a496cc9c3f4e7883b2f9ee8bb5ec292299577c3cab7252bb5366edc7fe57bee

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