Skip to main content

PyZapo 🚀

PyZapo is a lightweight, object-oriented Deep Learning framework written completely from scratch using pure NumPy (without PyTorch) [ML / AI Engineering: PyTorch].

It features an in-built adaptive Adam optimizer right inside the layers, making neural network training fast, clean, and highly efficient without any extra boilerplate code [ML / AI Engineering: PyTorch].

Features ✨

  • PyTorch-Style Syntax: Built-in __call__ allows you to invoke models and layers like functions (model(X)) [ML / AI Engineering: PyTorch].
  • OOP Architecture: Inherit from Module to build complex custom neural networks [ML / AI Engineering: PyTorch].
  • Built-in Adam Optimizer: Adaptive learning rate for each weight out of the box.
  • Modern Activations: High-performance ReLU and Sigmoid layers.
  • Loss Functions: MSELoss and binary cross-entropy (BCELoss) with clipping safety.
  • Weights Management: Save and load your trained models instantly with .npz binary files.

Installation 📦

pip install pyzapo

Quick Start 💻

import numpy as np
import pyzapo as pz

# 1. Define your custom architecture
class MyCoolAi(pz.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = pz.Linear(2, 8)
        self.relu = pz.ReLU()
        self.fc2 = pz.Linear(8, 1)
        self.sigmoid = pz.Sigmoid()

    def forward(self, x):
        out = self.fc1(x)
        out = self.relu(out)
        out = self.fc2(out)
        out = self.sigmoid(out)
        return out

    def backward(self, loss_gradient):
        delta = self.sigmoid.backward(loss_gradient)
        delta = self.fc2.backward(delta)
        delta = self.relu.backward(delta)
        delta = self.fc1.backward(delta)
        return delta

# 2. Train and Save
X = np.array([[5.0, 1.0], [1.0, 50.0]])
y = np.array([[1.0], [0.0]])

model = MyCoolAi()
criterion = pz.BCELoss()

for epoch in range(1000):
    pred = model(X)
    loss = criterion(pred, y)
    
    loss_grad = criterion.backward()
    model.backward(loss_grad)
    model.step(lr=0.01)

model.save_weights("my_model.npz")

Release files for pyzapo 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyzapo 1.0.0
File Size Uploaded
pyzapo-1.0.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyzapo 1.0.0
File Interpreter ABI Platform
pyzapo-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / pyzapo-1.0.0.tar.gz

Download URL pyzapo-1.0.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
24f5728d0d50658758769bb25fdfad799ff5d05c0782bf0f08f5bd48628344e5
BLAKE2b-256 checksum
How to use checksums
aff78570203ee3f9ff2e0a36ad6473125f3ca0050b21f6f8ba3ac552de3201af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / pyzapo-1.0.0-py3-none-any.whl

Download URL pyzapo-1.0.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a324bf6d3e99de669f3d7aa8bf39c7dbc4d4d996224c04fce87799e7ffd1aff8
BLAKE2b-256 checksum
How to use checksums
a7e5aca66062e0790200b534fef36a5a4a3b251a42a36ea5606306d881356fc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page