API Reference

Interface Meta-Functions

The main goal of this function to provide a universal interface to smooth functions and proximable functions to be used by proximal gradient algorithms.

ProximalCore.gradient!Function
gradient!(y, f, x)

In-place gradient (and value) of f at x.

The gradient is written to the (pre-allocated) array y, which should have the same shape/size as x.

Returns the value f at x.

See also: gradient.

source
ProximalCore.gradientMethod
gradient(f, x)

Gradient (and value) of f at x.

Return a tuple (y, fx) consisting of

  • y: the gradient of f at x
  • fx: the value of f at x

See also: gradient!.

source
ProximalCore.proxFunction
prox(f, x, gamma=1)

Proximal mapping for f, evaluated at x, with stepsize gamma.

The proximal mapping is defined as

\[\mathrm{prox}_{\gamma f}(x) = \arg\min_z \left\{ f(z) + \tfrac{1}{2\gamma}\|z-x\|^2 \right\}.\]

Returns a tuple (y, fy) consisting of

  • y: the output of the proximal mapping of f at x with stepsize gamma
  • fy: the value of f at y

See also: prox!.

source
ProximalCore.prox!Function
prox!(y, f, x, gamma=1)

In-place proximal mapping for f, evaluated at x, with stepsize gamma.

The proximal mapping is defined as

\[\mathrm{prox}_{\gamma f}(x) = \arg\min_z \left\{ f(z) + \tfrac{1}{2\gamma}\|z-x\|^2 \right\}.\]

The result is written to the (pre-allocated) array y, which should have the same shape/size as x.

Returns the value of f at y.

See also: prox.

source

Properties

ProximalCore.is_affine_indicatorMethod
is_affine_indicator(T::Type)

Returns true if the type T represents the indicator of an affine set. An affine set is a set that can be represented as the solution set of a system of linear equations. In other words, f(x) = 0 if Ax = b, for a given matrix A and vector b, and ∞ otherwise.

source
ProximalCore.is_cone_indicatorMethod
is_cone_indicator(T::Type)

Returns true if the type T represents the indicator function of a cone. A cone is a set C such that if x ∈ C, then λx ∈ C for any λ ≥ 0. In other words, is a set that is closed under non-negative scaling. ``

source
ProximalCore.is_convexMethod
is_convex(T::Type)

Returns true if the type T represents a convex function. A function f(x) is convex if its domain is a convex set and for all x, y in the domain and for all λ in [0, 1], we have f(λx + (1-λ)y) ≤ λf(x) + (1-λ)f(y).

source
ProximalCore.is_generalized_quadraticMethod
is_generalized_quadratic(T::Type)

Returns true if the type T represents a generalized quadratic function, i.e. a quadratic function over a subspace and +∞ outside of it. A quadratic function has the form f(x)=(1/2)*<Ax, x> + <b, x> + c where A is a symmetric matrix, b is a vector, and c a real number.

source
ProximalCore.is_locally_smoothMethod
is_locally_smooth(T::Type)

Returns true if the type T represents a locally smooth function. A function f(x) is locally smooth if it is smooth on every open set within its domain. If f is locally smooth, then gradient!(y, f, x) is expected to be defined, and it should return the value of f at x and store the gradient in y.

source
ProximalCore.is_positively_homogeneousMethod
is_positively_homogeneous(T::Type)

Returns true if the type T represents a positively homogeneous function. A function f(x) is positively homogeneous if f(λx) = λf(x) for all λ ≥ 0.

source
ProximalCore.is_proximableMethod
is_proximable(T::Type)

Returns true if the type T has a proximal operator that can be expressed in a closed formula. (i.e. prox! function is defined for the type T).

source
ProximalCore.is_quadraticMethod
is_quadratic(T::Type)

Returns true if the type T represents a quadratic function. A function f(x) is quadratic if it is smooth and its Hessian is constant.

source
ProximalCore.is_separableMethod
is_separable(T::Type)

Returns true if the type T represents a separable function. A function f(x) is separable if it can applied to each element of x independently.

source
ProximalCore.is_set_indicatorMethod
is_set_indicator(T::Type)

Returns true if the type T represents an indicator function of a set. The indicator of a set S is a function associating 0 to points in S, and ∞ otherwise.

source
ProximalCore.is_singleton_indicatorMethod
is_singleton_indicator(T::Type)

Returns true if the type T represents a singleton indicator function. An indicator function f(x) is a singleton if it is 0 for a single value and ∞ otherwise.

source
ProximalCore.is_smoothMethod
is_smooth(T::Type)

Returns true if the type T represents a smooth function. A function f(x) is smooth if it is continuously differentiable and its gradient is Lipschitz. If f is smooth, then gradient!(y, f, x) is expected to be defined, and it should return the value of f at x and store the gradient in y.

source
ProximalCore.is_strongly_convexMethod
is_strongly_convex(T::Type)

Returns true if the type T represents a strongly convex function. A function f(x) is strongly convex if it is convex and there exists a positive constant μ such that f(x) - μ/2 * ||x||^2 is convex.

source
ProximalCore.is_supportMethod
is_support(T::Type)

Returns true if the type T represents a support function of a set. A function f(x) is a support function of a set C if f(x) = sup{⟨x, c⟩ : c ∈ C}.

source

Basic Functions

ProximalCore.ConvexConjugateType
ConvexConjugate(f)

Constructs the convex conjugate of the function f. The convex conjugate of a function f is defined as f*(y) = sup_x {<x, y> - f(x)}.

source
ProximalCore.IndZeroType
IndZero()

Constructs the indicator function of the zero set, i.e., the function that is zero if the input is zero and infinity otherwise.

Example

julia> f = ProximalCore.IndZero()
ProximalCore.IndZero()

julia> f([1.0, 2.0, 3.0])
Inf

julia> f([0.0, 0.0, 0.0])
0.0
source
ProximalCore.ZeroType
Zero()

Constructs the zero function, i.e., the function that is zero everywhere.

Example

julia> f = ProximalCore.Zero()
ProximalCore.Zero()

julia> f(rand(3))
0.0
source