Coder Social home page Coder Social logo

rayding24 / first-principles-transformers Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 555 KB

An end-to-end walk through of transformer architecture and heuristics, for my own (and potentially others') learning purposes. Updated continuously.

License: MIT License

Python 34.09% Jupyter Notebook 65.91%

first-principles-transformers's Introduction

Transformers implemented and explained from scratch, culminating in (smaller scale) GPT3 and iGPT

An end-to-end walk through of transformer architecture and heuristics, for my own (and potentially others') learning purposes. Updated continuously.

Current Version:

  • Self-Attention
  • Block Architecture
  • Word Embedding
  • Positional Embedding
  • Word Embedding
  • Masking
  • Transformer Architecture
  • GPT Architecture

TODO:

  • Training
  • GPT training
  • iGPT training

Optional Exploration:

  • Newer Attention Mechanisms with better time complexity (Linformer, Reformer, etc.)
  • Computer Vision (Vision Transformer)
  • PyTorch Lightning refactor

Biblio:

The author wish to acknowledge the following sources (in-text citations can also be found in the notebooks).

Original papers:

Attention Is All You Need
Language Models are Unsupervised Multitask Learners
Layer Normalization
Language Models are Few-Shot Learners

Repo:

_minGPT is adapted from
karpathy/minGPT:https://github.com/karpathy/minGPT/blob/master

The following material has been inspirational and helpful for understanding transformers better:

http://peterbloem.nl/blog/transformers
http://jalammar.github.io/illustrated-transformer/
https://jalammar.github.io/illustrated-gpt2/
http://juditacs.github.io/2018/12/27/masked-attention.html

These material has been interesting to explore:

https://nlp.seas.harvard.edu/2018/04/03/attention.html
https://kazemnejad.com/blog/transformer_architecture_positional_encoding/
https://stackoverflow.com/questions/50747947/embedding-in-pytorch
https://www.reddit.com/r/MachineLearning/comments/cttefo/d_positional_encoding_in_transformer/

first-principles-transformers's People

Contributors

rayding24 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.