#pragma once #include #include // General epsilon for comparing values. static const R EPS = 1e-10; // Epsilon for comparing network weights after training. static const R WEIGHT_EPS = 0.01; // Epsilon for comparing network outputs after training. static const R OUTPUT_EPS = 0.01; static inline bool double_eq(double a, double b, double eps) { return fabs(a - b) <= eps; } static inline R lerp(R a, R b, R t) { return a + t*(b-a); }