{"action":"created","comment":{"url":"https://api.github.com/repos/odlgroup/odl/pulls/comments/78018147","id":78018147,"diff_hunk":"@@ -0,0 +1,1671 @@\n+# Copyright 2014-2016 The ODL development group\n+#\n+# This file is part of ODL.\n+#\n+# ODL is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# ODL is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with ODL.  If not, see <http://www.gnu.org/licenses/>.\n+\n+# Imports for common Python 2/3 codebase\n+from __future__ import print_function, division, absolute_import\n+from future import standard_library\n+standard_library.install_aliases()\n+from builtins import super\n+\n+import numpy as np\n+from numbers import Number\n+\n+from odl.operator.operator import (\n+    Operator, OperatorComp, OperatorLeftScalarMult, OperatorRightScalarMult,\n+    OperatorRightVectorMult, OperatorSum)\n+from odl.operator.default_ops import (ResidualOperator, IdentityOperator,\n+                                      ConstantOperator, ScalingOperator)\n+from odl.set.space import LinearSpaceVector\n+from odl.solvers.advanced import (proximal_arg_scaling, proximal_translation,\n+                                  proximal_quadratic_perturbation)\n+\n+\n+__all__ = ('Functional', 'FunctionalLeftScalarMult',\n+           'FunctionalRightScalarMult', 'FunctionalComp',\n+           'FunctionalRightVectorMult', 'FunctionalSum', 'FunctionalScalarSum',\n+           'TranslatedFunctional', 'ConvexConjugateTranslation',\n+           'ConvexConjugateFuncScaling', 'ConvexConjugateArgScaling',\n+           'ConvexConjugateLinearPerturb')\n+\n+\n+class Functional(Operator):\n+\n+    \"\"\"Implementation of a functional class.\n+\n+    A functional is an operator ``f`` that maps from some domain ``X`` to the\n+    field of scalars ``F`` associated with the domain:\n+\n+        ``f : X -> F``.\n+\n+    Notes\n+    -----\n+    The implementation of the functional class assumes that the domain\n+    :math:`X` is a Hilbert space and that the field of scalars :math:`F` is a\n+    is the real numbers. It is possible to create functions that do not fulfil\n+    these assumptions, however some mathematical results might not be valide in\n+    this case. For more information, see\n+    http://odl.readthedocs.io/guide/in_depth/functional_guide.html.\n+    \"\"\"\n+\n+    def __init__(self, domain, linear=False, grad_lipschitz=np.inf):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        domain : `Set`\n+            The domain of this functional, i.e., the set of elements to\n+            which this functional can be applied\n+        linear : `bool`\n+            If `True`, the functional is considered as linear. In this\n+            case, ``domain`` and ``range`` have to be instances of\n+            `LinearSpace`, or `Field`.\n+        grad_lipschitz : 'float', optional\n+            The Lipschitz constant of the gradient.\n+        \"\"\"\n+\n+        Operator.__init__(self, domain=domain,\n+                          range=domain.field, linear=linear)\n+        self._grad_lipschitz = float(grad_lipschitz)\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of the functional.\n+\n+        Notes\n+        -----\n+        The operator that corresponds to the mapping\n+\n+        .. math::\n+\n+            x \\\\to \\\\nabla f(x)\n+\n+        where :math:`\\\\nabla f(x)` is the element used to evaluate\n+        derivatives in a direction :math:`d` by\n+        :math:`\\\\langle \\\\nabla f(x), d \\\\rangle`.\n+        \"\"\"\n+        raise NotImplementedError\n+\n+    def proximal(self, sigma=1.0):\n+        \"\"\"Return the proximal operator of the functional.\n+\n+        Parameters\n+        ----------\n+        sigma : positive float, optional\n+            Regularization parameter of the proximal operator.\n+\n+        Returns\n+        -------\n+        out : `Operator`\n+            Domain and range equal to domain of functional.\n+\n+        Notes\n+        -----\n+        The nonsmooth solvers that make use of proximal operators in order to\n+        solve a given optimization problem, see for example\n+        `forward_backward_pd`, take a `proximal factory` as input. Note that\n+        ``Functional.proximal`` is in fact a `proximal factory`.\n+        \"\"\"\n+        raise NotImplementedError\n+\n+    @property\n+    def conjugate_functional(self):\n+        \"\"\"Convex conjugate functional of the functional.\n+\n+        Notes\n+        -----\n+        The convex conjugate functional of a convex functional :math:`f(x)`,\n+        defined on a Hilber space, is defined as the functional\n+\n+        .. math::\n+\n+            f^*(x^*) = \\\\sup_{x} \\{ \\\\langle x^*,x \\\\rangle - f(x)  \\}.\n+\n+        The concept is also known as the Legendre transformation.\n+\n+        References\n+        ----------\n+        Wikipedia article on `Convex conjugate\n+        <https://en.wikipedia.org/wiki/Convex_conjugate>`_.\n+\n+        Wikipedia article on `Legendre transformation\n+        https://en.wikipedia.org/wiki/Legendre_transformation\n+\n+        For literature references see, e.g., [Lue1969]_, [Roc1970]_.\n+        \"\"\"\n+        raise NotImplementedError\n+\n+    def derivative(self, point):\n+        \"\"\"Return the derivative operator in the given point.\n+\n+        This function returns the linear operator\n+\n+            ``x --> <x, grad_f(point)>``,\n+\n+        where ``grad_f(point)`` is the gradient of the functional in the point\n+        ``point``.\n+\n+        Parameters\n+        ----------\n+        point : `LinearSpaceVector`\n+            The point in which the gradient is evaluated.\n+\n+        Returns\n+        -------\n+        out : `Operator`\n+            The linear operator that maps ``x --> <x, grad_f(point)>``.\n+        \"\"\"\n+        return self.gradient(point).T\n+\n+    def translate(self, shift):\n+        \"\"\"Return a translation of the functional.\n+\n+        For a given functional ``f`` and an element ``translation`` in the\n+        domain of ``f``, this operation creates the functional\n+        ``f(. - translation)``.\n+\n+        Parameters\n+        ----------\n+        translation : `LinearSpaceVector`\n+            Element in the domain of the functional\n+\n+        Returns\n+        -------\n+        out : `TranslatedFunctional`\n+            The functional ``f(. - translation)``\n+        \"\"\"\n+        if shift not in self.domain:\n+            raise TypeError('the translation {} is not in the domain of the'\n+                            'functional {!r}'.format(shift, self))\n+\n+        return TranslatedFunctional(self, shift)\n+\n+    def __mul__(self, other):\n+        \"\"\"Return ``self * other``.\n+\n+        If ``other`` is an operator, this corresponds to composition with the\n+        operator:\n+\n+            ``func * op <==> (x --> func(op(x)))``\n+\n+        If ``other`` is a scalar, this corresponds to right multiplication of\n+        scalars with functionals:\n+\n+            ``func * scalar <==> (x --> func(scalar * x))``\n+\n+        If ``other`` is a vector, this corresponds to right multiplication of\n+        vectors with functionals:\n+\n+            ``func * vector <==> (x --> func(vector * x))``\n+\n+        Note that left and right multiplications are generally different.\n+\n+        Parameters\n+        ----------\n+        other : `Operator` or `LinearSpaceVector` or scalar\n+            `Operator`:\n+            The `Operator.range` of ``other`` must match this functionals\n+            `Functional.domain`.\n+\n+            `LinearSpaceVector`:\n+            ``other`` must be an element of this functionals's\n+            `Functional.domain`.\n+\n+            scalar:\n+            The `Functional.domain` of this functional must be a\n+            `LinearSpace` and ``other`` must be an element of the ``field``\n+            of this functional's `Functional.domain`. Note that this\n+            ``field`` is also this functional's `Functional.range`.\n+\n+        Returns\n+        -------\n+        mul : `Functional`\n+            Multiplication result\n+\n+            If ``other`` is an `Operator`, ``mul`` is a\n+            `FunctionalComp`.\n+\n+            If ``other`` is a scalar, ``mul`` is a\n+            `FunctionalRightScalarMult`.\n+\n+            If ``other`` is a vector, ``mul`` is a\n+            `FunctionalRightVectorMult`.\n+\n+        Notes\n+        -------\n+        See also `Operator.__mul__`.\n+        \"\"\"\n+        if isinstance(other, Operator):\n+            return FunctionalComp(self, other)\n+        elif isinstance(other, Number):\n+            # Left multiplication is more efficient, so we can use this in the\n+            # case of linear functional.\n+            if self.is_linear:\n+                return FunctionalLeftScalarMult(self, other)\n+            else:\n+                return FunctionalRightScalarMult(self, other)\n+        elif isinstance(other, LinearSpaceVector) and other in self.domain:\n+            return FunctionalRightVectorMult(self, other)\n+        else:\n+            return super().__mul__(other)\n+\n+    def __rmul__(self, other):\n+        \"\"\"Return ``other * self``.\n+\n+        If ``other`` is an operator, since a functional is also an operator\n+        this corresponds to operator composition:\n+\n+            ``op * func <==> (x --> op(func(x))``\n+\n+        If ``other`` is a scalar, this corresponds to left multiplication of\n+        scalars with functionals:\n+\n+            ``scalar * func <==> (x --> scalar * func(x))``\n+\n+        If ``other`` is a vector,  since a functional is also an operator this\n+        corresponds to left multiplication of vectors with operators:\n+\n+            ``vector * func <==> (x --> vector * func(x))``\n+\n+        Note that left and right multiplications are generally\n+        different.\n+\n+        Parameters\n+        ----------\n+        other : `Operator` or `LinearSpaceVector` or scalar\n+            `Operator`:\n+            The `Operator.domain` of ``other`` must match this functional's\n+            `Functional.range`.\n+\n+            `LinearSpaceVector`:\n+            ``other`` must be an element of this functionals's\n+            `Functional.range`.\n+\n+            scalar:\n+            The `Operator.domain` of this operator must be a\n+            `LinearSpace` and ``other`` must be an\n+            element of the ``field`` of this operator's\n+            `Operator.domain`.\n+\n+        Returns\n+        -------\n+        rmul : `Functional` or `Operator`\n+            Multiplication result\n+\n+            If ``other`` is an `Operator`, ``rmul`` is a `OperatorComp`.\n+\n+            If ``other`` is a scalar, ``rmul`` is a\n+            `FunctionalLeftScalarMult`.\n+\n+            If ``other`` is a vector, ``rmul`` is a\n+            `OperatorLeftVectorMult`.\n+        \"\"\"\n+        if other in self.domain.field:\n+            if other == 0:\n+                from odl.solvers.functional.default_functionals import (\n+                    ZeroFunctional)\n+                return ZeroFunctional(self.domain)\n+            else:\n+                return FunctionalLeftScalarMult(self, other)\n+        else:\n+            return super().__rmul__(other)\n+\n+    def __add__(self, other):\n+        \"\"\"Return ``self + other``.\n+\n+        Parameters\n+        ----------\n+        other : `Functional` or scalar\n+            `Functional`:\n+            The `Functional.domain` and `Functional.range` of ``other``\n+            must match this functional's  `Functional.domain` and\n+            `Functional.range`.\n+\n+            scalar:\n+            The scalar needs to be in this functional's `Functional.range`.\n+\n+        Returns\n+        -------\n+        add : `Functional`\n+            Addition result\n+\n+            If ``other`` is in ``Functional.range``, ``add`` is a\n+            `FunctionalScalarSum`.\n+\n+            If ``other`` is a `Functional`, ``add`` is a `FunctionalSum`.\n+        \"\"\"\n+        if other in self.domain.field:\n+            return FunctionalScalarSum(self, other)\n+        elif isinstance(other, Functional):\n+            return FunctionalSum(self, other)\n+        else:\n+            return NotImplemented\n+\n+    def __radd__(self, other):\n+        \"\"\"Return ``other + self``.\n+\n+        Since addition is commutative, also for functionals, this is similar\n+        to `Functional.__add__`.\n+        \"\"\"\n+        if other in self.domain.field:\n+            return FunctionalScalarSum(self, other)\n+        elif isinstance(other, Functional):\n+            return FunctionalSum(self, other)\n+        else:\n+            return NotImplemented\n+\n+    def __sub__(self, other):\n+        \"\"\"Return ``self - other``.\"\"\"\n+        return self.__add__(-1 * other)\n+\n+    @property\n+    def grad_lipschitz(self):\n+        \"\"\"Lipschitz constant for the gradient of the functional\"\"\"\n+        return self._grad_lipschitz\n+\n+\n+class FunctionalLeftScalarMult(Functional, OperatorLeftScalarMult):\n+\n+    \"\"\"Scalar multiplication of functional from the left.\n+\n+    Given a functional ``f`` and a scalar ``scalar``, this represents the\n+    functional\n+\n+        ``(scalar * f)(x) = scalar * f(x)``.\n+    \"\"\"\n+\n+    def __init__(self, func, scalar):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        func : `Functional`\n+            The functional that is to be scaled.\n+        scalar : `float`\n+            The scalar with which the functional is scaled.\n+        \"\"\"\n+\n+        if not isinstance(func, Functional):\n+            raise TypeError('functional {!r} is not a Functional instance.'\n+                            ''.format(func))\n+\n+        scalar = func.range.element(scalar)\n+\n+        if scalar > 0 or scalar < 0:\n+            Functional.__init__(self, domain=func.domain,\n+                                linear=func.is_linear,\n+                                grad_lipschitz=(\n+                                    np.abs(scalar) * func.grad_lipschitz))\n+\n+        elif scalar == 0:\n+            Functional.__init__(self, domain=func.domain, linear=True,\n+                                grad_lipschitz=0)\n+\n+        else:\n+            # It should not be possible to get here\n+            raise TypeError('comparison with scalar {} failed'.format(scalar))\n+\n+        OperatorLeftScalarMult.__init__(self, operator=func, scalar=scalar)\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of the functional.\n+\n+        Notes\n+        -----\n+        The operator that corresponds to the mapping\n+\n+        .. math::\n+\n+            x \\\\to \\\\nabla f(x)\n+\n+        where :math:`\\\\nabla f(x)` is the element used to evaluate\n+        derivatives in a direction :math:`d` by\n+        :math:`\\\\langle \\\\nabla f(x), d \\\\rangle`.\n+        \"\"\"\n+        return self.scalar * self.operator.gradient\n+\n+    @property\n+    def conjugate_functional(self):\n+        \"\"\"Convex conjugate functional of the scaled functional.\"\"\"\n+        # The helper function only allows positive scaling parameters.\n+        # Otherwise it gives an error.\n+        return ConvexConjugateFuncScaling(\n+            self.operator.conjugate_functional, self.scalar)\n+\n+    def proximal(self, sigma=1.0):\n+        \"\"\"Return the proximal operator of the scaled functional.\n+\n+        Parameters\n+        ----------\n+        sigma : positive float, optional\n+            Regularization parameter of the proximal operator.\n+\n+        Returns\n+        -------\n+        out : `Operator`\n+            Domain and range equal to domain of functional.\n+        \"\"\"\n+\n+        sigma = float(sigma)\n+\n+        if self.scalar < 0:\n+            raise ValueError('Proximal operator of functional scaled with a '\n+                             'negative value {} is not well-defined'\n+                             ''.format(self.scalar))\n+\n+        elif self.scalar == 0:\n+            return IdentityOperator(self.domain)\n+\n+        elif self.scalar > 0:\n+            return self.operator.proximal(sigma * self.scalar)\n+\n+        else:\n+            # It should not be possible to get here\n+            raise TypeError('comparison with scalar {} failed'\n+                            ''.format(self.scalar))\n+\n+    def derivative(self, point):\n+        \"\"\"Returns the derivative operator in the given point.\n+\n+        This function returns the linear operator\n+\n+            ``x --> <x, grad_f(point)>``,\n+\n+        where ``grad_f(point)`` is the gradient of the functional in the point\n+        ``point``.\n+\n+        Parameters\n+        ----------\n+        point : `LinearSpaceVector`\n+            The point in which the gradient is evaluated.\n+\n+        Returns\n+        -------\n+        out : `DerivativeOperator`\n+            The linear operator that maps ``x --> <x, grad_f(point)>``.\n+        \"\"\"\n+        return self.scalar * self.operator.derivative(point)\n+\n+\n+class FunctionalRightScalarMult(Functional, OperatorRightScalarMult):\n+\n+    \"\"\"Scalar multiplication of the argument of functional.\n+\n+    Given a functional ``f`` and a scalar ``scalar``, this represents the\n+    functional\n+\n+        ``(f * scalar)(x) = f(scalar * x)``.\n+    \"\"\"\n+\n+    def __init__(self, func, scalar):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        func : `Functional`\n+            The functional which will have its argument scaled.\n+        scal : `Scalar`\n+            The scaling parameter with which the argument is scaled.\n+        \"\"\"\n+\n+        if not isinstance(func, Functional):\n+            raise TypeError('functional {!r} is not a Functional instance.'\n+                            ''.format(func))\n+\n+        scalar = func.range.element(scalar)\n+\n+        if scalar == 0:\n+            Functional.__init__(self, domain=func.domain, linear=True,\n+                                grad_lipschitz=0)\n+        elif scalar < 0 or scalar > 0:\n+            Functional.__init__(self, domain=func.domain,\n+                                linear=func.is_linear,\n+                                grad_lipschitz=(np.abs(scalar) *\n+                                                func.grad_lipschitz))\n+        else:\n+            # It should not be possible to get here\n+            raise TypeError('comparison with scalar {} failed'.format(scalar))\n+\n+        OperatorRightScalarMult.__init__(self, operator=func, scalar=scalar)\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of the functional.\n+\n+        Notes\n+        -----\n+        The operator that corresponds to the mapping\n+\n+        .. math::\n+\n+            x \\\\to \\\\nabla f(x)\n+\n+        where :math:`\\\\nabla f(x)` is the element used to evaluate\n+        derivatives in a direction :math:`d` by\n+        :math:`\\\\langle \\\\nabla f(x), d \\\\rangle`.\n+        \"\"\"\n+        return (self.scalar * self.operator.gradient *\n+                ScalingOperator(self.domain, self.scalar))\n+\n+    @property\n+    def conjugate_functional(self):\n+        \"\"\"Convex conjugate functional of functional with scaled argument.\"\"\"\n+        return ConvexConjugateArgScaling(self.operator.conjugate_functional,\n+                                         self.scalar)\n+\n+    def proximal(self, sigma=1.0):\n+        \"\"\"Return the proximal operator of the functional with scaled argument.\n+\n+        Parameters\n+        ----------\n+        sigma : positive float, optional\n+            Regularization parameter of the proximal operator.\n+\n+        Returns\n+        -------\n+        out : `Operator`\n+            Domain and range equal to domain of functional.\n+        \"\"\"\n+        sigma = float(sigma)\n+        return(proximal_arg_scaling(\n+            self.operator.proximal, self.scalar))(sigma)\n+\n+    def derivative(self, point):\n+        \"\"\"Returns the derivative operator in the given point.\n+\n+        This function returns the linear operator\n+\n+            ``x --> <x, grad_f(point)>``,\n+\n+        where ``grad_f(point)`` is the gradient of the functional in the point\n+        ``point``.\n+\n+        Parameters\n+        ----------\n+        point : `LinearSpaceVector`\n+            The point in which the gradient is evaluated.\n+\n+        Returns\n+        -------\n+        out : `DerivativeOperator`\n+            The linear operator that maps ``x --> <x, grad_f(point)>``.\n+        \"\"\"\n+        return self.scalar * self.operator.derivative(self.scalar * point)\n+\n+\n+class FunctionalComp(Functional, OperatorComp):\n+\n+    \"\"\"Composition of a functional with an operator.\n+\n+    Given a functional ``func`` and an operator ``op``, such that the range of\n+    the operator is equal to the domain of the functional, this corresponds to\n+    the functional\n+\n+        ``(func * op)(x) = func(op(x))``.\n+    \"\"\"\n+\n+    def __init__(self, func, op, tmp1=None, tmp2=None):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        func : `Functional`\n+            The left (\"outer\") operator\n+        op : `Operator`\n+            The right (\"inner\") operator. Its range must coincide with the\n+            domain of ``func``.\n+        tmp1 : `element` of the range of ``op``, optional\n+            Used to avoid the creation of a temporary when applying ``op``\n+        tmp2 : `element` of the range of ``op``, optional\n+            Used to avoid the creation of a temporary when applying the\n+            gradient of ``func``\n+        \"\"\"\n+        if not isinstance(func, Functional):\n+            raise TypeError('functional {!r} is not a Functional instance.'\n+                            ''.format(func))\n+\n+        OperatorComp.__init__(self, left=func, right=op, tmp=tmp1)\n+\n+        # TODO: can the Lipschitz constant of the gradient be estimated?\n+        Functional.__init__(self, domain=func.domain,\n+                            linear=(func.is_linear and op.is_linear),\n+                            grad_lipschitz=np.infty)\n+\n+        if tmp2 is not None and tmp2 not in self._left.domain:\n+            raise TypeError('second temporary {!r} not in the domain '\n+                            '{!r} of the functional.'\n+                            ''.format(tmp2, self._left.domain))\n+        self._tmp2 = tmp2\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient of the compositon according to the chain rule.\"\"\"\n+\n+        func = self.left\n+        op = self.right\n+\n+        class CompositGradient(Operator):\n+            \"\"\"Gradient of the compositon according to the chain rule.\"\"\"\n+            def __init__(self):\n+                \"\"\"Initialize a new instance.\"\"\"\n+                super().__init__(func.domain, func.domain, linear=False)\n+                self._func = func\n+                self._op = op\n+\n+            def _call(self, x):\n+                \"\"\"Applies the gradient operator to the given point.\n+\n+                Parameters\n+                ----------\n+                x : `LinearSpaceVector`\n+                    Element in the domain of the functional to which the\n+                    gradient operator is applied. The element must have a\n+                    non-zero norm\n+\n+                Returns\n+                -------\n+                `self(x)` : `LinearSpaceVector`\n+                    Evaluation of the gradient operator. An element in the\n+                    domain of the functional.\n+                \"\"\"\n+                return self._op.derivative(x).adjoint(\n+                    self._func.gradient(self._op(x)))\n+\n+        return CompositGradient()\n+\n+\n+class FunctionalRightVectorMult(Functional, OperatorRightVectorMult):\n+\n+    \"\"\"Expression type for the functional right vector multiplication.\n+\n+    Given a functional ``func`` and a vector ``y`` in the domain of ``func``,\n+    this corresponds to the functional\n+\n+        ``(func * y)(x) = func(y*x)``.\n+    \"\"\"\n+\n+    def __init__(self, func, vector):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        func : `Functional`\n+            The domain of ``func`` must be a ``vector.space``.\n+        vector : `LinearSpaceVector` in ``func.domain``\n+            The vector to multiply by.\n+        \"\"\"\n+        if not isinstance(func, Functional):\n+            raise TypeError('functional {!r} is not a Functional instance.'\n+                            ''.format(func))\n+\n+        OperatorRightVectorMult.__init__(self, operator=func, vector=vector)\n+\n+        Functional.__init__(self, domain=func.domain)\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of the functional.\n+\n+        Notes\n+        -----\n+        The operator that corresponds to the mapping\n+\n+        .. math::\n+\n+            x \\\\to \\\\nabla f(x)\n+\n+        where :math:`\\\\nabla f(x)` is the element used to evaluate\n+        derivatives in a direction :math:`d` by\n+        :math:`\\\\langle \\\\nabla f(x), d \\\\rangle`.\n+        \"\"\"\n+        return self.vector * self.operator.gradient * self.vector\n+\n+    # TODO: can this be computed?\n+    def proximal(self, sigma=1.0):\n+        \"\"\"Return the proximal operator of the functional.\n+\n+        Parameters\n+        ----------\n+        sigma : positive float, optional\n+            Regularization parameter of the proximal operator.\n+\n+        Returns\n+        -------\n+        out : `Operator`\n+            Domain and range equal to domain of functional.\n+\n+        Notes\n+        -----\n+        The nonsmooth solvers that make use of proximal operators in order to\n+        solve a given optimization problem, see for example\n+        `forward_backward_pd`, take a `proximal factory` as input. Note that\n+        ``Functional.proximal`` is in fact a `proximal factory`.\n+        \"\"\"\n+        raise NotImplementedError('there is no known expression for this')\n+\n+    @property\n+    def conjugate_functional(self):\n+        \"\"\"Convex conjugate functional of the functional.\n+\n+        Notes\n+        -----\n+        The convex conjugate functional of a convex functional :math:`f(x)`,\n+        defined on a Hilber space, is defined as the functional\n+\n+        .. math::\n+\n+            f^*(x^*) = \\\\sup_{x} \\{ \\\\langle x^*,x \\\\rangle - f(x)  \\}.\n+\n+        The concept is also known as the Legendre transformation.\n+\n+        References\n+        ----------\n+        Wikipedia article on `Convex conjugate\n+        <https://en.wikipedia.org/wiki/Convex_conjugate>`_.\n+\n+        Wikipedia article on `Legendre transformation\n+        https://en.wikipedia.org/wiki/Legendre_transformation\n+\n+        For literature references see, e.g., [Lue1969]_, [Roc1970]_.\n+        \"\"\"\n+        return self.operator.conjugate_functional * (1.0 / self.vector)\n+\n+\n+class FunctionalSum(Functional, OperatorSum):\n+\n+    \"\"\"Expression type for the sum of functionals.\n+\n+    ``FunctionalSum(func1, func2) <==> (x --> func1(x) + func2(x))``.\n+    \"\"\"\n+\n+    def __init__(self, func1, func2, tmp_dom=None):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        func1, func2 : `Functional`\n+            The summands of the functional sum. Their `Operator.domain`\n+            and `Operator.range` must coincide.\n+        tmp_dom : `Operator.domain` `element`, optional\n+            Used to avoid the creation of a temporary when applying the\n+            gradient.\n+        \"\"\"\n+        # TODO: Tmp_dom, what is it used for?\n+        if not isinstance(func1, Functional):\n+            raise TypeError('functional 1 {!r} is not a Functional instance.'\n+                            ''.format(func1))\n+        if not isinstance(func2, Functional):\n+            raise TypeError('functional 2 {!r} is not a Functional instance.'\n+                            ''.format(func2))\n+\n+        Functional.__init__(self, domain=func1.domain,\n+                            linear=(func1.is_linear and func2.is_linear),\n+                            grad_lipschitz=(func1.grad_lipschitz +\n+                                            func2.grad_lipschitz))\n+\n+        OperatorSum.__init__(self, func1, func2, tmp_ran=None,\n+                             tmp_dom=tmp_dom)\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of functional sum.\"\"\"\n+        return self.left.gradient + self.right.gradient\n+\n+    def derivative(self, point):\n+        \"\"\"Returns the derivative operator in the given point.\n+\n+        This function returns the linear operator\n+\n+            ``x --> <x, grad_f(point)>``,\n+\n+        where ``grad_f(point)`` is the gradient of the functional in the point\n+        ``point``.\n+\n+        Parameters\n+        ----------\n+        point : `LinearSpaceVector`\n+            The point in which the gradient is evaluated.\n+\n+        Returns\n+        -------\n+        out : `DerivativeOperator`\n+            The linear operator that maps ``x --> <x, grad_f(point)>``.\n+        \"\"\"\n+        return self._op1.derivative(point) + self._op2.derivative(point)\n+\n+\n+class FunctionalScalarSum(Functional, OperatorSum):\n+\n+    \"\"\"Expression type for the sum of a functional and a scalar.\n+\n+    ``FunctionalScalarSum(func, scalar) <==> (x --> func(x) + scalar)``\n+    \"\"\"\n+\n+    def __init__(self, func, scalar, tmp_dom=None):\n+        \"\"\"Initialize a new instance.\n+\n+        Parameters\n+        ----------\n+        func : `Functional`\n+            Functional to which the scalar is added.\n+        scalar : `element` in the `field` of the ``domain``\n+            The scalar to be added to the functional. The `field` of the\n+            ``domain`` is the range of the functional.\n+        tmp_dom : `LinearSpaceVector`, optional\n+            ...\n+        \"\"\"\n+        # TODO: what is tmp_dom used for?\n+        if not isinstance(func, Functional):\n+            raise TypeError('functional {!r} is no a Functional instance'\n+                            ''.format(func))\n+        if scalar not in func.range:\n+            raise TypeError('the scalar {} is not in the range of the'\n+                            'functional {!r}'.format(scalar, func))\n+\n+        Functional.__init__(self, domain=func.domain, linear=func.is_linear,\n+                            grad_lipschitz=func.grad_lipschitz)\n+\n+        OperatorSum.__init__(self, left=func,\n+                             right=ConstantOperator(vector=scalar,\n+                                                    domain=func.domain,\n+                                                    range=func.range),\n+                             tmp_ran=None, tmp_dom=tmp_dom)\n+\n+    @property\n+    def scalar(self):\n+        return self.right.vector\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of the functional.\n+\n+        Note that this is the same as the gradient of the original functional.\n+\n+        Notes\n+        -----\n+        The operator that corresponds to the mapping\n+\n+        .. math::\n+\n+            x \\\\to \\\\nabla f(x)\n+\n+        where :math:`\\\\nabla f(x)` is the element used to evaluate\n+        derivatives in a direction :math:`d` by\n+        :math:`\\\\langle \\\\nabla f(x), d \\\\rangle`.\n+        \"\"\"\n+        return self.left.gradient\n+\n+    def proximal(self, sigma=1.0):\n+        \"\"\"Proximal operator of the FunctionalScalarSum.\n+\n+        This is the same as the proximal operator of the original\n+        functional.\n+\n+        Parameters\n+        ----------\n+        sigma : positive float, optional\n+            Regularization parameter of the proximal operator.\n+\n+        Returns\n+        -------\n+        out : `Operator`\n+            Domain and range equal to domain of functional.\n+        \"\"\"\n+        return self.left.proximal(sigma)\n+\n+    @property\n+    def conjugate_functional(self):\n+        \"\"\"Convex conjugate functional of FunctionalScalarSum.\"\"\"\n+        return self.left.conjugate_functional - self.scalar\n+\n+    def derivative(self, point):\n+        \"\"\"Returns the derivative operator of FunctionalScalarSum.\n+\n+        Parameters\n+        ----------\n+        point : `LinearSpaceVector`\n+            The point in which the gradient is evaluated.\n+\n+        Returns\n+        -------\n+        out : `DerivativeOperator`\n+            The linear operator that maps ``x --> <x, grad_f(point)>``.\n+        \"\"\"\n+        return self.left.derivative(point)\n+\n+\n+class TranslatedFunctional(Functional):\n+\n+    \"\"\"Implementation of the translated functional.\n+\n+    Given a functional ``f`` and an element ``translation`` in the domain of\n+    ``f``, this corresponds to the functional ``f(. - translation)``.\n+    \"\"\"\n+\n+    def __init__(self, func, translation):\n+        \"\"\"Initialize a new instance.\n+\n+        Given a functional ``f(.)`` and a vector ``translation`` in the domain\n+        of ``f``, this corresponds to the functional ``f(. - y)``.\n+\n+        Parameters\n+        ----------\n+        func : `Functional`\n+            Functional which is to be translated.\n+        translation : `LinearSpaceVector`\n+            Element in ``func.domain``, with which the argument is translated.\n+        \"\"\"\n+\n+        if not isinstance(func, Functional):\n+            raise TypeError('`func` {!r} not a `Functional` instance'\n+                            ''.format(func))\n+\n+        if translation not in func.domain:\n+            raise TypeError('`translation` {!r} not in func.domain {!r}'\n+                            ''.format(translation.space, func.domain))\n+\n+        super().__init__(domain=func.domain, linear=False,\n+                         grad_lipschitz=func.grad_lipschitz)\n+\n+    # TODO: Add case if we have translation -> scaling -> translation?\n+        if isinstance(func, TranslatedFunctional):\n+            self._original_func = func.original_func\n+            self._translation = func.translation + translation\n+\n+        else:\n+            self._original_func = func\n+            self._translation = translation\n+\n+    @property\n+    def original_func(self):\n+        return self._original_func\n+\n+    @property\n+    def translation(self):\n+        return self._translation\n+\n+    def _call(self, x):\n+        \"\"\"Evaluates the functional in a point ``x``.\n+\n+        Parameters\n+        ----------\n+        x : `LinearSpaceVector`\n+            Element in the domain of the functional.\n+            The point in which the functional is evaluated\n+\n+        Returns\n+        -------\n+        `self(x)` : `float`\n+            Evaluation of the functional, which is a constant.\n+        \"\"\"\n+        return self._original_func(x - self._translation)\n+\n+    @property\n+    def gradient(self):\n+        \"\"\"Gradient operator of the functional.\n+\n+        The operator is given by a transation of the gradient operator of the\n+        original functional.\n+\n+        Notes\n+        -----\n+        The operator that corresponds to the mapping\n+\n+        .. math::\n+\n+            x \\\\to \\\\nabla f(x)\n+\n+        where :math:`\\\\nabla f(x)` is the element used to evaluate\n+        derivatives in a direction :math:`d` by\n+        :math:`\\\\langle \\\\nabla f(x), d \\\\rangle`.\n+        \"\"\"\n+\n+        class TranslatedGradientOperator(Operator):","path":"odl/solvers/functional/functional.py","position":1037,"original_position":1037,"commit_id":"0ff83b452bbf60b9b4e7f1e85d1c14610262479e","original_commit_id":"0ff83b452bbf60b9b4e7f1e85d1c14610262479e","user":{"login":"aringh","id":15774494,"avatar_url":"https://avatars.githubusercontent.com/u/15774494?v=3","gravatar_id":"","url":"https://api.github.com/users/aringh","html_url":"https://github.com/aringh","followers_url":"https://api.github.com/users/aringh/followers","following_url":"https://api.github.com/users/aringh/following{/other_user}","gists_url":"https://api.github.com/users/aringh/gists{/gist_id}","starred_url":"https://api.github.com/users/aringh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aringh/subscriptions","organizations_url":"https://api.github.com/users/aringh/orgs","repos_url":"https://api.github.com/users/aringh/repos","events_url":"https://api.github.com/users/aringh/events{/privacy}","received_events_url":"https://api.github.com/users/aringh/received_events","type":"User","site_admin":false},"body":"Didn't we add it so that `Operator + vector == Operator(x) + vector`? In this case we want `grad_(x - translation)`.\r\n\r\nOne could do\r\n```python\r\nreturn self.original_func.gradient * ResidualOperator(IdentityOperator(self.domain), self.translation)\r\n```\r\nbut is it worth it?\r\n\r\nAny other rewritings? Otherwise I keep it as it is.","created_at":"2016-09-08T14:34:30Z","updated_at":"2016-09-08T14:34:30Z","html_url":"https://github.com/odlgroup/odl/pull/498#discussion_r78018147","pull_request_url":"https://api.github.com/repos/odlgroup/odl/pulls/498","_links":{"self":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/comments/78018147"},"html":{"href":"https://github.com/odlgroup/odl/pull/498#discussion_r78018147"},"pull_request":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/498"}}},"pull_request":{"url":"https://api.github.com/repos/odlgroup/odl/pulls/498","id":77972925,"html_url":"https://github.com/odlgroup/odl/pull/498","diff_url":"https://github.com/odlgroup/odl/pull/498.diff","patch_url":"https://github.com/odlgroup/odl/pull/498.patch","issue_url":"https://api.github.com/repos/odlgroup/odl/issues/498","number":498,"state":"open","locked":false,"title":"Issue 246  functional","user":{"login":"aringh","id":15774494,"avatar_url":"https://avatars.githubusercontent.com/u/15774494?v=3","gravatar_id":"","url":"https://api.github.com/users/aringh","html_url":"https://github.com/aringh","followers_url":"https://api.github.com/users/aringh/followers","following_url":"https://api.github.com/users/aringh/following{/other_user}","gists_url":"https://api.github.com/users/aringh/gists{/gist_id}","starred_url":"https://api.github.com/users/aringh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aringh/subscriptions","organizations_url":"https://api.github.com/users/aringh/orgs","repos_url":"https://api.github.com/users/aringh/repos","events_url":"https://api.github.com/users/aringh/events{/privacy}","received_events_url":"https://api.github.com/users/aringh/received_events","type":"User","site_admin":false},"body":"This adds `functional`'s to `odl.solvers`.\r\n\r\nThe branch is not complete yet, but review of parts of it can start (especially the basic functionality in the functional-file).\r\n\r\nMoreover, the commit history is not very nice, but I will update this before merge.\r\n\r\n","created_at":"2016-07-19T13:11:21Z","updated_at":"2016-09-08T14:34:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"51a7c44dbf975b27fc1ee1330d330789817b9668","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/odlgroup/odl/pulls/498/commits","review_comments_url":"https://api.github.com/repos/odlgroup/odl/pulls/498/comments","review_comment_url":"https://api.github.com/repos/odlgroup/odl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/odlgroup/odl/issues/498/comments","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/0ff83b452bbf60b9b4e7f1e85d1c14610262479e","head":{"label":"odlgroup:issue-246__functional","ref":"issue-246__functional","sha":"0ff83b452bbf60b9b4e7f1e85d1c14610262479e","user":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45596393,"name":"odl","full_name":"odlgroup/odl","owner":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odlgroup/odl","description":"Operator Discretization Library","fork":false,"url":"https://api.github.com/repos/odlgroup/odl","forks_url":"https://api.github.com/repos/odlgroup/odl/forks","keys_url":"https://api.github.com/repos/odlgroup/odl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odlgroup/odl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odlgroup/odl/teams","hooks_url":"https://api.github.com/repos/odlgroup/odl/hooks","issue_events_url":"https://api.github.com/repos/odlgroup/odl/issues/events{/number}","events_url":"https://api.github.com/repos/odlgroup/odl/events","assignees_url":"https://api.github.com/repos/odlgroup/odl/assignees{/user}","branches_url":"https://api.github.com/repos/odlgroup/odl/branches{/branch}","tags_url":"https://api.github.com/repos/odlgroup/odl/tags","blobs_url":"https://api.github.com/repos/odlgroup/odl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odlgroup/odl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odlgroup/odl/git/refs{/sha}","trees_url":"https://api.github.com/repos/odlgroup/odl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/{sha}","languages_url":"https://api.github.com/repos/odlgroup/odl/languages","stargazers_url":"https://api.github.com/repos/odlgroup/odl/stargazers","contributors_url":"https://api.github.com/repos/odlgroup/odl/contributors","subscribers_url":"https://api.github.com/repos/odlgroup/odl/subscribers","subscription_url":"https://api.github.com/repos/odlgroup/odl/subscription","commits_url":"https://api.github.com/repos/odlgroup/odl/commits{/sha}","git_commits_url":"https://api.github.com/repos/odlgroup/odl/git/commits{/sha}","comments_url":"https://api.github.com/repos/odlgroup/odl/comments{/number}","issue_comment_url":"https://api.github.com/repos/odlgroup/odl/issues/comments{/number}","contents_url":"https://api.github.com/repos/odlgroup/odl/contents/{+path}","compare_url":"https://api.github.com/repos/odlgroup/odl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odlgroup/odl/merges","archive_url":"https://api.github.com/repos/odlgroup/odl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odlgroup/odl/downloads","issues_url":"https://api.github.com/repos/odlgroup/odl/issues{/number}","pulls_url":"https://api.github.com/repos/odlgroup/odl/pulls{/number}","milestones_url":"https://api.github.com/repos/odlgroup/odl/milestones{/number}","notifications_url":"https://api.github.com/repos/odlgroup/odl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odlgroup/odl/labels{/name}","releases_url":"https://api.github.com/repos/odlgroup/odl/releases{/id}","deployments_url":"https://api.github.com/repos/odlgroup/odl/deployments","created_at":"2015-11-05T07:57:55Z","updated_at":"2016-09-02T10:02:53Z","pushed_at":"2016-09-08T14:24:31Z","git_url":"git://github.com/odlgroup/odl.git","ssh_url":"git@github.com:odlgroup/odl.git","clone_url":"https://github.com/odlgroup/odl.git","svn_url":"https://github.com/odlgroup/odl","homepage":null,"size":30186,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":111,"forks":7,"open_issues":111,"watchers":12,"default_branch":"master"}},"base":{"label":"odlgroup:master","ref":"master","sha":"6e8a5c699af4d795d5cc8782390684cb8799ccc9","user":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45596393,"name":"odl","full_name":"odlgroup/odl","owner":{"login":"odlgroup","id":15667171,"avatar_url":"https://avatars.githubusercontent.com/u/15667171?v=3","gravatar_id":"","url":"https://api.github.com/users/odlgroup","html_url":"https://github.com/odlgroup","followers_url":"https://api.github.com/users/odlgroup/followers","following_url":"https://api.github.com/users/odlgroup/following{/other_user}","gists_url":"https://api.github.com/users/odlgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/odlgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odlgroup/subscriptions","organizations_url":"https://api.github.com/users/odlgroup/orgs","repos_url":"https://api.github.com/users/odlgroup/repos","events_url":"https://api.github.com/users/odlgroup/events{/privacy}","received_events_url":"https://api.github.com/users/odlgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/odlgroup/odl","description":"Operator Discretization Library","fork":false,"url":"https://api.github.com/repos/odlgroup/odl","forks_url":"https://api.github.com/repos/odlgroup/odl/forks","keys_url":"https://api.github.com/repos/odlgroup/odl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/odlgroup/odl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/odlgroup/odl/teams","hooks_url":"https://api.github.com/repos/odlgroup/odl/hooks","issue_events_url":"https://api.github.com/repos/odlgroup/odl/issues/events{/number}","events_url":"https://api.github.com/repos/odlgroup/odl/events","assignees_url":"https://api.github.com/repos/odlgroup/odl/assignees{/user}","branches_url":"https://api.github.com/repos/odlgroup/odl/branches{/branch}","tags_url":"https://api.github.com/repos/odlgroup/odl/tags","blobs_url":"https://api.github.com/repos/odlgroup/odl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/odlgroup/odl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/odlgroup/odl/git/refs{/sha}","trees_url":"https://api.github.com/repos/odlgroup/odl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/odlgroup/odl/statuses/{sha}","languages_url":"https://api.github.com/repos/odlgroup/odl/languages","stargazers_url":"https://api.github.com/repos/odlgroup/odl/stargazers","contributors_url":"https://api.github.com/repos/odlgroup/odl/contributors","subscribers_url":"https://api.github.com/repos/odlgroup/odl/subscribers","subscription_url":"https://api.github.com/repos/odlgroup/odl/subscription","commits_url":"https://api.github.com/repos/odlgroup/odl/commits{/sha}","git_commits_url":"https://api.github.com/repos/odlgroup/odl/git/commits{/sha}","comments_url":"https://api.github.com/repos/odlgroup/odl/comments{/number}","issue_comment_url":"https://api.github.com/repos/odlgroup/odl/issues/comments{/number}","contents_url":"https://api.github.com/repos/odlgroup/odl/contents/{+path}","compare_url":"https://api.github.com/repos/odlgroup/odl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/odlgroup/odl/merges","archive_url":"https://api.github.com/repos/odlgroup/odl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/odlgroup/odl/downloads","issues_url":"https://api.github.com/repos/odlgroup/odl/issues{/number}","pulls_url":"https://api.github.com/repos/odlgroup/odl/pulls{/number}","milestones_url":"https://api.github.com/repos/odlgroup/odl/milestones{/number}","notifications_url":"https://api.github.com/repos/odlgroup/odl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/odlgroup/odl/labels{/name}","releases_url":"https://api.github.com/repos/odlgroup/odl/releases{/id}","deployments_url":"https://api.github.com/repos/odlgroup/odl/deployments","created_at":"2015-11-05T07:57:55Z","updated_at":"2016-09-02T10:02:53Z","pushed_at":"2016-09-08T14:24:31Z","git_url":"git://github.com/odlgroup/odl.git","ssh_url":"git@github.com:odlgroup/odl.git","clone_url":"https://github.com/odlgroup/odl.git","svn_url":"https://github.com/odlgroup/odl","homepage":null,"size":30186,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":111,"forks":7,"open_issues":111,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/498"},"html":{"href":"https://github.com/odlgroup/odl/pull/498"},"issue":{"href":"https://api.github.com/repos/odlgroup/odl/issues/498"},"comments":{"href":"https://api.github.com/repos/odlgroup/odl/issues/498/comments"},"review_comments":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/498/comments"},"review_comment":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/odlgroup/odl/pulls/498/commits"},"statuses":{"href":"https://api.github.com/repos/odlgroup/odl/statuses/0ff83b452bbf60b9b4e7f1e85d1c14610262479e"}}}}
{"actor":{"display_login":"aringh"}}