mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-29 06:46:22 +02:00
Ongoing changes to symbolic.
This commit is contained in:
parent
9b5a1edb23
commit
41ef7f4c72
8 changed files with 77 additions and 166 deletions
|
|
@ -19,3 +19,7 @@ def normcdfln(x):
|
|||
|
||||
def clip_exp(x):
|
||||
return np.where(x<lim_val, np.where(x>-lim_val, np.exp(x), epsilon), 1/epsilon)
|
||||
|
||||
def differfln(x0, x1):
|
||||
# this is a, hopefully!, a numerically more stable variant of log(erf(x0)-erf(x1)) = log(erfc(x1)-erfc(x0)).
|
||||
return np.where(x0>x1, -x1*x1 + np.log(erfcx(x1)-np.exp(-x0**2+x1**2)*erfcx(x0)), -x0*x0 + np.log(np.exp(-x1**2+x0**2)*erfcx(x1) - erfcx(x0)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue