MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / array_rmse

Function array_rmse

smallthinker/tests/test-quantize-fns.cpp:38–45  ·  view source on GitHub ↗

Calculate RMSE between two float arrays

Source from the content-addressed store, hash-verified

36
37// Calculate RMSE between two float arrays
38static float array_rmse(const float * a1, const float * a2, size_t n) {
39 double sum = 0;
40 for (size_t i = 0; i < n; i++) {
41 double diff = a1[i] - a2[i];
42 sum += diff * diff;
43 }
44 return sqrtf(sum) / n;
45}
46
47// Total quantization error on test data
48static float total_quantization_error(const ggml_type_traits * qfns, const ggml_type_traits_cpu * qfns_cpu, size_t test_size, const float * test_data) {

Callers 2

total_quantization_errorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected