MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / nmse

Function nmse

external/ggml/tests/test-backend-ops.cpp:278–291  ·  view source on GitHub ↗

normalized mean squared error = mse(a, b) / mse(a, 0)

Source from the content-addressed store, hash-verified

276
277// normalized mean squared error = mse(a, b) / mse(a, 0)
278static double nmse(const float * a, const float * b, size_t n) {
279 double mse_a_b = 0.0;
280 double mse_a_0 = 0.0;
281
282 for (size_t i = 0; i < n; i++) {
283 float a_i = a[i];
284 float b_i = b[i];
285
286 mse_a_b += (a_i - b_i) * (a_i - b_i);
287 mse_a_0 += a_i * a_i;
288 }
289
290 return mse_a_b / mse_a_0;
291}
292
293// difference between 2 sets (Jaccard distance, 0 - no difference, 1 - no overlap)
294template <typename T>

Callers 2

errMethod · 0.85
errMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected