MicroGPT.ts - a conversion of Karpathy's MicroGPT to Typescript
    Preparing search index...

      MicroGPT.ts - a conversion of Karpathy's MicroGPT to Typescript

      The most atomic way to train and run inference for a GPT in pure, dependency-free TypeScript. This file is the complete algorithm. Everything else is just efficiency.

      Converted from Karpathy's microgpt.py.

      Classes

      SeededRandom
      Value

      Interfaces

      AdamConfig
      AdamState
      GPTConfig

      Type Aliases

      Matrix
      StateDict
      TrainType

      Functions

      buildTokenizer
      createAdamState
      createStateDict
      generate
      gpt
      linear
      rms_norm
      softmax
      tokenize
      train
      trainStep