I'm attempting to use my own modified version of the logsumexp()
from here:
https://github.com/scipy/scipy/blob/v0.14.0/scipy/misc/common.py#L18
On line 85, is this calculation:
out = log(sum(exp(a - a_max), axis=0))
But I have a threshold and I don't want a - a_max
to exceed that threshold.
Is there a way to do a conditional calculation, which would allow the subtraction to take place only if the difference isn't less than the threshold.
So something like:
out = log(sum(exp( (a - a_max < threshold) ? threshold : a - a_max), axis = 0))
a
againstthreshold + a_max
, i.e. a modified threshold.