mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-02 14:45:15 +02:00
merging with the gpy devel branch to be in sync with the latest code and make pull request again ..
This commit is contained in:
commit
f0f1a183b0
12 changed files with 204 additions and 40 deletions
|
|
@ -16,8 +16,9 @@ addons:
|
|||
env:
|
||||
- PYTHON_VERSION=2.7
|
||||
#- PYTHON_VERSION=3.3
|
||||
- PYTHON_VERSION=3.4
|
||||
#- PYTHON_VERSION=3.4
|
||||
- PYTHON_VERSION=3.5
|
||||
- PYTHON_VERSION=3.6
|
||||
|
||||
before_install:
|
||||
- wget https://github.com/mzwiessele/travis_scripts/raw/master/download_miniconda.sh
|
||||
|
|
|
|||
92
CHANGELOG.md
92
CHANGELOG.md
|
|
@ -1,5 +1,97 @@
|
|||
# Changelog
|
||||
|
||||
## v1.7.6 (2017-06-19)
|
||||
|
||||
### Fix
|
||||
|
||||
* Appveyor not uploading to testpypi for now. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.7.5 → 1.7.6. [mzwiessele]
|
||||
|
||||
|
||||
## v1.7.5 (2017-06-19)
|
||||
|
||||
### Fix
|
||||
|
||||
* Splitting forecast tests into 3 to circumvent 10 minute stop of travis. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.7.4 → 1.7.5. [mzwiessele]
|
||||
|
||||
|
||||
## v1.7.4 (2017-06-19)
|
||||
|
||||
### Fix
|
||||
|
||||
* Paramz version for parallel optimization fix. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.7.3 → 1.7.4. [mzwiessele]
|
||||
|
||||
|
||||
## v1.7.3 (2017-06-19)
|
||||
|
||||
### Fix
|
||||
|
||||
* Appveyor build failing. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.7.2 → 1.7.3. [mzwiessele]
|
||||
|
||||
|
||||
## v1.7.2 (2017-06-17)
|
||||
|
||||
### Fix
|
||||
|
||||
* Appveyor build python 3.6. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.7.1 → 1.7.2. [mzwiessele]
|
||||
|
||||
|
||||
## v1.7.1 (2017-06-17)
|
||||
|
||||
### Fix
|
||||
|
||||
* Appveyor build python 3.6. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.7.0 → 1.7.1. [mzwiessele]
|
||||
|
||||
|
||||
## v1.7.0 (2017-06-17)
|
||||
|
||||
### Fix
|
||||
|
||||
* Support for 3.5 and higher now that 3.6 is out. [mzwiessele]
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.6.3 → 1.7.0. [mzwiessele]
|
||||
|
||||
|
||||
## v1.6.3 (2017-06-17)
|
||||
|
||||
### Other
|
||||
|
||||
* Bump version: 1.6.2 → 1.6.3. [mzwiessele]
|
||||
|
||||
* Merge pull request #504 from rmcantin/devel. [Max Zwiessele]
|
||||
|
||||
* Fix python 2-3 compatibility. [Ruben Martinez-Cantin]
|
||||
|
||||
* Merge pull request #511 from dirmeier/devel. [Max Zwiessele]
|
||||
|
||||
* Added LICENSE file to MANIFEST.in. [dirmeier]
|
||||
|
||||
|
||||
## v1.6.2 (2017-04-12)
|
||||
|
||||
### Fix
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "1.6.2"
|
||||
__version__ = "1.7.7"
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class Binomial(Likelihood):
|
|||
"""
|
||||
N = Y_metadata['trials']
|
||||
np.testing.assert_array_equal(N.shape, y.shape)
|
||||
|
||||
|
||||
Ny = N-y
|
||||
t1 = np.zeros(y.shape)
|
||||
t2 = np.zeros(y.shape)
|
||||
|
|
@ -132,6 +132,7 @@ class Binomial(Likelihood):
|
|||
t2[Ny>0] = -(Ny[Ny>0])/np.square(1.-inv_link_f[Ny>0])
|
||||
return t1+t2
|
||||
|
||||
|
||||
def d3logpdf_dlink3(self, inv_link_f, y, Y_metadata=None):
|
||||
"""
|
||||
Third order derivative log-likelihood function at y given inverse link of f w.r.t inverse link of f
|
||||
|
|
|
|||
|
|
@ -306,11 +306,7 @@ class StateSpaceKernelsTests(np.testing.TestCase):
|
|||
gp_kernel=gp_kernel,
|
||||
mean_compare_decimal=2, var_compare_decimal=2)
|
||||
|
||||
def test_forecast(self,):
|
||||
"""
|
||||
Test time-series forecasting.
|
||||
"""
|
||||
|
||||
def test_forecast_regular(self,):
|
||||
# Generate data ->
|
||||
np.random.seed(339) # seed the random number generator
|
||||
#import pdb; pdb.set_trace()
|
||||
|
|
@ -334,37 +330,102 @@ class StateSpaceKernelsTests(np.testing.TestCase):
|
|||
|
||||
#import pdb; pdb.set_trace()
|
||||
|
||||
def get_new_kernels():
|
||||
periodic_kernel = GPy.kern.StdPeriodic(1,active_dims=[0,])
|
||||
gp_kernel = GPy.kern.Linear(1, active_dims=[0,]) + GPy.kern.Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
gp_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
gp_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
periodic_kernel = GPy.kern.StdPeriodic(1,active_dims=[0,])
|
||||
gp_kernel = GPy.kern.Linear(1, active_dims=[0,]) + GPy.kern.Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
gp_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
gp_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
|
||||
periodic_kernel = GPy.kern.sde_StdPeriodic(1,active_dims=[0,])
|
||||
ss_kernel = GPy.kern.sde_Linear(1,X,active_dims=[0,]) + \
|
||||
GPy.kern.sde_Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
periodic_kernel = GPy.kern.sde_StdPeriodic(1,active_dims=[0,])
|
||||
ss_kernel = GPy.kern.sde_Linear(1,X,active_dims=[0,]) + \
|
||||
GPy.kern.sde_Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
|
||||
ss_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
ss_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
ss_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
ss_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
|
||||
return ss_kernel, gp_kernel
|
||||
|
||||
ss_kernel, gp_kernel = get_new_kernels()
|
||||
self.run_for_model(X_train, Y_train, ss_kernel, kalman_filter_type = 'regular',
|
||||
use_cython=False, optimize_max_iters=30, check_gradients=True,
|
||||
predict_X=X_test,
|
||||
gp_kernel=gp_kernel,
|
||||
mean_compare_decimal=2, var_compare_decimal=2)
|
||||
|
||||
def test_forecast_svd(self,):
|
||||
# Generate data ->
|
||||
np.random.seed(339) # seed the random number generator
|
||||
#import pdb; pdb.set_trace()
|
||||
(X,Y) = generate_sine_data(x_points=None, sin_period=5.0, sin_ampl=5.0, noise_var=2.0,
|
||||
plot = False, points_num=100, x_interval = (0, 40), random=True)
|
||||
|
||||
(X1,Y1) = generate_linear_data(x_points=X, tangent=1.0, add_term=20.0, noise_var=0.0,
|
||||
plot = False, points_num=100, x_interval = (0, 40), random=True)
|
||||
|
||||
Y = Y + Y1
|
||||
|
||||
X_train = X[X <= 20]
|
||||
Y_train = Y[X <= 20]
|
||||
X_test = X[X > 20]
|
||||
Y_test = Y[X > 20]
|
||||
|
||||
X.shape = (X.shape[0],1); Y.shape = (Y.shape[0],1)
|
||||
X_train.shape = (X_train.shape[0],1); Y_train.shape = (Y_train.shape[0],1)
|
||||
X_test.shape = (X_test.shape[0],1); Y_test.shape = (Y_test.shape[0],1)
|
||||
# Generate data <-
|
||||
|
||||
#import pdb; pdb.set_trace()
|
||||
|
||||
periodic_kernel = GPy.kern.StdPeriodic(1,active_dims=[0,])
|
||||
gp_kernel = GPy.kern.Linear(1, active_dims=[0,]) + GPy.kern.Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
gp_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
gp_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
|
||||
periodic_kernel = GPy.kern.sde_StdPeriodic(1,active_dims=[0,])
|
||||
ss_kernel = GPy.kern.sde_Linear(1,X,active_dims=[0,]) + \
|
||||
GPy.kern.sde_Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
|
||||
ss_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
ss_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
|
||||
ss_kernel, gp_kernel = get_new_kernels()
|
||||
self.run_for_model(X_train, Y_train, ss_kernel, kalman_filter_type = 'svd',
|
||||
use_cython=False, optimize_max_iters=30, check_gradients=False,
|
||||
predict_X=X_test,
|
||||
gp_kernel=gp_kernel,
|
||||
mean_compare_decimal=2, var_compare_decimal=2)
|
||||
|
||||
ss_kernel, gp_kernel = get_new_kernels()
|
||||
def test_forecast_svd_cython(self,):
|
||||
# Generate data ->
|
||||
np.random.seed(339) # seed the random number generator
|
||||
#import pdb; pdb.set_trace()
|
||||
(X,Y) = generate_sine_data(x_points=None, sin_period=5.0, sin_ampl=5.0, noise_var=2.0,
|
||||
plot = False, points_num=100, x_interval = (0, 40), random=True)
|
||||
|
||||
(X1,Y1) = generate_linear_data(x_points=X, tangent=1.0, add_term=20.0, noise_var=0.0,
|
||||
plot = False, points_num=100, x_interval = (0, 40), random=True)
|
||||
|
||||
Y = Y + Y1
|
||||
|
||||
X_train = X[X <= 20]
|
||||
Y_train = Y[X <= 20]
|
||||
X_test = X[X > 20]
|
||||
Y_test = Y[X > 20]
|
||||
|
||||
X.shape = (X.shape[0],1); Y.shape = (Y.shape[0],1)
|
||||
X_train.shape = (X_train.shape[0],1); Y_train.shape = (Y_train.shape[0],1)
|
||||
X_test.shape = (X_test.shape[0],1); Y_test.shape = (Y_test.shape[0],1)
|
||||
# Generate data <-
|
||||
|
||||
#import pdb; pdb.set_trace()
|
||||
|
||||
periodic_kernel = GPy.kern.StdPeriodic(1,active_dims=[0,])
|
||||
gp_kernel = GPy.kern.Linear(1, active_dims=[0,]) + GPy.kern.Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
gp_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
gp_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
|
||||
periodic_kernel = GPy.kern.sde_StdPeriodic(1,active_dims=[0,])
|
||||
ss_kernel = GPy.kern.sde_Linear(1,X,active_dims=[0,]) + \
|
||||
GPy.kern.sde_Bias(1, active_dims=[0,]) + periodic_kernel
|
||||
|
||||
ss_kernel.std_periodic.lengthscale.constrain_bounded(0.25, 1000)
|
||||
ss_kernel.std_periodic.period.constrain_bounded(0.15, 100)
|
||||
|
||||
self.run_for_model(X_train, Y_train, ss_kernel, kalman_filter_type = 'svd',
|
||||
use_cython=True, optimize_max_iters=30, check_gradients=False,
|
||||
predict_X=X_test,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ class InferenceGPEP(unittest.TestCase):
|
|||
inference_method=inf,
|
||||
likelihood=lik)
|
||||
K = self.model.kern.K(X)
|
||||
|
||||
post_params, ga_approx, cav_params, log_Z_tilde = self.model.inference_method.expectation_propagation(K, ObsAr(Y), lik, None)
|
||||
|
||||
mu_tilde = ga_approx.v / ga_approx.tau.astype(float)
|
||||
|
|
|
|||
|
|
@ -206,7 +206,10 @@ def authorize_download(dataset_name=None):
|
|||
|
||||
def download_data(dataset_name=None):
|
||||
"""Check with the user that the are happy with terms and conditions for the data set, then download it."""
|
||||
import itertools
|
||||
try:
|
||||
from itertools import zip_longest
|
||||
except ImportError:
|
||||
from itertools import izip_longest as zip_longest
|
||||
|
||||
dr = data_resources[dataset_name]
|
||||
if not authorize_download(dataset_name):
|
||||
|
|
@ -220,8 +223,8 @@ def download_data(dataset_name=None):
|
|||
if 'suffices' in dr: zip_urls += (dr['suffices'], )
|
||||
else: zip_urls += ([],)
|
||||
|
||||
for url, files, save_names, suffices in itertools.zip_longest(*zip_urls, fillvalue=[]):
|
||||
for f, save_name, suffix in itertools.zip_longest(files, save_names, suffices, fillvalue=None):
|
||||
for url, files, save_names, suffices in zip_longest(*zip_urls, fillvalue=[]):
|
||||
for f, save_name, suffix in zip_longest(files, save_names, suffices, fillvalue=None):
|
||||
download_url(os.path.join(url,f), dataset_name, save_name, suffix=suffix)
|
||||
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ recursive-include GPy *.c
|
|||
recursive-include GPy *.h
|
||||
recursive-include GPy *.pyx
|
||||
|
||||
# LICENSE
|
||||
include LICENSE.txt
|
||||
|
||||
# Testing
|
||||
#include GPy/testing/baseline/*.png
|
||||
#include GPy/testing/pickle_test.pickle
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ If that is the case, it is best to clean the repo and reinstall.
|
|||
[<img src="https://upload.wikimedia.org/wikipedia/commons/8/8e/OS_X-Logo.svg" height=40px>](http://www.apple.com/osx/)
|
||||
[<img src="https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg" height=40px>](https://en.wikipedia.org/wiki/List_of_Linux_distributions)
|
||||
|
||||
Python 2.7, 3.4 and higher
|
||||
Python 2.7, 3.5 and higher
|
||||
|
||||
## Citation
|
||||
|
||||
|
|
|
|||
22
appveyor.yml
22
appveyor.yml
|
|
@ -3,12 +3,14 @@ environment:
|
|||
secure: 8/ZjXFwtd1S7ixd7PJOpptupKKEDhm2da/q3unabJ00=
|
||||
COVERALLS_REPO_TOKEN:
|
||||
secure: d3Luic/ESkGaWnZrvWZTKrzO+xaVwJWaRCEP0F+K/9DQGPSRZsJ/Du5g3s4XF+tS
|
||||
gpy_version: 1.6.2
|
||||
gpy_version: 1.7.7
|
||||
matrix:
|
||||
- PYTHON_VERSION: 2.7
|
||||
MINICONDA: C:\Miniconda-x64
|
||||
- PYTHON_VERSION: 3.5
|
||||
MINICONDA: C:\Miniconda35-x64
|
||||
- PYTHON_VERSION: 3.6
|
||||
MINICONDA: C:\Miniconda36-x64
|
||||
|
||||
#configuration:
|
||||
# - Debug
|
||||
|
|
@ -62,21 +64,21 @@ deploy_script:
|
|||
- echo test >> %USERPROFILE%\\.pypirc
|
||||
- echo[
|
||||
- echo [pypi] >> %USERPROFILE%\\.pypirc
|
||||
- echo username:maxz >> %USERPROFILE%\\.pypirc
|
||||
- echo password:%pip_access% >> %USERPROFILE%\\.pypirc
|
||||
- echo username = maxz >> %USERPROFILE%\\.pypirc
|
||||
- echo password = %pip_access% >> %USERPROFILE%\\.pypirc
|
||||
- echo[
|
||||
- echo [test] >> %USERPROFILE%\\.pypirc
|
||||
- echo repository:https://test.pypi.org/legacy/ >> %USERPROFILE%\\.pypirc
|
||||
- echo username:maxz >> %USERPROFILE%\\.pypirc
|
||||
- echo password:%pip_access% >> %USERPROFILE%\\.pypirc
|
||||
- echo repository = https://testpypi.python.org/pypi >> %USERPROFILE%\\.pypirc
|
||||
- echo username = maxz >> %USERPROFILE%\\.pypirc
|
||||
- echo password = %pip_access% >> %USERPROFILE%\\.pypirc
|
||||
- ps: >-
|
||||
if ($env:APPVEYOR_REPO_BRANCH -eq 'devel') {
|
||||
twine upload --skip-existing -r test dist/*
|
||||
If ($env:APPVEYOR_REPO_BRANCH -eq 'devel') {
|
||||
echo not deploying on devel # twine upload --skip-existing -r test dist/*
|
||||
}
|
||||
elseif ($env:APPVEYOR_REPO_BRANCH -eq 'deploy') {
|
||||
ElseIf ($env:APPVEYOR_REPO_BRANCH -eq 'deploy') {
|
||||
twine upload --skip-existing dist/*
|
||||
}
|
||||
else {
|
||||
Else {
|
||||
echo not deploying on other branches
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 1.6.2
|
||||
current_version = 1.7.7
|
||||
tag = True
|
||||
commit = True
|
||||
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -150,7 +150,7 @@ setup(name = 'GPy',
|
|||
py_modules = ['GPy.__init__'],
|
||||
test_suite = 'GPy.testing',
|
||||
setup_requires = ['numpy>=1.7'],
|
||||
install_requires = ['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz>=0.6.9'],
|
||||
install_requires = ['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz>=0.7.4'],
|
||||
extras_require = {'docs':['sphinx'],
|
||||
'optional':['mpi4py',
|
||||
'ipython>=4.0.0',
|
||||
|
|
@ -169,8 +169,8 @@ setup(name = 'GPy',
|
|||
'Operating System :: Microsoft :: Windows',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Framework :: IPython',
|
||||
'Intended Audience :: Science/Research',
|
||||
'Intended Audience :: Developers',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue