mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-27 14:25:16 +02:00
format on save
This commit is contained in:
parent
4685d10463
commit
3695763a5d
1 changed files with 4 additions and 2 deletions
|
|
@ -4,17 +4,19 @@ import scipy as sp
|
||||||
import GPy
|
import GPy
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
|
|
||||||
class MiscTests(np.testing.TestCase):
|
class MiscTests(np.testing.TestCase):
|
||||||
"""
|
"""
|
||||||
Testing some utilities of misc
|
Testing some utilities of misc
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self._lim_val = np.finfo(np.float64).max
|
self._lim_val = np.finfo(np.float64).max
|
||||||
self._lim_val_exp = np.log(self._lim_val)
|
self._lim_val_exp = np.log(self._lim_val)
|
||||||
|
|
||||||
def test_safe_exp_upper(self):
|
def test_safe_exp_upper(self):
|
||||||
with warnings.catch_warnings(record=True) as w:
|
with warnings.catch_warnings(record=True) as w:
|
||||||
warnings.simplefilter('always') # always print
|
warnings.simplefilter("always") # always print
|
||||||
assert np.isfinite(np.exp(self._lim_val_exp))
|
assert np.isfinite(np.exp(self._lim_val_exp))
|
||||||
assert np.isinf(np.exp(self._lim_val_exp + 1))
|
assert np.isinf(np.exp(self._lim_val_exp + 1))
|
||||||
assert np.isfinite(GPy.util.misc.safe_exp(self._lim_val_exp + 1))
|
assert np.isfinite(GPy.util.misc.safe_exp(self._lim_val_exp + 1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue