GiorgosXou/NeuralNetworks

ISSUE WITH #define ACTIVATION__PER_LAYER on Ardunio DUE

KillianVoy opened this issue ยท 1 comments

Hello, I am currentlly trying to create a NN with different types of activation functions per layers, however when I try to use #define ACTIVATION__PER_LAYER, I get the following errors on Arduino IDE :

 ๐—จ๐—ฆ๐—œ๐—ก๐—š [ฦ’x] |โ€ฃ Sigmoid |โ€ฃ Tanh |โŒฅ|


 #pragma message( STR(INFORMATION) )
                                   ^
C:\Users\...\Arduino\libraries\NeuralNetwork\src/NeuralNetwork.h:900:9: error: 'activation_Function_ptrs' declared as an 'inline' field
         };
         ^
C:\Users\...\Arduino\libraries\NeuralNetwork\src/NeuralNetwork.h:900:9: error: 'constexpr' needed for in-class initialization of static data member 'float (NeuralNetwork::Layer::* const NeuralNetwork::activation_Function_ptrs [2])(const float&)' of non-integral type [-fpermissive]
C:\Users\...\Arduino\libraries\NeuralNetwork\src/NeuralNetwork.h:943:13: error: 'derivative_Function_ptrs' declared as an 'inline' field
             };
             ^
C:\Users\...Documents\Arduino\libraries\NeuralNetwork\src/NeuralNetwork.h:943:13: error: 'constexpr' needed for in-class initialization of static data member 'float (NeuralNetwork::Layer::* const NeuralNetwork::derivative_Function_ptrs [2])(const float&)' of non-integral type [-fpermissive]

exit status 1

Compilation error: exit status 1"

How can i fix this ? I believe this might be an issue with the gcc version ?

Just fixed it, everything should work just fine now. I'm pretty sure it was a gcc version issue releated to inline declaration, indeed.

discord reference