diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-04-23 12:36:30 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-04-23 12:36:30 +0100 |
commit | 9734788e8bc5088040ca8958db3ce9811a845758 (patch) | |
tree | 583ff65830993b66b13b5484adf134c63d10d5ab /Wrappers | |
parent | cc9e5d510378e1810d0a1a6b0fe70279389255be (diff) | |
download | framework-9734788e8bc5088040ca8958db3ce9811a845758.tar.gz framework-9734788e8bc5088040ca8958db3ce9811a845758.tar.bz2 framework-9734788e8bc5088040ca8958db3ce9811a845758.tar.xz framework-9734788e8bc5088040ca8958db3ce9811a845758.zip |
pass current solution to callback, fix PDHG setup
Diffstat (limited to 'Wrappers')
-rwxr-xr-x | Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py | 2 | ||||
-rw-r--r-- | Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py b/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py index ed95c3f..7604c8a 100755 --- a/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py +++ b/Wrappers/Python/ccpi/optimisation/algorithms/Algorithm.py @@ -151,7 +151,7 @@ class Algorithm(object): self.max_iteration, self.get_last_objective()) ) else: if callback is not None: - callback(self.iteration, self.get_last_objective()) + callback(self.iteration, self.get_last_objective(), self.x) i += 1 if i == iterations: break diff --git a/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py b/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py index bc080f8..bc3059b 100644 --- a/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py +++ b/Wrappers/Python/ccpi/optimisation/algorithms/PDHG.py @@ -37,7 +37,12 @@ class PDHG(Algorithm): def set_up(self, f, g, operator, tau = None, sigma = None, opt = None, **kwargs): # algorithmic parameters - + self.operator = operator + self.f = f + self.g = g + self.tau = tau + self.sigma = sigma + self.opt = opt if sigma is None and tau is None: raise ValueError('Need sigma*tau||K||^2<1') |