mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-03 00:32:39 +02:00
[holy] example was run in examples
This commit is contained in:
parent
17fc844304
commit
38879caea6
6 changed files with 19 additions and 108 deletions
|
|
@ -1 +1 @@
|
|||
[Humans](https://github.com/SheffieldML/GPy/graphs/contributors)
|
||||
[GPy Authors](https://github.com/SheffieldML/GPy/graphs/contributors)
|
||||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.8.8dev3"
|
||||
__version__ = "0.8.8dev5"
|
||||
|
|
|
|||
|
|
@ -1,89 +0,0 @@
|
|||
# Copyright (c) 2012-2014, GPy authors (see AUTHORS.txt).
|
||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||
|
||||
import numpy as np
|
||||
try:
|
||||
from matplotlib import pyplot as pb
|
||||
except:
|
||||
pass
|
||||
import GPy
|
||||
pb.ion()
|
||||
pb.close('all')
|
||||
|
||||
X1 = np.arange(3)[:,None]
|
||||
X2 = np.arange(4)[:,None]
|
||||
I1 = np.zeros_like(X1)
|
||||
I2 = np.ones_like(X2)
|
||||
|
||||
_X = np.vstack([ X1, X2 ])
|
||||
_I = np.vstack([ I1, I2 ])
|
||||
|
||||
X = np.hstack([ _X, _I ])
|
||||
|
||||
Y1 = np.sin(X1/8.)
|
||||
Y2 = np.cos(X2/8.)
|
||||
|
||||
Bias = GPy.kern.Bias(1,active_dims=[0])
|
||||
Coreg = GPy.kern.Coregionalize(1,2,active_dims=[1])
|
||||
K = Bias.prod(Coreg,name='X')
|
||||
|
||||
#K.coregion.W = 0
|
||||
#print K.coregion.W
|
||||
#print Bias.K(_X,_X)
|
||||
#print K.K(X,X)
|
||||
#pb.matshow(K.K(X,X))
|
||||
|
||||
Mlist = [GPy.kern.Matern32(1,lengthscale=20.,name="Mat")]
|
||||
kern = GPy.util.multioutput.LCM(input_dim=1,num_outputs=2,kernels_list=Mlist,name='H')
|
||||
kern.B.W = 0
|
||||
kern.B.kappa = 1.
|
||||
#kern.B.W.fix()
|
||||
#kern.B.kappa.fix()
|
||||
#m = GPy.models.GPCoregionalizedRegression(X_list=[X1,X2], Y_list=[Y1,Y2], kernel=kern)
|
||||
|
||||
|
||||
Z1 = np.array([1.5,2.5])[:,None]
|
||||
|
||||
m = GPy.models.SparseGPCoregionalizedRegression(X_list=[X1], Y_list=[Y1], Z_list = [Z1], kernel=kern)
|
||||
#m.optimize()
|
||||
m.checkgrad(verbose=1)
|
||||
|
||||
"""
|
||||
fig = pb.figure()
|
||||
ax0 = fig.add_subplot(211)
|
||||
ax1 = fig.add_subplot(212)
|
||||
slices = GPy.util.multioutput.get_slices([Y1,Y2])
|
||||
m.plot(fixed_inputs=[(1,0)],which_data_rows=slices[0],ax=ax0)
|
||||
#m.plot(fixed_inputs=[(1,1)],which_data_rows=slices[1],ax=ax1)
|
||||
"""
|
||||
|
||||
|
||||
|
||||
"""
|
||||
|
||||
X1 = 100 * np.random.rand(100)[:,None]
|
||||
X2 = 100 * np.random.rand(100)[:,None]
|
||||
#X1.sort()
|
||||
#X2.sort()
|
||||
|
||||
Y1 = np.sin(X1/10.) + np.random.rand(100)[:,None]
|
||||
Y2 = np.cos(X2/10.) + np.random.rand(100)[:,None]
|
||||
|
||||
|
||||
|
||||
|
||||
Mlist = [GPy.kern.Matern32(1,lengthscale=20.,name="Mat")]
|
||||
kern = GPy.util.multioutput.LCM(input_dim=1,num_outputs=12,kernels_list=Mlist,name='H')
|
||||
|
||||
|
||||
m = GPy.models.GPCoregionalizedRegression(X_list=[X1,X2], Y_list=[Y1,Y2], kernel=kern)
|
||||
m.optimize()
|
||||
|
||||
fig = pb.figure()
|
||||
ax0 = fig.add_subplot(211)
|
||||
ax1 = fig.add_subplot(212)
|
||||
slices = GPy.util.multioutput.get_slices([Y1,Y2])
|
||||
m.plot(fixed_inputs=[(1,0)],which_data_rows=slices[0],ax=ax0)
|
||||
m.plot(fixed_inputs=[(1,1)],which_data_rows=slices[1],ax=ax1)
|
||||
|
||||
"""
|
||||
|
|
@ -37,22 +37,22 @@ extensions = [
|
|||
]
|
||||
|
||||
#----- Autodoc
|
||||
#import sys
|
||||
#try:
|
||||
# from unittest.mock import MagicMock
|
||||
#except:
|
||||
# from mock import Mock as MagicMock
|
||||
import sys
|
||||
try:
|
||||
from unittest.mock import MagicMock
|
||||
except:
|
||||
from mock import Mock as MagicMock
|
||||
|
||||
#class Mock(MagicMock):
|
||||
# @classmethod
|
||||
# def __getattr__(cls, name):
|
||||
# return Mock()
|
||||
class Mock(MagicMock):
|
||||
@classmethod
|
||||
def __getattr__(cls, name):
|
||||
return Mock()
|
||||
|
||||
#MOCK_MODULES = ['scipy.linalg.blas', 'blas', 'scipy.optimize', 'scipy.optimize.linesearch', 'scipy.linalg', 'scipy', 'scipy.special', 'scipy.integrate', 'scipy.io', 'scipy.stats', 'GPy.util.choleskies_cython',
|
||||
# 'sympy', 'sympy.utilities.iterables', 'sympy.utilities.lambdify', 'sympy.utilities', 'sympy.utilities.codegen', 'sympy.core.cache', 'sympy.core', 'sympy.parsing', 'sympy.parsing.sympy_parser',
|
||||
# 'nose', 'nose.tools']
|
||||
MOCK_MODULES = ['scipy.linalg.blas', 'blas', 'scipy.optimize', 'scipy.optimize.linesearch', 'scipy.linalg', 'scipy', 'scipy.special', 'scipy.integrate', 'scipy.io', 'scipy.stats', 'GPy.util.choleskies_cython',
|
||||
'sympy', 'sympy.utilities.iterables', 'sympy.utilities.lambdify', 'sympy.utilities', 'sympy.utilities.codegen', 'sympy.core.cache', 'sympy.core', 'sympy.parsing', 'sympy.parsing.sympy_parser',
|
||||
'nose', 'nose.tools']
|
||||
|
||||
#sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
||||
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
import sphinx_rtd_theme
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ html_theme = 'sphinx_rtd_theme'
|
|||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
#html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 0.8.8dev3
|
||||
current_version = 0.8.8
|
||||
tag = True
|
||||
commit = True
|
||||
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -49,8 +49,8 @@ def read_to_rst(fname):
|
|||
try:
|
||||
import pypandoc
|
||||
rstname = "{}.{}".format(os.path.splitext(fname)[0], 'rst')
|
||||
pypandoc.convert(read(fname), 'rst', format='md', outputfile=rstname)
|
||||
return read(rstname)
|
||||
return pypandoc.convert(read(fname), 'rst', format='md')
|
||||
#return read(rstname)
|
||||
except ImportError:
|
||||
return read(fname)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue