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.131
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.131.tar.gz | 50.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sdmlab-0.0.131-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 93.4 kB
Release files / sdmlab-0.0.131.tar.gz
| Download URL | sdmlab-0.0.131.tar.gz |
|---|---|
| Size | 50.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56b0db30217557943b7a9ded111c669c8e86c588cfb190a23eabbe452ec765b2
|
|
BLAKE2b-256 checksum How to use checksums |
23dabc9a104e6c7477cb939e4390ac0a38de6d8007c7eae23af89bb589245ffa
|
| 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.131-py3-none-any.whl
| Download URL | sdmlab-0.0.131-py3-none-any.whl |
|---|---|
| Size | 43.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2809636100ad3b5b77ee685f467382fae6e95cf8441b038dfc214a77720e7329
|
|
BLAKE2b-256 checksum How to use checksums |
01a2de83de9453c32b1e8dc04948fb1ec78144b207078b4a79e0134c6a1627e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|