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