MCPcopy Create free account

hub / github.com/FareedKhan-dev/train-llm-from-scratch / types & classes

Types & classes18 in github.com/FareedKhan-dev/train-llm-from-scratch

↓ 10 callersClassTransformer
The main Transformer model. This class combines token and position embeddings with a sequence of Transformer blocks and a final linear l
src/models/transformer.py:9
↓ 6 callersClassMetricsLogger
src/post_training/logging_utils.py:18
↓ 6 callersClassStage
ui/stages.py:23
↓ 3 callersClassRewardModel
Wrap a :class:`Transformer` and add a scalar reward head (no ``lm_head`` used).
src/post_training/reward_model.py:37
↓ 3 callersClassTransformerWithValueHead
Wrap a :class:`Transformer` and add a scalar value head for PPO. ``forward(idx)`` returns ``(logits, values)`` where ``logits`` are the policy lo
src/post_training/value_head.py:19
↓ 2 callersClassBlock
A single Transformer block. This block consists of a multi-head attention layer followed by an MLP, with layer normalization and residua
src/models/transformer_block.py:6
↓ 2 callersClassDDPContext
src/post_training/distributed.py:21
↓ 2 callersClassMLP
A simple Multi-Layer Perceptron with one hidden layer. This module is used within the Transformer block for feed-forward processing. It
src/models/mlp.py:5
↓ 2 callersClassMultiHeadAttention
Multi-Head Attention module. This module combines multiple attention heads in parallel. The outputs of each head are concatenated and pa
src/models/attention.py:60
↓ 1 callersClassHead
A single attention head. This module calculates attention scores and applies them to the values. It includes key, query, and value proje
src/models/attention.py:6
↓ 1 callersClassRolloutBatch
Result of :func:`generate_with_logprobs`. Attributes: sequences: (B, P+G) prompt tokens followed by generated tokens. respons
src/post_training/rollout.py:33
ClassBaseModelConfig
config/post_training_config.py:28
ClassDPOConfig
config/post_training_config.py:101
ClassGRPOConfig
config/post_training_config.py:148
ClassPPOConfig
config/post_training_config.py:120
ClassPretrainConfig
Pretrain the mid base model from scratch on the Pile HDF5 (mix in task text late).
config/post_training_config.py:48
ClassRewardConfig
config/post_training_config.py:85
ClassSFTConfig
config/post_training_config.py:67