Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k2c_activations.c#L114 double to float cast #15

Open
BeverlyCode opened this issue Jan 5, 2023 · 0 comments
Open

k2c_activations.c#L114 double to float cast #15

BeverlyCode opened this issue Jan 5, 2023 · 0 comments

Comments

@BeverlyCode
Copy link

BeverlyCode commented Jan 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant