keras2c icon indicating copy to clipboard operation
keras2c copied to clipboard

k2c_activations.c#L114 double to float cast

Open BeverlyCode opened this issue 2 years ago • 0 comments

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.

BeverlyCode avatar Jan 05 '23 12:01 BeverlyCode