This repository collects my TensorTonic solutions for core machine learning and NumPy-based exercises.
The goal is not just to store answers. It is to build a compact learning archive where each problem includes:
- a working
solution.py - a problem-focused
README.md - a short
explanation.md - quick-reference notes
- test case examples for revision
If you are learning ML fundamentals from first principles, this repo is designed to feel more like a study lab than a plain answer dump.
Math Basics -> NumPy Operations -> Optimization -> Sequence Models -> Transformer Foundations
Current solved sequence in this repo:
TT-001SigmoidTT-002Mean Squared ErrorTT-003SoftmaxTT-004Cross EntropyTT-005Gradient DescentTT-006AdamTT-007Matrix TranspositionTT-008Dot ProductTT-009Linear Regression Closed FormTT-010Batch Normalization ForwardTT-011RNN Step ForwardTT-012Euclidean DistanceTT-013TokenizationTT-014EmbeddingTT-015Positional EncodingTT-016Scaled Dot Product AttentionTT-017Multi-Head AttentionTT-018FeedForward NetworkTT-019Layer NormalizationTT-020Encoder BlockTT-021Logistic RegressionTT-022KNN DistanceTT-023K-Means ClusteringTT-024PCA ProjectionTT-025Naive Bayes Log Likelihood (Bernoulli)
Tensortonic Solutions/
|
+-- 00-math-and-numpy-basics/
| |
| +-- TT-001-sigmoid-numpy/
| +-- TT-007-Matrix_Transposition/
| +-- TT-008-Dot-Product/
| +-- TT-012-Euclidean-Distance/
|
+-- 01-core-ml/
| +-- TT-009-Linear-Regression-Closed-Form/
| +-- TT-021-Logistic-Regression/
| +-- TT-022-KNN-Distance/
| +-- TT-023-K-Means-Clustering/
| +-- TT-024-pca-projection/
| +-- TT-025-Naive-Bayes-Log-Likelihood-(Bernoulli)/
|
+-- 02-optimization/
| +-- TT-005-Gradien-Descent/
| +-- TT-006-Adam/
|
+-- 03-losses-and-activations/
| +-- TT-002-MSE-numpy/
| +-- TT-003-Softmax/
| +-- TT-004-Cross-Entropy/
|
+-- 04-neural-networks/
| +-- TT-010-Batch-Normalization/
|
+-- 05-sequence-models/
| +-- TT-011-RNN-Step-Forward/
|
+-- 06-attention-and-transformers/
| +-- TT-013-Tokenization/
| +-- TT-014-Embedding/
| +-- TT-015-Positional-Encoding/
| +-- TT-016-Scaled-Dot-Product/
| +-- TT-017-MultiHead-Attention/
| +-- TT-018-FeedForward-Network/
| +-- TT-019-LayerNorm/
| +-- TT-020-Encoder-Block/
|
+-- 07-computer-vision/
+-- 08-generative-models/
+-- 09-research-paper-implementations/
|
+-- templates/
+-- roadmap.md
| ID | Problem | Concepts | Folder |
|---|---|---|---|
TT-001 |
Sigmoid | activation function, NumPy basics | 00-math-and-numpy-basics/TT-001-sigmoid-numpy |
TT-002 |
MSE | regression loss, averaging, arrays | 03-losses-and-activations/TT-002-MSE-numpy |
TT-003 |
Softmax | normalization, stability, exponentials | 03-losses-and-activations/TT-003-Softmax |
TT-004 |
Cross Entropy | classification loss, log probabilities | 03-losses-and-activations/TT-004-Cross-Entropy |
TT-005 |
Gradient Descent | derivatives, updates, optimization | 02-optimization/TT-005-Gradien-Descent |
TT-006 |
Adam | momentum, adaptive learning rates, bias correction | 02-optimization/TT-006-Adam |
TT-007 |
Matrix Transposition | matrix operations, axes, NumPy | 00-math-and-numpy-basics/TT-007-Matrix_Transposition |
TT-008 |
Dot Product | linear algebra, vector multiplication | 00-math-and-numpy-basics/TT-008-Dot-Product |
TT-009 |
Linear Regression Closed Form | normal equation, regression, matrix inversion | 01-core-ml/TT-009-Linear-Regression-Closed-Form |
TT-010 |
Batch Normalization Forward | normalization, feature scaling, neural nets | 04-neural-networks/TT-010-Batch-Normalization |
TT-011 |
RNN Step Forward | recurrent networks, hidden state update | 05-sequence-models/TT-011-RNN-Step-Forward |
TT-012 |
Euclidean Distance | vector distance, L2 norm | 00-math-and-numpy-basics/TT-012-Euclidean-Distance |
TT-013 |
Tokenization | NLP basics, vocabulary mapping, encoding | 06-attention-and-transformers/TT-013-Tokenization |
TT-014 |
Embedding | token vectors, PyTorch, transformer basics | 06-attention-and-transformers/TT-014-Embedding |
TT-015 |
Positional Encoding | sinusoidal positions, sequence order, transformers | 06-attention-and-transformers/TT-015-Positional-Encoding |
TT-016 |
Scaled Dot Product Attention | attention scores, softmax, weighted values | 06-attention-and-transformers/TT-016-Scaled-Dot-Product |
TT-017 |
Multi-Head Attention | attention heads, projections, sequence mixing | 06-attention-and-transformers/TT-017-MultiHead-Attention |
TT-018 |
FeedForward Network | MLP, ReLU, transformer sublayers | 06-attention-and-transformers/TT-018-FeedForward-Network |
TT-019 |
LayerNorm | feature normalization, gamma, beta, stability | 06-attention-and-transformers/TT-019-LayerNorm |
TT-020 |
Encoder Block | self-attention, residuals, layer norm, FFN | 06-attention-and-transformers/TT-020-Encoder-Block |
TT-021 |
Logistic Regression | binary classification, sigmoid, gradient descent | 01-core-ml/TT-021-Logistic-Regression |
TT-022 |
KNN Distance | nearest neighbors, Euclidean distance, indexing | 01-core-ml/TT-022-KNN-Distance |
TT-023 |
K-Means Clustering | clustering, centroid assignment, squared distance | 01-core-ml/TT-023-K-Means-Clustering |
TT-024 |
PCA Projection | dimensionality reduction, covariance, eigenvectors | 01-core-ml/TT-024-pca-projection |
TT-025 |
Naive Bayes Log Likelihood (Bernoulli) | binary features, Laplace smoothing, log probabilities | 01-core-ml/TT-025-Naive-Bayes-Log-Likelihood-(Bernoulli) |
|
Problems are solved with focused Python implementations instead of bloated notebooks or framework-heavy code. |
Each folder is structured so a concept can be reviewed quickly before interviews, classes, or practice sessions. |
The repository emphasizes intuition: what the formula means, why the code works, and where the result is used in ML. |
Inside a typical problem directory, you will usually find:
TT-xxx-problem-name/
|
+-- solution.py
+-- README.md
+-- explanation.md
+-- note.md / notes.md
+-- test_cases.md
This makes each exercise self-contained and easy to revisit later.
{
"language": "Python",
"numerical_computing": ["NumPy", "PyTorch"],
"focus": [
"Machine Learning fundamentals",
"Mathematical intuition",
"Optimization basics",
"Vectorized computation",
"Sequence modeling foundations",
"Transformer building blocks"
]
}TensorTonic is a great environment for practicing the mechanics behind machine learning systems.
Instead of hiding everything behind high-level libraries, these exercises push you to implement core ideas yourself:
- activation functions
- loss functions
- probability transformations
- optimization steps
- array-based reasoning
- sequence modeling basics
- transformer input representations
That is where a lot of real intuition gets built.
The broader learning direction for this repo lives in roadmap.md.
The intention is to keep expanding this repository in a clean progression:
- stronger math and NumPy foundations
- classical ML building blocks
- deeper optimization concepts
- neural network components
- more complete end-to-end implementations
git clone https://github.com/mutassimalzeem/TensorTonic-Solutions.git
cd "Tensortonic Solutions"Then open any exercise folder and run or inspect solution.py.
This project is part practice set, part knowledge base, and part progress tracker.
If you are also learning machine learning from scratch, I hope this repo gives you a clean and motivating example of how to document your journey while improving your implementation skills.