mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-06-08 15:05:15 +02:00
CCD now outputs in all param dimensions, including those that aren't transformed
This commit is contained in:
parent
56ed4bb603
commit
ed29f048f5
1 changed files with 16 additions and 4 deletions
|
|
@ -199,13 +199,25 @@ class Model(ParamzModel, Priorizable):
|
|||
import paramz
|
||||
|
||||
transformed_points = param_points.copy()
|
||||
print transformed_points, point_densities
|
||||
|
||||
# Need to transform the points to the space of parameters again
|
||||
#alan's original code to transform those parameters, to the true space of parameters again
|
||||
#mike's change: some parameters have no transform, and thus won't be called by any of the
|
||||
#iterations through m2.constraints.items(). To handle these we keep track of those parameters
|
||||
#not included, and then add them (untransformed) at the end.
|
||||
f = np.ones(self.size).astype(bool)
|
||||
f[self.constraints[paramz.transformations.__fixed__]] = paramz.transformations.FIXED
|
||||
new_t_points = [c.f(transformed_points[:, ind[f[ind]]]) for c, ind in self.constraints.items() if c != paramz.transformations.__fixed__][0]
|
||||
new_t_points = []
|
||||
todo = range(0,self.size)
|
||||
new_t_points = np.zeros_like(transformed_points)
|
||||
for c, ind in self.constraints.items():
|
||||
print c,ind
|
||||
if c != paramz.transformations.__fixed__:
|
||||
new_t_points[:,ind] = (c.f(transformed_points[:, ind[f[ind]]]))
|
||||
todo.remove(ind)
|
||||
|
||||
for param_ind in todo:
|
||||
new_t_points[:,param_ind] = transformed_points[:, param_ind]
|
||||
|
||||
|
||||
return new_t_points, point_densities
|
||||
|
||||
def numerical_parameter_hessian(self, step_length=1e-3):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue