mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 12:02:38 +02:00
kern plotting with axisa
This commit is contained in:
parent
e99993b8ce
commit
dcbd76a6ee
3 changed files with 31 additions and 21 deletions
|
|
@ -52,7 +52,7 @@ class kern(parameterised):
|
|||
parameterised.__init__(self)
|
||||
|
||||
|
||||
def plot_ARD(self):
|
||||
def plot_ARD(self, ax=pb.gca()):
|
||||
"""
|
||||
If an ARD kernel is present, it bar-plots the ARD parameters
|
||||
|
||||
|
|
@ -60,16 +60,16 @@ class kern(parameterised):
|
|||
"""
|
||||
for p in self.parts:
|
||||
if hasattr(p, 'ARD') and p.ARD:
|
||||
pb.figure()
|
||||
pb.title('ARD parameters, %s kernel' % p.name)
|
||||
ax.set_title('ARD parameters, %s kernel' % p.name)
|
||||
|
||||
if p.name == 'linear':
|
||||
ard_params = p.variances
|
||||
else:
|
||||
ard_params = 1./p.lengthscale
|
||||
|
||||
pb.bar(np.arange(len(ard_params))-0.4, ard_params)
|
||||
|
||||
ax.bar(np.arange(len(ard_params)) - 0.4, ard_params)
|
||||
ax.set_xticks(np.arange(len(ard_params)),
|
||||
["${}$".format(i + 1) for i in range(len(ard_params))])
|
||||
|
||||
|
||||
def _transform_gradients(self,g):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue