|
liblloyal 1.0.0
Branched Inference for llama.cpp
|
Functions | |
| float | max_finite (const float *a, int n) |
| Find maximum finite value in array Used for log-sum-exp shift to prevent overflow. | |
| float | log_sum_exp (const float *a, int n, float shift) |
| Numerically stable log-sum-exp Computes log(Σ exp(aᵢ)) using shift trick to avoid overflow. | |
Variables | |
| constexpr float | LN2 = 0.693147180559945309417232121458176568f |
|
inline |
Numerically stable log-sum-exp Computes log(Σ exp(aᵢ)) using shift trick to avoid overflow.
| a | Array of log-space values |
| n | Array length |
| shift | Max value for numerical stability |
Definition at line 76 of file metrics.hpp.
|
inline |
Find maximum finite value in array Used for log-sum-exp shift to prevent overflow.
Definition at line 58 of file metrics.hpp.
|
constexpr |
Definition at line 52 of file metrics.hpp.