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
|
||||
from .verbose_optimization import VerboseOptimization
|
||||
# import numdifftools as ndt
|
||||
from functools import reduce
|
||||
|
||||
class Model(Parameterized):
|
||||
_fail_count = 0 # Count of failed optimization steps (see objective)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import numpy
|
|||
np = numpy
|
||||
from .parameter_core import Parameterizable, adjust_name_for_printing, Pickleable
|
||||
from .observable_array import ObsAr
|
||||
from functools import reduce
|
||||
|
||||
###### printing
|
||||
__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"
|
||||
|
||||
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:
|
||||
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
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class ListDictTestCase(unittest.TestCase):
|
|||
for k,v in d1.items():
|
||||
self.assertListEqual(list(v), list(d2[k]), msg)
|
||||
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)
|
||||
|
||||
class Test(ListDictTestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue