mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-24 14:15:14 +02:00
input sensitivity for rbf_inv
This commit is contained in:
parent
3de342506f
commit
f56b66cd7a
1 changed files with 3 additions and 1 deletions
|
|
@ -477,13 +477,15 @@ class Model(Parameterized):
|
|||
if not hasattr(self, 'kern'):
|
||||
raise ValueError, "this Model has no kernel"
|
||||
|
||||
k = [p for p in self.kern.parts if p.name in ['rbf', 'linear']]
|
||||
k = [p for p in self.kern.parts if p.name in ['rbf', 'linear','rbf_inv']]
|
||||
if (not len(k) == 1) or (not k[0].ARD):
|
||||
raise ValueError, "cannot determine sensitivity for this kernel"
|
||||
k = k[0]
|
||||
|
||||
if k.name == 'rbf':
|
||||
return k.lengthscale
|
||||
elif k.name == 'rbf_inv':
|
||||
return 1. / k.inv_lengthscale
|
||||
elif k.name == 'linear':
|
||||
return 1. / k.variances
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue