# picos.expressions.exp_entropy¶

Implements Entropy and NegativeEntropy.

Classes

class picos.expressions.exp_entropy.Entropy(x, y=None)[source]

Entropy or negative relative entropy of an affine expression.

Negative relative entropy is also known as the perspective of the logarithm.

Definition

Let be an -dimensional real affine expression.

1. If no additional expression is given, this is the entropy 2. If an additional affine expression of same shape as is given, this is the negative relative entropy (or logarithmic perspective) Warning

When you pose a lower bound on this expression, then PICOS enforces through an auxiliary constraint during solution search. When an additional expression is given, PICOS enforces as well.

Denote addition with another expression on the right-hand side.

__ge__(other)[source]

Return a constraint that the expression is lower-bounded.

__init__(x, y=None)[source]

Construct an Entropy.

Parameters
• x (AffineExpression) – The affine expression .

• y (AffineExpression) – An additional affine expression . If necessary, PICOS will attempt to reshape or broadcast it to the shape of .

__neg__()[source]

Denote the negation of the expression.

Denote addition with another expression on the left-hand side.

__sub__(other)[source]

Denote subtraction of another expression from the expression.

property n

Length of x.

property x

The expression .

property y

The additional expression , or None.

class picos.expressions.exp_entropy.NegativeEntropy(x, y=None)[source]

Negative or relative entropy of an affine expression.

Relative entropy is also known as the Kullback-Leibler divergence.

Definition

Let be an -dimensional real affine expression.

1. If no additional expression is given, this is the negative entropy 2. If an additional affine expression of same shape as is given, this is the relative entropy (or Kullback-Leibler divergence) Warning

When you pose an upper bound on this expression, then PICOS enforces through an auxiliary constraint during solution search. When an additional expression is given, PICOS enforces as well.

Denote addition with another expression on the right-hand side.

__init__(x, y=None)[source]

Construct a NegativeEntropy.

Parameters
• x (AffineExpression) – The affine expression .

• y (AffineExpression) – An additional affine expression . If necessary, PICOS will attempt to reshape or broadcast it to the shape of .

__le__(other)[source]

Return a constraint that the expression is upper-bounded.

__neg__()[source]

Denote the negation of the expression.

Denote addition with another expression on the left-hand side.

__sub__(other)[source]

Denote subtraction of another expression from the expression.

property n

Length of x.

property x

The expression .

property y

The additional expression , or None.