entr function

Entropy Function

Entropy Function

The elementwise entropy function, xlog(x)-xlog(x). methods

entr(x)

Arguments

  • x: An Expression , vector, or matrix.

Returns

An Expression representing the entropy of the input.

Examples

x <- Variable(5) obj <- Maximize(sum(entr(x))) prob <- Problem(obj, list(sum(x) == 1)) result <- solve(prob) result$getValue(x)
  • Maintainer: Anqi Fu
  • License: Apache License 2.0 | file LICENSE
  • Last published: 2024-11-07