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.12

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.12
File Size Uploaded
sdmlab-0.0.12.tar.gz 45.6 kB Details

Built distribution (wheel)

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

Total release size: 81.7 kB

Release files / sdmlab-0.0.12.tar.gz

Download URL sdmlab-0.0.12.tar.gz
Size 45.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0e8d0e0dc45b5648ffccacf9b341361792106ba657c828b9a590f2e62809aaef
BLAKE2b-256 checksum
How to use checksums
e2aa06780f328bbbd84c472279fb24792c7ded218caec12151b18d251e383ee7
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.12-py3-none-any.whl

Download URL sdmlab-0.0.12-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a3ac804cba73f06f0619ff3f8bc898a1eeb4ef756241a110650bd42f9433872
BLAKE2b-256 checksum
How to use checksums
73c57f4a8f437981ea92d49a51a3aaa8afb3a2e08553ed557aa0d04438415271
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

0.0.13

2 release files

This release

0.0.12 This release

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