{"action":"created","issue":{"url":"https://api.github.com/repos/SheffieldML/GPy/issues/257","labels_url":"https://api.github.com/repos/SheffieldML/GPy/issues/257/labels{/name}","comments_url":"https://api.github.com/repos/SheffieldML/GPy/issues/257/comments","events_url":"https://api.github.com/repos/SheffieldML/GPy/issues/257/events","html_url":"https://github.com/SheffieldML/GPy/issues/257","id":107750749,"number":257,"title":"Psi statistics for additions of kernels in bgplvm throws error","user":{"login":"adamian","id":3831325,"avatar_url":"https://avatars.githubusercontent.com/u/3831325?v=3","gravatar_id":"","url":"https://api.github.com/users/adamian","html_url":"https://github.com/adamian","followers_url":"https://api.github.com/users/adamian/followers","following_url":"https://api.github.com/users/adamian/following{/other_user}","gists_url":"https://api.github.com/users/adamian/gists{/gist_id}","starred_url":"https://api.github.com/users/adamian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamian/subscriptions","organizations_url":"https://api.github.com/users/adamian/orgs","repos_url":"https://api.github.com/users/adamian/repos","events_url":"https://api.github.com/users/adamian/events{/privacy}","received_events_url":"https://api.github.com/users/adamian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SheffieldML/GPy/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-22T16:25:46Z","updated_at":"2015-09-24T13:34:13Z","closed_at":"2015-09-24T13:34:13Z","body":"When I run an mrd/bgplvm with an additions of kernels (for the ones we have the cross-statistics, eg linear plus bias) I get an error. I don't remember this being a problem before the release, and from the error trace (below) it seems that the problem is with the interface rather than the actual core (so I mark it as a bug).\r\n\r\nTo replicate the error e.g. run `GPy.examples.dimensionality_reduction.mrd_simulation()` after changing `k = kern.Linear(Q, ARD=True)` to `k = kern.Linear(Q, ARD=True) + kern.Bias(Q)`. You'd get this error:\r\n```\r\n GPy.examples.dimensionality_reduction.mrd_simulation()\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n<ipython-input-6-acf5195cbcda> in <module>()\r\n----> 1 GPy.examples.dimensionality_reduction.mrd_simulation()\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/examples/dimensionality_reduction.pyc in mrd_simulation(optimize, verbose, plot, plot_sim, **kw)\r\n    410     # Ylist = [Ylist[0]]\r\n    411     k = kern.Linear(Q, ARD=True) + kern.Bias(Q)\r\n--> 412     m = MRD(Ylist, input_dim=Q, num_inducing=num_inducing, kernel=k, initx=\"PCA_concat\", initz='permute', **kw)\r\n    413 \r\n    414     m['.*noise'] = [Y.var() / 40. for Y in Ylist]\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/core/parameterization/parameterized.pyc in __call__(self, *args, **kw)\r\n     17         self._in_init_ = True\r\n     18         #import ipdb;ipdb.set_trace()\r\n---> 19         self = super(ParametersChangedMeta, self).__call__(*args, **kw)\r\n     20         logger.debug(\"finished init\")\r\n     21         self._in_init_ = False\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/models/mrd.pyc in __init__(self, Ylist, input_dim, X, X_variance, initx, initz, num_inducing, Z, kernel, inference_method, likelihoods, name, Ynames, normalizer, stochastic, batchsize)\r\n    149                                           missing_data=md,\r\n    150                                           stochastic=stochastic,\r\n--> 151                                           batchsize=bs)\r\n    152             spgp.kl_factr = 1./len(Ynames)\r\n    153             spgp.unlink_parameter(spgp.Z)\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/core/parameterization/parameterized.pyc in __call__(self, *args, **kw)\r\n     25         self._highest_parent_._connect_fixes()\r\n     26         logger.debug(\"calling parameters changed\")\r\n---> 27         self.parameters_changed()\r\n     28         return self\r\n     29 \r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/models/bayesian_gplvm_minibatch.pyc in parameters_changed(self)\r\n    111 \r\n    112     def parameters_changed(self):\r\n--> 113         super(BayesianGPLVMMiniBatch,self).parameters_changed()\r\n    114 \r\n    115         kl_fctr = self.kl_factr\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/models/sparse_gp_minibatch.pyc in parameters_changed(self)\r\n    315             self.psi0 = self.kern.psi0(self.Z, self.X)\r\n    316             self.psi1 = self.kern.psi1(self.Z, self.X)\r\n--> 317             self.psi2 = self.kern.psi2n(self.Z, self.X)\r\n    318         else:\r\n    319             self.psi0 = self.kern.Kdiag(self.X)\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/kern/_src/kernel_slice_operations.pyc in wrap(self, Z, variational_posterior)\r\n    138     def wrap(self, Z, variational_posterior):\r\n    139         with _Slice_wrap(self, Z, variational_posterior) as s:\r\n--> 140             ret = f(self, s.X, s.X2)\r\n    141         return ret\r\n    142     return wrap\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/util/caching.pyc in __call__(self, *args, **kwargs)\r\n    182         except KeyError:\r\n    183             cacher = caches[self.f] = Cacher(self.f, self.limit, self.ignore_args, self.force_kwargs)\r\n--> 184         return cacher(*args, **kwargs)\r\n    185 \r\n    186 class Cache_this(object):\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/util/caching.pyc in __call__(self, *args, **kw)\r\n    118             # 3: This is when we never saw this chache_id:\r\n    119             self.ensure_cache_length(cache_id)\r\n--> 120             self.add_to_cache(cache_id, inputs, self.operation(*args, **kw))\r\n    121         except:\r\n    122             self.reset()\r\n\r\n/home/andreas/Dropbox/_PhD/Software/github/GPy/GPy/kern/_src/add.py in psi2n(self, Z, variational_posterior)\r\n    153             elif isinstance(p2, Bias) and isinstance(p1, (RBF, Linear)):\r\n    154                 tmp = p1.psi1(Z, variational_posterior).sum(axis=0)\r\n--> 155                 psi2 += p2.variance * (tmp[:, :, None] + tmp[:, None, :])\r\n    156             elif isinstance(p2, (RBF, Linear)) and isinstance(p1, (RBF, Linear)):\r\n    157                 assert np.intersect1d(p1.active_dims, p2.active_dims).size == 0, \"only non overlapping kernel dimensions allowed so far\"\r\n\r\nIndexError: too many indices for array\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/SheffieldML/GPy/issues/comments/142928556","html_url":"https://github.com/SheffieldML/GPy/issues/257#issuecomment-142928556","issue_url":"https://api.github.com/repos/SheffieldML/GPy/issues/257","id":142928556,"user":{"login":"zhenwendai","id":6029658,"avatar_url":"https://avatars.githubusercontent.com/u/6029658?v=3","gravatar_id":"","url":"https://api.github.com/users/zhenwendai","html_url":"https://github.com/zhenwendai","followers_url":"https://api.github.com/users/zhenwendai/followers","following_url":"https://api.github.com/users/zhenwendai/following{/other_user}","gists_url":"https://api.github.com/users/zhenwendai/gists{/gist_id}","starred_url":"https://api.github.com/users/zhenwendai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhenwendai/subscriptions","organizations_url":"https://api.github.com/users/zhenwendai/orgs","repos_url":"https://api.github.com/users/zhenwendai/repos","events_url":"https://api.github.com/users/zhenwendai/events{/privacy}","received_events_url":"https://api.github.com/users/zhenwendai/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T13:34:13Z","updated_at":"2015-09-24T13:34:13Z","body":"fixed with the commit by Alan."}}