From ae2c658354ceae1fa5fbc9f5fe599be8de80af48 Mon Sep 17 00:00:00 2001 From: Gustav Louw Date: Sat, 31 Mar 2018 04:29:56 -0700 Subject: [PATCH] double to float --- test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test.c b/test.c index f263077..1a675cf 100644 --- a/test.c +++ b/test.c @@ -151,7 +151,7 @@ int main() const float* const tg = data.tg[j]; error += xttrain(tinn, in, tg, rate); } - printf("error %.12f :: rate %f\n", error / data.rows, rate); + printf("error %.12f :: rate %f\n", (double) error / data.rows, (double) rate); rate *= anneal; } // This is how you save the neural network to disk. @@ -165,8 +165,8 @@ int main() const float* const in = data.in[0]; const float* const tg = data.tg[0]; const float* const pd = xpredict(loaded, in); - for(int i = 0; i < data.nops; i++) { printf("%f ", tg[i]); } printf("\n"); - for(int i = 0; i < data.nops; i++) { printf("%f ", pd[i]); } printf("\n"); + for(int i = 0; i < data.nops; i++) { printf("%f ", (double) tg[i]); } printf("\n"); + for(int i = 0; i < data.nops; i++) { printf("%f ", (double) pd[i]); } printf("\n"); // All done. Let's clean up. xtfree(loaded); dfree(data);