You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exp_on_negative_values() function is rather slow, taking most of the time of Softmax(), so calling it twice per element makes the whole Softmax() function be about twice as slow as necessary.
Could this be optimized so that it is only called once per element? Store the exp results in a temporary array (for example, reusing output_data), computing the sum as they're stored, and then applying the scaling to the precomputed exp results rather than computing them again.
The text was updated successfully, but these errors were encountered:
Fixed-point
Softmax()
callsexp_on_negative_values()
twice per element: once to calculate the value of the exp of each elementtflite-micro/tensorflow/lite/kernels/internal/reference/softmax.h
Line 131 in ef64591
and another one a few lines earlier to calculate the sum of all exps
tflite-micro/tensorflow/lite/kernels/internal/reference/softmax.h
Lines 109 to 110 in ef64591
The
exp_on_negative_values()
function is rather slow, taking most of the time ofSoftmax()
, so calling it twice per element makes the wholeSoftmax()
function be about twice as slow as necessary.Could this be optimized so that it is only called once per element? Store the exp results in a temporary array (for example, reusing
output_data
), computing the sum as they're stored, and then applying the scaling to the precomputed exp results rather than computing them again.The text was updated successfully, but these errors were encountered: