docs: update and enhance documentation for all core components and models

- Added detailed documentation for GPT, GPT2 and LLaMA models
- Enhanced docstrings in base_model.py, rope.py, rms_norm.py, swi_glu.py
- Updated README with architectural differences and usage examples
- Added scientific references and mathematical foundations
- Improved type hints and parameter descriptions
This commit is contained in:
Sergey Penkovsky
2025-10-06 20:34:02 +03:00
parent 3bc2848cf0
commit 73ee3e16ec
8 changed files with 605 additions and 51 deletions

View File

@@ -24,16 +24,26 @@ llm-arch-research/
│ └── src/llm/
│ ├── core/ # базовые компоненты
│ │ ├── base_model.py
│ │ ├── cached_decoder.py # Декодер с кэшированием
│ │ ├── decoder.py
│ │ ├── multi_head_attention.py
│ │ ├── head_attention.py
│ │ ├── feed_forward.py
│ │ ├── token_embeddings.py
│ │ ── positional_embeddings.py
├── models/gpt/ # GPT и GPT-2 реализация
│ │ ├── gpt.py
│ │ ├── gpt2.py
│ │ ── __init__.py
│ │ ── positional_embeddings.py
│ ├── rope.py # Rotary Positional Embeddings
│ │ ├── rms_norm.py # RMS Normalization
│ │ ├── swi_glu.py # SwiGLU активация
│ │ ── silu.py # SiLU активация
│ │ └── gelu.py # GELU активация
│ ├── models/ # Реализации моделей
│ │ ├── gpt/ # GPT и GPT-2 архитектуры
│ │ │ ├── gpt.py
│ │ │ ├── gpt2.py
│ │ │ └── __init__.py
│ │ └── llama/ # LLaMA архитектура
│ │ ├── llama.py
│ │ └── __init__.py
│ ├── training/ # утилиты обучения
│ │ ├── dataset.py
│ │ ├── trainer.py