Functions of two expression arguments.
Usage
sd_elementwise_mult(l, r)
sd_matmul(x, y)
sd_quad_over_lin(l, r)
sd_rel_entr(l, r)
sd_rel_entr_first_scalar(l, r)
sd_rel_entr_second_scalar(l, r)
sd_atan2(y, x)Details
sd_elementwise_multelementwise (Hadamard) product.
sd_matmulmatrix product \(x y\).
sd_quad_over_linthe quadratic-over-linear \(\lVert x \rVert^2 / y\).
sd_rel_entrrelative entropy \(x \log(x / y)\). Like 'sparsediffpy'
make_rel_entr, it dispatches on operand size: a scalarlwith a non-scalarrusessd_rel_entr_first_scalar, the reverse usessd_rel_entr_second_scalar, and otherwise it is elementwise.sd_rel_entr_first_scalar,sd_rel_entr_second_scalarrelative entropy with a scalar first or second argument broadcast against the other.
sd_atan2the elementwise two-argument inverse tangent \(\mathrm{atan2}(y, x)\), the angle of the point \((x, y)\); note the argument order,
yfirst.
The relative entropies and sd_atan2 take two different variables
(sd_variable) as their arguments, not composite expressions,
and sd_atan2 needs them to have the same shape; anything else is an
error. The denominator r of sd_quad_over_lin must be a scalar
variable, different from the numerator; anything else is an error. Its
numerator l may be a composite expression that does not involve
r, but the engine then has the Jacobian only: the Hessian needs a
variable numerator.
