esiivola / gpygradients Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Could you give an example of using monotonicity information for the latent function in Gaussian Process classification as described in the paper http://proceedings.mlr.press/v9/riihimaki10a/riihimaki10a.pdf with your implementation? I tried using a Bernoulli likelihood with a Probit link function as in the example:
# Kernel
se = GPy.kern.RBF(input_dim=1, lengthscale=.1, variance=0.01)
se_d = GPy.kern.DiffKern(se, 0)
# Likelihoods
bernoulli = GPy.likelihoods.Bernoulli(gp_link=GPy.likelihoods.link_functions.Probit(nu=100, fixed=False))
probit = GPy.likelihoods.Binomial(gp_link=GPy.likelihoods.link_functions.Probit(nu=100, fixed=False))
# Model
m = GPy.core.MultioutputGP(X_list=[X, Xd], Y_list=[y, yd],
kernel_list=[se, se_d],
likelihood_list=[bernoulli, probit],
inference_method=GPy.inference.latent_function_inference.EP(ep_mode="nested"))
But got the following NotImplementedError:
Traceback (most recent call last):
File "<input>", line 14, in <module>
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/parameterized.py", line 54, in __call__
self.initialize_parameter()
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/core/parameter_core.py", line 331, in initialize_parameter
self.trigger_update()
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/core/updateable.py", line 79, in trigger_update
self._trigger_params_changed(trigger_parent)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/core/parameter_core.py", line 128, in _trigger_params_changed
self.notify_observers(None, None if trigger_parent else -np.inf)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/core/observable.py", line 91, in notify_observers
[callble(self, which=which) for _, _, callble in self.observers]
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/core/observable.py", line 91, in <listcomp>
[callble(self, which=which) for _, _, callble in self.observers]
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/paramz/core/parameter_core.py", line 498, in _parameters_changed_notification
self.parameters_changed()
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/core/gp.py", line 193, in parameters_changed
self.posterior, self._log_marginal_likelihood, self.grad_dict = self.inference_method.inference(self.kern, self.X, self.likelihood, self.Y_normalized, self.mean_function, self.Y_metadata)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/inference/latent_function_inference/expectation_propagation.py", line 189, in inference
return self._inference(Y, K, ga_approx, cav_params, likelihood, Y_metadata=Y_metadata, Z_tilde=log_Z_tilde)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/inference/latent_function_inference/expectation_propagation.py", line 297, in _inference
dL_dthetaL = likelihood.ep_gradients(Y, cav_params.tau, cav_params.v, np.diag(dL_dK), Y_metadata=Y_metadata, quad_mode='gh')
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/likelihoods/mixed_noise.py", line 71, in ep_gradients
grads[j:s] += self.likelihoods_list[k].ep_gradients(Y[ind==k,:], cav_tau[ind==k], cav_v[ind==k], dL_dKdiag = dL_dKdiag[ind==k], Y_metadata=Y_metadata, quad_mode=quad_mode, boost_grad=boost_grad)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/likelihoods/likelihood.py", line 256, in ep_gradients
quads = zip(*map(f, Y.flatten(), mu.flatten(), np.sqrt(sigma2.flatten())))
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/likelihoods/likelihood.py", line 317, in integrate_gh
b = self.dlogpdf_dtheta(X, Y, Y_metadata_i)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/likelihoods/likelihood.py", line 667, in dlogpdf_dtheta
return self.dlogpdf_link_dtheta(inv_link_f, y, Y_metadata=Y_metadata)
File "/Users/jwenger/.virtualenvs/mathesis/lib/python3.6/site-packages/GPy/likelihoods/likelihood.py", line 495, in dlogpdf_link_dtheta
raise NotImplementedError
NotImplementedError
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.