Dear community, I have opened a couple of PRs on stdlib to include some intrinsic functions and activation functions that could be used as base for Neural Networks.
The intrinsic function PR contains right now only:
stdlib_sum
andstdlib_sum_kahan
: are equivalents ofsum
forreal
andcomplex
arrays. The 1D implementations are based on fsum and fsum_kahan. The N-D implementations build on top of the (N-1)-Dstdlib_dot_product
andstdlib_dot_product_kahan
: are equivalents ofdot_product
forreal
andcomplex
arrays. Based on fprod and fprod_kahan.
The activations PR contains the following functions for all real kinds: gaussian
, elu
, relu
, gelu
, gelu_approx
, selu
, sigmoid
, silu
, step
, tanh
(using a fast approximation), Softmax
, LogSoftmax
, Softplus
, and their 1st derivatives *_grad
.
I would like to collect your thoughts on how to move forward with both as I think they have points in common:
- For the case of
sum
anddot_product
, these implementations offer both fast and accurate results (at least for 1D). So, would it be interesting to expose them assum
anddot_product
or does the prefixstdlib_
makes sense to avoid conflicts? should a different naming be used? - In case a fast but downgraded-precision version is implemented (like for
tanh
orerf
) which naming would be appropriate? I’ve been usingf*
(Fortran Fast?) ex:
ftanh
,ferf
. Moving them to stdlib I thinking the naming should be agreed upon. - For the activation functions, should the hard coded gradients be there? better to drop this and only provide the functions?
Which other considerations would you recommend at this stage?
Thank you