I am trying to implement the following softplus function:
log(1 + exp(x))
I\'ve tried it with math/numpy and float64 as data type, but whenever
What I'm currently using (slightly inefficient but clean and vectorized):
def safe_softplus(x, limit=30): return np.where(x>limit, x, np.log1p(np.exp(x)))