We Use Cookies
We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.Learn more
From-scratch PyTorch implementations of transformer, LoRA, GAN, WGAN-GP, diffusion, classifier-free guidance and DPO with measured results.

This repository implements the building blocks of generative AI from their equations in PyTorch, trained on a laptop GPU (Apple M4 Pro, MPS): an attention mechanism and GPT-style transformer, LoRA adapters compared against full fine-tuning, a GAN and its Wasserstein variant with gradient penalty on a mode-collapse-countable target, policy-gradient reinforcement learning on a from-scratch CartPole, a small DDPM/DDIM diffusion model, direct preference optimisation of the GPT (with a second, on-policy round), and classifier-free guidance on the shapes U-Net. Each component ships with tests, an executed notebook, and results saved in the results directory, and the authors state that all numbers are measured, including runs that overfit or collapsed. The training text for the language model is drawn from MasterFabric's own portfolio documentation, and architecture decisions are recorded as ADRs.










We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.Learn more