mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-11 04:52:37 +02:00
Various Py3 related import fixes
This commit is contained in:
parent
82722305c3
commit
5607bd9a19
4 changed files with 5 additions and 3 deletions
|
|
@ -13,6 +13,7 @@ import itertools
|
||||||
import sys
|
import sys
|
||||||
from .verbose_optimization import VerboseOptimization
|
from .verbose_optimization import VerboseOptimization
|
||||||
# import numdifftools as ndt
|
# import numdifftools as ndt
|
||||||
|
from functools import reduce
|
||||||
|
|
||||||
class Model(Parameterized):
|
class Model(Parameterized):
|
||||||
_fail_count = 0 # Count of failed optimization steps (see objective)
|
_fail_count = 0 # Count of failed optimization steps (see objective)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import numpy
|
||||||
np = numpy
|
np = numpy
|
||||||
from .parameter_core import Parameterizable, adjust_name_for_printing, Pickleable
|
from .parameter_core import Parameterizable, adjust_name_for_printing, Pickleable
|
||||||
from .observable_array import ObsAr
|
from .observable_array import ObsAr
|
||||||
|
from functools import reduce
|
||||||
|
|
||||||
###### printing
|
###### printing
|
||||||
__constraints_name__ = "Constraint"
|
__constraints_name__ = "Constraint"
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ class MRD(BayesianGPLVMMiniBatch):
|
||||||
assert len(self.names) == len(self.Ylist), "one name per dataset, or None if Ylist is a dict"
|
assert len(self.names) == len(self.Ylist), "one name per dataset, or None if Ylist is a dict"
|
||||||
|
|
||||||
if inference_method is None:
|
if inference_method is None:
|
||||||
self.inference_method = InferenceMethodList([VarDTC() for _ in xrange(len(self.Ylist))])
|
self.inference_method = InferenceMethodList([VarDTC() for _ in range(len(self.Ylist))])
|
||||||
else:
|
else:
|
||||||
assert isinstance(inference_method, InferenceMethodList), "please provide one inference method per Y in the list and provide it as InferenceMethodList, inference_method given: {}".format(inference_method)
|
assert isinstance(inference_method, InferenceMethodList), "please provide one inference method per Y in the list and provide it as InferenceMethodList, inference_method given: {}".format(inference_method)
|
||||||
self.inference_method = inference_method
|
self.inference_method = inference_method
|
||||||
|
|
@ -338,4 +338,4 @@ class MRD(BayesianGPLVMMiniBatch):
|
||||||
super(MRD, self).__setstate__(state)
|
super(MRD, self).__setstate__(state)
|
||||||
self.kern = self.bgplvms[0].kern
|
self.kern = self.bgplvms[0].kern
|
||||||
self.likelihood = self.bgplvms[0].likelihood
|
self.likelihood = self.bgplvms[0].likelihood
|
||||||
self.parameters_changed()
|
self.parameters_changed()
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class ListDictTestCase(unittest.TestCase):
|
||||||
for k,v in d1.items():
|
for k,v in d1.items():
|
||||||
self.assertListEqual(list(v), list(d2[k]), msg)
|
self.assertListEqual(list(v), list(d2[k]), msg)
|
||||||
def assertArrayListEquals(self, l1, l2):
|
def assertArrayListEquals(self, l1, l2):
|
||||||
for a1, a2 in itertools.izip(l1,l2):
|
for a1, a2 in zip(l1,l2):
|
||||||
np.testing.assert_array_equal(a1, a2)
|
np.testing.assert_array_equal(a1, a2)
|
||||||
|
|
||||||
class Test(ListDictTestCase):
|
class Test(ListDictTestCase):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue