Merge branch 'devel' of github.com:/sheffieldml/gpy into devel

This commit is contained in:
James Hensman 2015-05-28 22:22:59 +01:00
commit d67e37fcb6
3 changed files with 8 additions and 8 deletions

View file

@ -89,7 +89,6 @@ class GP(Model):
assert mean_function.output_dim == self.output_dim assert mean_function.output_dim == self.output_dim
self.link_parameter(mean_function) self.link_parameter(mean_function)
#find a sensible inference method #find a sensible inference method
logger.info("initializing inference method") logger.info("initializing inference method")
if inference_method is None: if inference_method is None:

View file

@ -176,11 +176,11 @@ class SpikeAndSlabPosterior(VariationalPosterior):
self.mean.fix(warning=False) self.mean.fix(warning=False)
self.variance.fix(warning=False) self.variance.fix(warning=False)
if group_spike: if group_spike:
self.gamma_group = Param("binary_prob_group",binary_prob.mean(axis=0),Logistic(1e-6,1.-1e-6)) self.gamma_group = Param("binary_prob_group",binary_prob.mean(axis=0),Logistic(1e-10,1.-1e-10))
self.gamma = Param("binary_prob",binary_prob, __fixed__) self.gamma = Param("binary_prob",binary_prob, __fixed__)
self.link_parameters(self.gamma_group,self.gamma) self.link_parameters(self.gamma_group,self.gamma)
else: else:
self.gamma = Param("binary_prob",binary_prob,Logistic(1e-6,1.-1e-6)) self.gamma = Param("binary_prob",binary_prob,Logistic(1e-10,1.-1e-10))
self.link_parameter(self.gamma) self.link_parameter(self.gamma)
def propogate_val(self): def propogate_val(self):

View file

@ -408,12 +408,13 @@ class mocap_data_show_vpython(vpython_show):
class mocap_data_show(matplotlib_show): class mocap_data_show(matplotlib_show):
"""Base class for visualizing motion capture data.""" """Base class for visualizing motion capture data."""
def __init__(self, vals, axes=None, connect=None): def __init__(self, vals, axes=None, connect=None, color='b'):
if axes==None: if axes==None:
fig = plt.figure() fig = plt.figure()
axes = fig.add_subplot(111, projection='3d', aspect='equal') axes = fig.add_subplot(111, projection='3d', aspect='equal')
matplotlib_show.__init__(self, vals, axes) matplotlib_show.__init__(self, vals, axes)
self.color = color
self.connect = connect self.connect = connect
self.process_values() self.process_values()
self.initialize_axes() self.initialize_axes()
@ -423,7 +424,7 @@ class mocap_data_show(matplotlib_show):
self.axes.figure.canvas.draw() self.axes.figure.canvas.draw()
def draw_vertices(self): def draw_vertices(self):
self.points_handle = self.axes.scatter(self.vals[:, 0], self.vals[:, 1], self.vals[:, 2]) self.points_handle = self.axes.scatter(self.vals[:, 0], self.vals[:, 1], self.vals[:, 2], color=self.color)
def draw_edges(self): def draw_edges(self):
self.line_handle = [] self.line_handle = []
@ -442,7 +443,7 @@ class mocap_data_show(matplotlib_show):
z.append(self.vals[i, 2]) z.append(self.vals[i, 2])
z.append(self.vals[j, 2]) z.append(self.vals[j, 2])
z.append(np.NaN) z.append(np.NaN)
self.line_handle = self.axes.plot(np.array(x), np.array(y), np.array(z), 'b-') self.line_handle = self.axes.plot(np.array(x), np.array(y), np.array(z), '-', color=self.color)
def modify(self, vals): def modify(self, vals):
self.vals = vals.copy() self.vals = vals.copy()
@ -494,7 +495,7 @@ class stick_show(mocap_data_show):
class skeleton_show(mocap_data_show): class skeleton_show(mocap_data_show):
"""data_show class for visualizing motion capture data encoded as a skeleton with angles.""" """data_show class for visualizing motion capture data encoded as a skeleton with angles."""
def __init__(self, vals, skel, axes=None, padding=0): def __init__(self, vals, skel, axes=None, padding=0, color='b'):
"""data_show class for visualizing motion capture data encoded as a skeleton with angles. """data_show class for visualizing motion capture data encoded as a skeleton with angles.
:param vals: set of modeled angles to use for printing in the axis when it's first created. :param vals: set of modeled angles to use for printing in the axis when it's first created.
:type vals: np.array :type vals: np.array
@ -506,7 +507,7 @@ class skeleton_show(mocap_data_show):
self.skel = skel self.skel = skel
self.padding = padding self.padding = padding
connect = skel.connection_matrix() connect = skel.connection_matrix()
mocap_data_show.__init__(self, vals, axes=axes, connect=connect) mocap_data_show.__init__(self, vals, axes=axes, connect=connect, color=color)
def process_values(self): def process_values(self):
"""Takes a set of angles and converts them to the x,y,z coordinates in the internal prepresentation of the class, ready for plotting. """Takes a set of angles and converts them to the x,y,z coordinates in the internal prepresentation of the class, ready for plotting.