diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-03-14 15:06:59 +0000 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-03-14 15:06:59 +0000 |
commit | 0f1b5e9ef2619eff4cc158d8e2e05a9d19b8393a (patch) | |
tree | d5f23e3b8a47e7676ff5918267f8023ca37f85ad /Wrappers | |
parent | 3879c21f0cf2a7cf7d885ea20f1cc9363c9ecbe8 (diff) | |
download | framework-0f1b5e9ef2619eff4cc158d8e2e05a9d19b8393a.tar.gz framework-0f1b5e9ef2619eff4cc158d8e2e05a9d19b8393a.tar.bz2 framework-0f1b5e9ef2619eff4cc158d8e2e05a9d19b8393a.tar.xz framework-0f1b5e9ef2619eff4cc158d8e2e05a9d19b8393a.zip |
added docstrings
Diffstat (limited to 'Wrappers')
-rwxr-xr-x | Wrappers/Python/ccpi/optimisation/functions/Function.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/Wrappers/Python/ccpi/optimisation/functions/Function.py b/Wrappers/Python/ccpi/optimisation/functions/Function.py index 27a5f01..fa81dfc 100755 --- a/Wrappers/Python/ccpi/optimisation/functions/Function.py +++ b/Wrappers/Python/ccpi/optimisation/functions/Function.py @@ -23,28 +23,40 @@ class Function(object): '''Abstract class representing a function
Members:
- L is the Lipschitz constant of the gradient of the Function
- alpha is scaling parameter of the function.
+ L is the Lipschitz constant of the gradient of the Function
'''
def __init__(self):
self.L = None
+
def __call__(self,x, out=None):
+ '''Evaluates the function at x '''
raise NotImplementedError
- def call_adjoint(self, x, out=None):
+
+ def gradient(self, x, out=None):
+ '''Returns the gradient of the function at x, if the function is differentiable'''
raise NotImplementedError
+
+ def proximal(self, x, tau, out=None):
+ '''This returns the proximal operator for the function at x, tau'''
+ raise NotImplementedError
+
def convex_conjugate(self, x, out=None):
+ '''This evaluates the convex conjugate of the function at x'''
raise NotImplementedError
+
def proximal_conjugate(self, x, tau, out = None):
+ '''This returns the proximal operator for the convex conjugate of the function at x, tau'''
raise NotImplementedError
+
def grad(self, x):
+ '''Alias of gradient(x,None)'''
warnings.warn('''This method will disappear in following
versions of the CIL. Use gradient instead''', DeprecationWarning)
return self.gradient(x, out=None)
+
def prox(self, x, tau):
+ '''Alias of proximal(x, tau, None)'''
warnings.warn('''This method will disappear in following
versions of the CIL. Use proximal instead''', DeprecationWarning)
return self.proximal(x, out=None)
- def gradient(self, x, out=None):
- raise NotImplementedError
- def proximal(self, x, tau, out=None):
- raise NotImplementedError
\ No newline at end of file +
|