MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / find_quantile

Function find_quantile

tests/test-quantize-stats.cpp:107–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107static double find_quantile(const error_stats & stats, double quantile) {
108 double sum = std::accumulate(std::begin(stats.error_histogram), std::end(stats.error_histogram), 0.0);
109
110 double accum = 0;
111 for (size_t i = 0; i < HISTOGRAM_BUCKETS; i++) {
112 accum += stats.error_histogram[i];
113 if (accum >= sum*quantile) {
114 return (i+1) * HISTOGRAM_RANGE / HISTOGRAM_BUCKETS;
115 }
116 }
117 return INFINITY;
118}
119
120static void print_error_stats(const std::string & name, const error_stats & stats, bool print_histogram) {
121 double rmse = sqrt(stats.total_error / (double) stats.num_samples);

Callers 1

print_error_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected