diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2018-07-31 14:52:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-31 14:52:52 +0100 |
commit | 400e63f834f48b2e557e9cb1a71723d9253008a3 (patch) | |
tree | d389fb35be109f68be58629ba6e2a83559646bdc | |
parent | c8a628773fa5fe281acd2c701dd96a9824f22713 (diff) | |
download | framework-400e63f834f48b2e557e9cb1a71723d9253008a3.tar.gz framework-400e63f834f48b2e557e9cb1a71723d9253008a3.tar.bz2 framework-400e63f834f48b2e557e9cb1a71723d9253008a3.tar.xz framework-400e63f834f48b2e557e9cb1a71723d9253008a3.zip |
added alias to prox and grad (#130)
-rwxr-xr-x | Wrappers/Python/ccpi/optimisation/funcs.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/funcs.py b/Wrappers/Python/ccpi/optimisation/funcs.py index f5463a3..90bc9e3 100755 --- a/Wrappers/Python/ccpi/optimisation/funcs.py +++ b/Wrappers/Python/ccpi/optimisation/funcs.py @@ -24,9 +24,11 @@ import numpy class Function(object): def __init__(self): self.op = Identity() - def __call__(self,x): return 0 - def grad(self,x): return 0 - def prox(self,x,tau): return x + def __call__(self,x): return 0 + def grad(self, x): return 0 + def prox(self, x, tau): return x + def gradient(self, x): return self.grad(x) + def proximal(self, x, tau): return self.prox(x, tau) class Norm2(Function): |