I have this interesting piece of code:
def get_unit_sigmoid_func(alpha: float) -> Callable[[float], float]:
return lambda x, alpha=alpha: 1. / (1 + (1 / np.where(x == 0, 0.01, x) - 1) ** alpha)
I just don't understand what the point of this is. Why wouldn't they write something like:
def get_unit_sigmoid_func(alpha,x):
return 1 / (1+(1/np.where(x==0,0.01,x)-1)**alpha)
Is there any advantage to the way it's written in the first way?