Learn R Programming

CVXR (version 1.0)

KLDiv-class: The KLDiv class.

Description

The elementwise KL-divergence \(x\log(x/y) - x + y\).

Usage

KLDiv(x, y)

# S4 method for KLDiv to_numeric(object, values)

# S4 method for KLDiv sign_from_args(object)

# S4 method for KLDiv is_atom_convex(object)

# S4 method for KLDiv is_atom_concave(object)

# S4 method for KLDiv is_incr(object, idx)

# S4 method for KLDiv is_decr(object, idx)

# S4 method for KLDiv .grad(object, values)

# S4 method for KLDiv .domain(object)

Arguments

x

An '>Expression or numeric constant.

y

An '>Expression or numeric constant.

object

A '>KLDiv object.

values

A list of numeric values for the arguments

idx

An index into the atom.

Methods (by generic)

  • to_numeric: The KL-divergence evaluted elementwise on the input value.

  • sign_from_args: The atom is positive.

  • is_atom_convex: The atom is convex.

  • is_atom_concave: The atom is not concave.

  • is_incr: The atom is not monotonic in any argument.

  • is_decr: The atom is not monotonic in any argument.

  • .grad: Gives the (sub/super)gradient of the atom w.r.t. each variable

  • .domain: Returns constraints describng the domain of the node

Slots

x

An '>Expression or numeric constant.

y

An '>Expression or numeric constant.