-
Notifications
You must be signed in to change notification settings - Fork 60
Initialization from demo #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR solves the tests it was supposed to solve.
|
The tests runs fine in Seems like GPflow's Also, looks like there are some test misspecifications? /home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py:211: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
arg_spec = inspect.getargspec(func)
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/labeled_tensor/python/ops/_typecheck.py:233: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
spec = inspect.getargspec(f)
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/python/framework/function.py:807: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
argspec = inspect.getargspec(func)
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py:851: PendingDeprecationWarning: Please use `prob` instead of `pdf`. `pdf` will be deprecated in December 2016.
PendingDeprecationWarning)
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py:851: PendingDeprecationWarning: Please use `prob` instead of `pdf`. `pdf` will be deprecated in December 2016.
PendingDeprecationWarning)
../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py:851: PendingDeprecationWarning: Please use `prob` instead of `pdf`. `pdf` will be deprecated in December 2016.
PendingDeprecationWarning)
../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py:851: PendingDeprecationWarning: Please use `prob` instead of `pdf`. `pdf` will be deprecated in December 2016.
PendingDeprecationWarning)
.../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py:851: PendingDeprecationWarning: Please use `prob` instead of `pdf`. `pdf` will be deprecated in December 2016.
PendingDeprecationWarning)
.../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
.../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
./home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
.EEEEEEE....E.........../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:129: RuntimeWarning: overflow encountered in exp
result = np.log(1. + np.exp(x)) + self._lower
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: overflow encountered in exp
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
/home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/GPflow-0.3.5-py3.5.egg/GPflow/transforms.py:140: RuntimeWarning: divide by zero encountered in log
result = np.log(np.exp(y - self._lower) - np.ones(1, np_float_type))
../home/reinier/anaconda3/envs/gptest/lib/python3.5/site-packages/tensorflow/contrib/distributions/python/ops/distribution.py:851: PendingDeprecationWarning: Please use `prob` instead of `pdf`. `pdf` will be deprecated in December 2016.
PendingDeprecationWarning)
..................EE
======================================================================
ERROR: test_data (testing.test_acquisition._AcquisitionBinaryOperatorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 137, in test_data
super(_AcquisitionBinaryOperatorTest, self).test_data()
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 52, in test_data
l = self.acquisition.make_tf_array(free_vars)
AttributeError: '_AcquisitionBinaryOperatorTest' object has no attribute 'acquisition'
======================================================================
ERROR: test_data_update (testing.test_acquisition._AcquisitionBinaryOperatorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 62, in test_data_update
X = np.vstack((self.acquisition.data[0], design.generate()))
AttributeError: '_AcquisitionBinaryOperatorTest' object has no attribute 'acquisition'
======================================================================
ERROR: test_object_integrity (testing.test_acquisition._AcquisitionBinaryOperatorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 131, in test_object_integrity
self.assertTrue(isinstance(self.acquisition.lhs, GPflowOpt.acquisition.Acquisition),
AttributeError: '_AcquisitionBinaryOperatorTest' object has no attribute 'acquisition'
======================================================================
ERROR: test_result_shape (testing.test_acquisition._AcquisitionBinaryOperatorTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 30, in test_result_shape
l = self.acquisition.make_tf_array(free_vars)
AttributeError: '_AcquisitionBinaryOperatorTest' object has no attribute 'acquisition'
======================================================================
ERROR: test_data (testing.test_acquisition._AcquisitionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 52, in test_data
l = self.acquisition.make_tf_array(free_vars)
AttributeError: '_AcquisitionTests' object has no attribute 'acquisition'
======================================================================
ERROR: test_data_update (testing.test_acquisition._AcquisitionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 62, in test_data_update
X = np.vstack((self.acquisition.data[0], design.generate()))
AttributeError: '_AcquisitionTests' object has no attribute 'acquisition'
======================================================================
ERROR: test_result_shape (testing.test_acquisition._AcquisitionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_acquisition.py", line 30, in test_result_shape
l = self.acquisition.make_tf_array(free_vars)
AttributeError: '_AcquisitionTests' object has no attribute 'acquisition'
======================================================================
ERROR: test_design_compliance (testing.test_design._DesignTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_design.py", line 11, in test_design_compliance
points = self.design.generate()
AttributeError: '_DesignTests' object has no attribute 'design'
======================================================================
ERROR: test_default_initial (testing.test_optimizers._OptimizerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_optimizers.py", line 33, in test_default_initial
self.assertTupleEqual(self.optimizer._initial.shape, (1, 2), msg="Invalid shape of initial points array")
AttributeError: '_OptimizerTests' object has no attribute 'optimizer'
======================================================================
ERROR: test_set_initial (testing.test_optimizers._OptimizerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/reinier/GPflowOpt/testing/test_optimizers.py", line 37, in test_set_initial
self.optimizer.set_initial([1,1])
AttributeError: '_OptimizerTests' object has no attribute 'optimizer'
----------------------------------------------------------------------
Ran 72 tests in 52.479s
FAILED (errors=10) |
|
@javdrher I could take a look and make some edits next weekend; seems like an easy fix. Just don't have time right now, so if you want to give it a go please do. |
|
Those errors are caused because the unittest driver picks up the test classes with a _ in front of it, which nose ignores. I updated the tests to be more according to https://medium.com/@hakibenita/keeping-tests-dry-with-class-based-tests-in-python-e3f2d815124 so they now work with both ways to invoke tests. I adjusted the likelihood variance and now the cholesky problems are gone. It has also helped to get rid of part of the overflow errors from transforms, just two tests failing now. |
…ionality to restart from the initially supplied hyperparameters.
Performs a variety of fixes to make the optimization of the hypers more stable
Codecov Report
@@ Coverage Diff @@
## master #4 +/- ##
=========================================
Coverage ? 99.18%
=========================================
Files ? 6
Lines ? 370
Branches ? 0
=========================================
Hits ? 367
Misses ? 3
Partials ? 0
Continue to review full report at Codecov.
|
Code from the optdemo repository. Not to be merged yet until tests pass.
@1Reinier I'm assuming these are the failures you encountered? Weirdly enough they are solved on my system, however on most other systems they fail. I'm thinking completely resetting the model hyperparameters would be the most robust solution. I added you as a reviewer for the branch if thats ok, feel free to comment on problems.