4
4
#include <stdio.h>
5
5
#include <stdlib.h>
6
6
#include <string.h>
7
+ #include <time.h>
7
8
8
9
#include "keyword_spotting_io_2.h"
9
10
#include "precnn_params.h"
16
17
#include "utils.h"
17
18
18
19
19
- // Check out time with GD
20
+ // Check out time steps with label time steps
20
21
int checkTime (unsigned out_T ){
21
22
if (out_T != O_T ){
22
23
printf ("Error, Estimated Output and Actual ouput time axis mis-match" );
@@ -148,7 +149,7 @@ void key_word_spotting(float* mem_buf){
148
149
& conv_params , PRE_CNN_FILT_ACT ); // regular tanh activation
149
150
150
151
BatchNorm1d (0 , cnn1_out , in_T , PRE_CNN_O_F ,
151
- BNORM_RNN_MEAN , BNORM_RNN_VAR , 0 , 0 , 0 , 1 , 0.00001 ); // Inplace activation
152
+ BNORM_RNN_MEAN , BNORM_RNN_VAR , 0 , 0 , 0 , 1 , 0.00001 ); // Inplace computation
152
153
153
154
/* Bricked Bi-FastGRNN Block */
154
155
int fwd_window = 60 , hop = 3 , bwd_window = 15 , rnn_hidden = RNN_O_F >>1 , out_index = 0 ;
@@ -258,8 +259,13 @@ void key_word_spotting(float* mem_buf){
258
259
}
259
260
260
261
int main (){
261
-
262
+
263
+ clock_t begin = clock ();
262
264
key_word_spotting (INPUT );
265
+ clock_t end = clock ();
266
+ double time_spent = (float )(end - begin ) / CLOCKS_PER_SEC ;
267
+ printf ("Time elapsed is %f seconds\n" , time_spent );
268
+
263
269
264
270
return 0 ;
265
271
}
0 commit comments