I'm trying to fit an activation function with tanh via:
F = aa3 + aa2 * np.tanh(aa0 * x + aa1)
However, the original data (blue) is peculiar in that it needs an asymmetric curvature which the fit (red) is unable to grasp - sharp at the base and loose at the top: tanh fit
Is there a better function you might recommend? Any general advice to think on going forward would be incredibly appreciated!




To obtain an asymmetric curvature one can use a function of this kind (A generalized logistic equation) : $$y(x)=y_{min}+\frac{y_{max}-y_{min}}{1+a\:e^{-b\,x}+\alpha\:e^{-\beta\, x}}$$