From d7f0abcd1978f97ec70b352538d31d51b3e936e7 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Thu, 29 Nov 2018 20:09:36 -0500 Subject: [PATCH] Delaying the softmax() to avoid the pow() Now at 5x real-time, with all the low-hanging fruit done. --- dnn/nnet.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dnn/nnet.c b/dnn/nnet.c index cf7d4e10..28ebf26e 100644 --- a/dnn/nnet.c +++ b/dnn/nnet.c @@ -39,6 +39,8 @@ #include "nnet.h" #include "nnet_data.h" +#define SOFTMAX_HACK + #ifdef __AVX2__ #include static __m256 exp8_approx(__m256 X) @@ -340,6 +342,10 @@ void compute_activation(float *output, float *input, int N, int activation) for (i=0;i