jaberg/hyperopt — pull request #41 by yamins81 (2011-10-24 22:25:46+00:00)
Title: Feature/more distributions

test_fit_lognormal and test_fit_quantized_lognormal are not working, see trace below

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/Users/dyamins/hyperopt/hyperopt/ in ()

/Users/dyamins/hyperopt/hyperopt/tests/test_theano_gp.pyc in fit_base(A, B, *args, **kwargs)
424 return serial_exp
425
--> 426 return run_then_show(n_iter)
427
428

/Users/dyamins/hyperopt/hyperopt/tests/test_theano_gp.pyc in run_then_show(N)
418 A.show = False
419 A.use_base_suggest = True
--> 420 serial_exp.run(N - 1)
421 A.show = True
422 A.use_base_suggest = False

/Users/dyamins/hyperopt/hyperopt/experiments.pyc in run(self, N)
27
28 for n in xrange(N):
---> 29 trial = algo.suggest(self.trials, self.results, 1)[0]
30 result = bandit.evaluate(trial, base.Ctrl())
31 if not isinstance(result, (dict, base.SON)):

/Users/dyamins/hyperopt/hyperopt/theano_gp.pyc in suggest(self, trials, results, N)
1012 else:
1013 return self.suggest_ivl(
-> 1014 self.suggest_from_model(trials, results, N))
1015
1016 finally:

/Users/dyamins/hyperopt/hyperopt/tests/test_theano_gp.pyc in suggest_from_model(self, trials, results, N)
260 if self.use_base_suggest:
261 return GP_BanditAlgo.suggest_from_model(self,
--> 262 trials, results, N)
263
264 ivls = self.idxs_vals_by_status(trials, results)

/Users/dyamins/hyperopt/hyperopt/theano_gp.pyc in suggest_from_model(self, trials, results, N)
978 self.n_candidates_to_draw)
979
--> 980 candidates_opt = self.GP_EI_optimize(candidates)
981
982 EI_opt = self.GP_EI(candidates_opt)

/Users/dyamins/hyperopt/hyperopt/theano_gp.pyc in GP_EI_optimize(self, x, maxiter)
955 #TODO: bounds from distributions

956 bounds=bounds,
--> 957 iprint=-1)
958
959 #print 'BEST_PT', best_pt

/Users/dyamins/hyperopt/hyperopt/lbfgsb.pyc in fmin_l_bfgs_b(func, x0, fprime, args, approx_grad, bounds, m, factr, pgtol, epsilon, iprint, maxfun, func_and_grad)
186 n_function_evals += 1
187 # Overwrite f and g:

--> 188 f, g = func_and_grad(x)
189 elif task_str.startswith('NEW_X'):
190 # new iteration

/Users/dyamins/hyperopt/hyperopt/lbfgsb.pyc in func_and_grad(x)
137 elif fprime is None:
138 def func_and_grad(x):
--> 139 f, g = func(x, *args)
140 return f, g
141 else:

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Theano-0.4.1-py2.7.egg/theano/compile/function_module.pyc in __call__(self, *args, **kwargs)
608 t0_fn = time.time()
609 try:
--> 610 self.fn()
611 except Exception:
612 if hasattr(self.fn, 'position_of_error'):

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Theano-0.4.1-py2.7.egg/theano/gof/link.pyc in streamline_default_f()
342 old_s[0] = None
343 except Exception:
--> 344 raise_with_op(node)
345 f = streamline_default_f
346 elif nice_errors:

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Theano-0.4.1-py2.7.egg/theano/gof/link.pyc in streamline_default_f()
338 try:
339 for thunk, node, old_storage in zip(thunks, order, post_thunk_old_storage):
--> 340 thunk()
341 for old_s in old_storage:
342 old_s[0] = None

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Theano-0.4.1-py2.7.egg/theano/gof/op.pyc in rval(p, i, o, n)
544
545 def rval(p=p, i=node_input_storage, o=node_output_storage, n=node):
--> 546 r = p(n, [x[0] for x in i], o)
547 for o in node.outputs:
548 compute_map[o][0] = True

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/Theano-0.4.1-py2.7.egg/theano/sandbox/linalg/ops.pyc in perform(self, node, inputs, output_storage)
383 A, b = inputs
384 #TODO: use the A_structure to go faster

--> 385 output_storage[0][0] = scipy.linalg.solve(A,b)
386 solve = Solve() # general solve
387

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/scipy/linalg/basic.pyc in solve(a, b, sym_pos, lower, overwrite_a, overwrite_b, debug)
47
48 """
---> 49 a1, b1 = map(asarray_chkfinite,(a,b))
50 if len(a1.shape) != 2 or a1.shape[0] != a1.shape[1]:
51 raise ValueError, 'expected square matrix'

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/numpy/lib/function_base.pyc in asarray_chkfinite(a)
545 and (_nx.isnan(a).any() or _nx.isinf(a).any()):
546 raise ValueError(
--> 547 "array must not contain infs or NaNs")
548 return a
549

ValueError: array must not contain infs or NaNs