Skip to main content

SDMLab

Srinivas Deekonda Machine Learning Lab — a from-scratch machine learning / neural-network library, built incrementally as a long-term learning and engineering project.

What this is

SDMLab implements the core building blocks of ML/deep-learning frameworks — tensors, autograd, layers, optimizers, and eventually classic ML algorithms — from first principles in Python, instead of wrapping PyTorch, TensorFlow, or JAX. The goal is to understand how these frameworks actually work internally by building them, one concept at a time, rather than to compete with any of them.

Priority order: understanding and correctness first, API convenience second.

Philosophy

Every component follows the same loop before it's considered done:

learn → implement → test → document → release

Development happens in small, regular iterations. Each concept — a layer, an activation, an optimizer — gets implemented, tested, documented, and shipped as its own version bump rather than bundled into one large release. See Versioning below for how that's tracked.

Current scope: neural networks, from scratch

  • Tensors with automatic differentiation — computational graphs, backpropagation
  • Dense/Linear layers, activation functions, loss functions
  • Optimizers: SGD, Momentum, AdaGrad, RMSProp, Adam, learning-rate scheduling, weight decay
  • Batch / mini-batch training, a Sequential model abstraction, training loops, metrics
  • Dataset utilities
  • A backend abstraction over NumPy (CPU) today, CuPy (GPU) later, switched with sdmlab.set_backend("numpy" | "cupy")

Classic ML (linear/logistic regression, SVMs, decision trees, clustering, ...) and other paradigms are explicitly planned for later — the architecture is designed so they slot in as new modules without requiring a rewrite of anything above. See docs/ARCHITECTURE.md for the full folder structure and the reasoning behind it, and docs/nn/CODING_GUIDE.md for the coding conventions used while building the neural-network module.

Example (target API)

from sdmlab.layers import Dense
from sdmlab.activations import ReLU
from sdmlab.losses import CrossEntropy
from sdmlab.optimizers import Adam

model = sdmlab.Sequential([
    Dense(784, 128),
    ReLU(),
    Dense(128, 10),
])
optimizer = Adam(learning_rate=0.001)

This is the API being built toward — check the version history below for what's actually implemented at any given point.

Installation

pip install sdmlab

The package name is registered on PyPI; the library itself is early-stage and under active development, so check the installed version against Versioning before relying on any particular API surface.

Versioning

Two independent things are versioned here:

  • Releases follow semantic versioning (MAJOR.MINOR.PATCH), tracked in CHANGELOG.md and sdmlab.__version__. A MINOR bump generally corresponds to one new concept landing (a layer, an optimizer, ...). To depend on a specific release, pin it the normal pip way: pip install sdmlab==0.1.0.
  • The public API is versioned separately as a namespace: sdmlab.v1, and later sdmlab.v2 if a MAJOR bump ever requires one. Plain import sdmlab always follows whichever namespace is currently the default — that's a deliberate choice made in this repo, not something you opt into — while code that wants to freeze against one API shape forever can import sdmlab.v1 directly. Full mechanism: docs/VERSIONING.md.

Project layout

src/sdmlab/       the package
tests/            mirrors src/sdmlab/ 1:1
examples/         one runnable script per milestone
docs/             architecture notes and per-module coding guides

Full details: docs/ARCHITECTURE.md.

License

GNU General Public License v3.0

Author

Srinivas Deekonda

Release files for sdmlab 0.0.13

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

Source distribution (sdist)

Source distribution for sdmlab 0.0.13
File Size Uploaded
sdmlab-0.0.13.tar.gz 49.8 kB Details

Built distribution (wheel)

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

Total release size: 92.5 kB

Release files / sdmlab-0.0.13.tar.gz

Download URL sdmlab-0.0.13.tar.gz
Size 49.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dbb8396f8ceeb6049ca8963719223722f2f00f2f3d149b5d49afcd5a5838545e
BLAKE2b-256 checksum
How to use checksums
e5f09a2b86df23c47d6897d7ed211654a3bc7a33a459f0a00ad89920c3b36122
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release files / sdmlab-0.0.13-py3-none-any.whl

Download URL sdmlab-0.0.13-py3-none-any.whl
Size 42.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b9f45da03afedd20844fdaa287f934ffa9af3ff137e1fc01e668f7c22407d4b
BLAKE2b-256 checksum
How to use checksums
80f63230e2d7bd1aad118a17aa23b0045466e14bb46d9ac4202b5832d765e5a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.0.13 This release

2 release files

0.0.12

2 release files

0.0.1

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