Abstract Function

AbstractFunction

class disropt.functions.abstract_function.AbstractFunction[source]

Bases: object

AbstractFunction class. This should be the parent of all specific (objective) functions.

input_shape

shape of the input of the function

Type

tuple

output_shape

shape of the output of the function

Type

tuple

differentiable

True if the function is differentiable

Type

bool

affine

True if the function is affine

Type

bool

quadratic

True if the function is quadratic

Type

bool

eval(x)[source]

Evaluate the function at a point x

Parameters

x (ndarray) – input point

Return type

ndarray

jacobian(x, **kwargs)[source]

Evaluate the jacobian of the the function at a point x

Parameters

x (ndarray) – input point

Return type

ndarray

subgradient(x, **kwargs)[source]

Evaluate the subgradient of the function at a point x

Parameters

x (ndarray) – input point

Raises

ValueError – subgradient is defined only for functions with scalar output

Return type

ndarray

get_parameters()[source]
hessian(x, **kwargs)[source]

Evaluate the hessian of the the function at a point x

Parameters

x (ndarray) – input point

Return type

ndarray

property is_affine
property is_differentiable
property is_quadratic