diff --git a/descent/display.py b/descent/display.py index 7f58dea..fea0cca 100644 --- a/descent/display.py +++ b/descent/display.py @@ -12,7 +12,7 @@ 'every': 1, 'iter': True, 'obj': True, - 'gradnorm': True, + 'gradnorm': False, 'runtime': True, 'width': 15, 'spec': '5g' diff --git a/descent/main.py b/descent/main.py index 7ce758e..81970ae 100644 --- a/descent/main.py +++ b/descent/main.py @@ -40,7 +40,7 @@ def __init__(self, theta_init): self.theta = deepcopy(theta_init) - def run(self, maxiter=1e3, obj_tol=1e-8, param_tol=1e-5): + def run(self, maxiter=1e3, obj_tol=-1, param_tol=-1): self.maxiter = int(maxiter) starting_iteration = len(self) diff --git a/descent/proxops.py b/descent/proxops.py index ae0725a..08ccf4d 100644 --- a/descent/proxops.py +++ b/descent/proxops.py @@ -246,10 +246,17 @@ def __init__(self, axis, gamma): def __call__(self, x0, rho): - # Apply Laplacian smoothing + # Apply Laplacian smoothing (l2 norm on the parameters multiplied by + # the laplacian) n = x0.shape[self.axis] lap_op = spdiags([(2 + rho / self.gamma) * np.ones(n), -1 * np.ones(n), -1 * np.ones(n)], [0, -1, 1], n, n, format='csc') x_out = np.rollaxis(spsolve(self.gamma * lap_op, rho * np.rollaxis(x0, self.axis, 0)), self.axis, 0) return x_out + + def objective(self, x): + n = x.shape[self.axis] + # lap_op = spdiags([(2 + rho / self.gamma) * np.ones(n), -1 * np.ones(n), -1 * np.ones(n)], [0, -1, 1], n, n, format='csc') + # TODO: add objective for this operator + return 0