mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-20 15:38:08 +02:00
Added new link-function to enable derivative sign values as in Riihimaki & Vehtari (2010) paper
This commit is contained in:
parent
f4629c89cd
commit
d862fc71e2
2 changed files with 39 additions and 1 deletions
|
|
@ -2,11 +2,12 @@ import numpy as np
|
|||
import scipy
|
||||
from scipy.special import cbrt
|
||||
from GPy.models import GradientChecker
|
||||
import random
|
||||
_lim_val = np.finfo(np.float64).max
|
||||
_lim_val_exp = np.log(_lim_val)
|
||||
_lim_val_square = np.sqrt(_lim_val)
|
||||
_lim_val_cube = cbrt(_lim_val)
|
||||
from GPy.likelihoods.link_functions import Identity, Probit, Cloglog, Log, Log_ex_1, Reciprocal, Heaviside
|
||||
from GPy.likelihoods.link_functions import Identity, Probit, Cloglog, Log, Log_ex_1, Reciprocal, Heaviside, ScaledProbit
|
||||
|
||||
class LinkFunctionTests(np.testing.TestCase):
|
||||
def setUp(self):
|
||||
|
|
@ -123,6 +124,11 @@ class LinkFunctionTests(np.testing.TestCase):
|
|||
link = Probit()
|
||||
lim_of_inf = _lim_val
|
||||
self.check_gradient(link, lim_of_inf, test_lim=True)
|
||||
|
||||
def test_scaledprobit_gradients(self):
|
||||
link = ScaledProbit(nu=random.random())
|
||||
lim_of_inf = _lim_val
|
||||
self.check_gradient(link, lim_of_inf, test_lim=True)
|
||||
|
||||
def test_Cloglog_gradients(self):
|
||||
link = Cloglog()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue