{"id":51779362,"url":"https://github.com/dtcolligan/ml-from-scratch","last_synced_at":"2026-07-20T10:03:25.653Z","repository":{"id":343803707,"uuid":"1165097814","full_name":"dtcolligan/ml-from-scratch","owner":"dtcolligan","description":"Core ML algorithms implemented from first principles in NumPy. Gradient descent, linear regression, and building towards autograd and neural networks.","archived":false,"fork":false,"pushed_at":"2026-03-27T08:54:46.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T19:56:39.989Z","etag":null,"topics":["from-scratch","gradient-descent","linear-regression","machine-learning","numpy"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dtcolligan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-23T20:27:23.000Z","updated_at":"2026-03-27T08:54:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dtcolligan/ml-from-scratch","commit_stats":null,"previous_names":["dtcolligan/ml-from-scratch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dtcolligan/ml-from-scratch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtcolligan%2Fml-from-scratch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtcolligan%2Fml-from-scratch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtcolligan%2Fml-from-scratch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtcolligan%2Fml-from-scratch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtcolligan","download_url":"https://codeload.github.com/dtcolligan/ml-from-scratch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtcolligan%2Fml-from-scratch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35682457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"ssl_error","status_checked_at":"2026-07-20T02:08:09.736Z","response_time":111,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["from-scratch","gradient-descent","linear-regression","machine-learning","numpy"],"created_at":"2026-07-20T10:03:24.969Z","updated_at":"2026-07-20T10:03:25.641Z","avatar_url":"https://github.com/dtcolligan.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ML From Scratch\n\nA structured machine learning project built from first principles, progressing from NumPy fundamentals through gradient descent, linear regression, autograd, and neural networks.\n\nBuilt during self-study alongside an Economics, Finance \u0026 Data Science degree at Imperial College London.\n\n## Highlights\n\n- Implemented core machine learning building blocks from scratch instead of relying only on high-level libraries\n- Built a **micrograd-style autograd engine** with reverse-mode backpropagation\n- Implemented and trained an **MNIST multilayer perceptron** achieving ~96% test accuracy\n- Used the project to build intuition for optimisation, gradients, computation graphs, and neural network training\n- Created a clear progression from mathematical foundations to practical deep learning implementation\n\n## What this project demonstrates\n\nThis repo is designed to show:\n- fluency with **NumPy-based numerical computing**\n- understanding of **gradient descent and optimisation dynamics**\n- ability to derive and implement **linear regression from first principles**\n- understanding of **automatic differentiation and backpropagation**\n- ability to move from low-level intuition to higher-level neural network training in PyTorch\n\n## Implementations\n\n| #  | Topic | Status | What it shows |\n|----|-------|--------|---------------|\n| 01 | NumPy fluency | Complete | Arrays, broadcasting, vectorised operations, and ML-oriented numerical patterns |\n| 02 | Gradient descent | Complete | Optimisation behaviour, learning-rate sensitivity, and trajectory visualisation |\n| 03 | Linear regression | Complete | MSE loss, analytical gradients, GD training loop, and closed-form comparison |\n| 04 | Micrograd | Complete | Reverse-mode autograd, computation graphs, backpropagation, and a small neural net |\n| 05 | MNIST MLP | Complete | End-to-end neural network training in PyTorch with ~96% accuracy |\n| 06 | Char-level LM | Complete | Next-character prediction, autoregressive generation, and the bridge into language modelling |\n\n## Project structure\n\n```text\n01-numpy-fluency/     NumPy exercises and ML-oriented numerical patterns\n02-gradient-descent/  Gradient descent on test functions with visualisation\n03-linear-regression/ Linear regression with analytical gradients and diagnostics\n04-micrograd/         Minimal autograd engine + small neural network\n05-mnist-mlp/         PyTorch MLP on MNIST\n06-char-level-lm/     Character-level language modelling and autoregressive text generation\n```\n\n## Quickstart\n\n### Requirements\n\n- Python 3.8+\n- NumPy\n- Matplotlib\n- PyTorch\n- torchvision\n\n### Install\n\n```bash\npip install numpy matplotlib torch torchvision\n```\n\n### Run\n\nOpen a project folder and run the relevant notebook or script for that section.\n\n## Why this repo matters\n\nThis is not just a collection of notebooks. It is a learning-and-implementation track designed to build real intuition for how machine learning systems work under the hood.\n\nFor portfolio purposes, the strongest signal is that the work moves from:\n1. numerical foundations,\n2. to optimisation,\n3. to analytical modelling,\n4. to autograd,\n5. to neural network training.\n\n## Current status\n\n### Shipped\n- NumPy foundations\n- Gradient descent\n- Linear regression\n- Micrograd-style autograd engine\n- MNIST MLP\n- Character-level language model\n\n### Next likely extensions\n- MLP-based next-character model\n- makemore-style progression beyond bigrams\n- transformer fundamentals\n\n## Notes\n\nThe goal of this repo is depth, not breadth. Each section is intended to make the mechanics of machine learning more legible by implementing them directly.\n\nThe latest addition extends the repo into sequence modelling, so the progression now reaches beyond classification and into the basic mechanics of language models.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtcolligan%2Fml-from-scratch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtcolligan%2Fml-from-scratch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtcolligan%2Fml-from-scratch/lists"}