Skip to content

mutassimalzeem/TensorTonic-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorTonic Solutions banner

Typing SVG

ML Foundations Python Learn by Building

Overview

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.


Learning Flow

Math and NumPy basics progress

Math Basics -> NumPy Operations -> Optimization -> Sequence Models -> Transformer Foundations

Current solved sequence in this repo:

  1. TT-001 Sigmoid
  2. TT-002 Mean Squared Error
  3. TT-003 Softmax
  4. TT-004 Cross Entropy
  5. TT-005 Gradient Descent
  6. TT-006 Adam
  7. TT-007 Matrix Transposition
  8. TT-008 Dot Product
  9. TT-009 Linear Regression Closed Form
  10. TT-010 Batch Normalization Forward
  11. TT-011 RNN Step Forward
  12. TT-012 Euclidean Distance
  13. TT-013 Tokenization
  14. TT-014 Embedding
  15. TT-015 Positional Encoding
  16. TT-016 Scaled Dot Product Attention
  17. TT-017 Multi-Head Attention
  18. TT-018 FeedForward Network
  19. TT-019 Layer Normalization
  20. TT-020 Encoder Block
  21. TT-021 Logistic Regression
  22. TT-022 KNN Distance
  23. TT-023 K-Means Clustering
  24. TT-024 PCA Projection
  25. TT-025 Naive Bayes Log Likelihood (Bernoulli)

Repository Map

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

Solved Problems

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)

What Makes This Repo Useful

Readable Solutions

Problems are solved with focused Python implementations instead of bloated notebooks or framework-heavy code.

Revision Friendly

Each folder is structured so a concept can be reviewed quickly before interviews, classes, or practice sessions.

Concept First

The repository emphasizes intuition: what the formula means, why the code works, and where the result is used in ML.


Example Folder Structure

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.


Tech Stack

{
    "language": "Python",
    "numerical_computing": ["NumPy", "PyTorch"],
    "focus": [
        "Machine Learning fundamentals",
        "Mathematical intuition",
        "Optimization basics",
        "Vectorized computation",
        "Sequence modeling foundations",
        "Transformer building blocks"
    ]
}

Why TensorTonic

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.


Roadmap

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

Quick Start

git clone https://github.com/mutassimalzeem/TensorTonic-Solutions.git
cd "Tensortonic Solutions"

Then open any exercise folder and run or inspect solution.py.


Final Note

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.

Footer banner

About

My solutions to TensorTonic problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors