changes to multiout constructor

This commit is contained in:
Nicolo Fusi 2013-07-08 14:27:32 +01:00
parent a8eb7eb5f7
commit 074529c1c0
3 changed files with 23 additions and 11 deletions

View file

@ -185,7 +185,7 @@ class TanhWarpingFunction_d(WarpingFunction):
return z
def f_inv(self, z, psi, max_iterations = 1000):
def f_inv(self, z, psi, max_iterations=1000, y=None):
"""
calculate the numerical inverse of f
@ -195,7 +195,9 @@ class TanhWarpingFunction_d(WarpingFunction):
"""
z = z.copy()
y = np.ones_like(z)
if y is None:
y = np.ones_like(z)
it = 0
update = np.inf
@ -205,7 +207,7 @@ class TanhWarpingFunction_d(WarpingFunction):
it += 1
if it == max_iterations:
print "WARNING!!! Maximum number of iterations reached in f_inv "
return y