Learn R Programming

CVXR (version 1.9.1)

gradient: Access the gradient of a Variable or Parameter

Description

Used by psolve() with requires_grad = TRUE and Problem$backward(). Stores a numeric array of the same shape as the leaf, or NULL (the default).

Usage

gradient(x)

gradient(x) <- value

Value

The gradient (numeric array) or NULL.

Arguments

x

A Variable or Parameter.

value

A numeric array of the same shape as x, or NULL.