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
Sequentialmodel 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 andsdmlab.__version__. AMINORbump generally corresponds to one new concept landing (a layer, an optimizer, ...). To depend on a specific release, pin it the normalpipway:pip install sdmlab==0.1.0. - The public API is versioned separately as a namespace:
sdmlab.v1, and latersdmlab.v2if aMAJORbump ever requires one. Plainimport sdmlabalways 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 canimport sdmlab.v1directly. 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.132
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sdmlab-0.0.132.tar.gz | 49.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sdmlab-0.0.132-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 93.0 kB
Release files / sdmlab-0.0.132.tar.gz
| Download URL | sdmlab-0.0.132.tar.gz |
|---|---|
| Size | 49.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a4671b8f9aa9658625a8eddb07e7aa04989ce9f2d172692792e38cc1ccf1c31
|
|
BLAKE2b-256 checksum How to use checksums |
4b18f817095ad8fc085c334e759c9825bf98b47a5619496a8a8976b476804fde
|
| 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.132-py3-none-any.whl
| Download URL | sdmlab-0.0.132-py3-none-any.whl |
|---|---|
| Size | 43.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c6a9eca1c17be3fa8be4647b9b7bd24be50593e5aaf4af5adedf5c0b4555266
|
|
BLAKE2b-256 checksum How to use checksums |
fb030f918fa00f33933e3ad3f5f27b17fe69ea30663d114054ded174ca88d94b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|