|
TinyLlama.cpp 1.0
A lightweight C++ implementation of the TinyLlama language model
|
Constants for attention mechanism calculations. More...
Variables | |
| constexpr float | ATTENTION_SCALE_DEFAULT = 0.125f |
| constexpr float | ATTENTION_SCALE_BASE = 1.0f |
| constexpr float | MIN_SCALE = 1e-4f |
| constexpr float | MAX_SCALE = 1e4f |
| constexpr int | KV_REPETITION_FACTOR_DEFAULT = 1 |
Constants for attention mechanism calculations.
These constants are used in the scaled dot-product attention mechanism of the transformer architecture.
|
constexpr |
Definition at line 39 of file model_constants.h.
Referenced by calculate_attention_scores().
|
constexpr |
Definition at line 38 of file model_constants.h.
|
constexpr |
Definition at line 45 of file model_constants.h.
|
constexpr |
Maximum allowed attention scale to prevent overflow
Definition at line 42 of file model_constants.h.
Referenced by calculate_attention_scores().
|
constexpr |
Minimum allowed attention scale to prevent underflow
Definition at line 41 of file model_constants.h.
Referenced by calculate_attention_scores().