keras2c
keras2c copied to clipboard
k2c_activations.c#L114 double to float cast
https://github.com/f0uriest/keras2c/blob/master/include/k2c_activations.c#L114
change this line to x[i] = 1.f/(1.f+expf(-x[i]));
you forgot the .f on the end of the 1's so it's causing a double to float cast
also one other little thing, in the exported weights the weight float arrays could be defined as const in the output .c file since there should be no point where the weights are ever changed during inference.