summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKawrakow <iwankawrakow@gmail.com>2025-04-12 16:17:50 +0200
committerGitHub <noreply@github.com>2025-04-12 16:17:50 +0200
commitc01449a47869d33f3a2c4272306624ba9d025c3f (patch)
tree7200d90d865ad8a0a5749b63e91180904364725a /examples
parent3e7be3d28e626b52e6198cfc8a20c77a262cfeb9 (diff)
Fix KLD precision (#325)
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/perplexity/perplexity.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp
index 07ac88af..12702693 100644
--- a/examples/perplexity/perplexity.cpp
+++ b/examples/perplexity/perplexity.cpp
@@ -133,7 +133,7 @@ static double log_softmax(int n_vocab, const float * logits, uint16_t * log_prob
max_logit = std::max(max_logit, logits[i]);
min_logit = std::min(min_logit, logits[i]);
}
- min_logit = std::max(min_logit, max_logit - 16);
+ min_logit = std::max(min_logit, max_logit - 24);
double sum_exp = 0.0;
for (int i = 0; i < n_vocab; ++i) {
sum_exp += expf(logits[i] - max_logit);