View source: R/141_problems_problem.R
| backward | R Documentation |
Differentiates through the solution map of problem: populates
the gradient slot of each Parameter with the sensitivity of
a scalar-valued function of the variables (defaulting to the
sum-of-x loss; override per variable by setting
gradient(variable) <- before calling) with respect to that
parameter. Mirrors cvxpy.Problem.backward().
backward(problem)
problem |
A solved |
Must be called after psolve() with requires_grad = TRUE.
The problem (for piping); side-effect sets
gradient(param) on each parameter.
derivative(), psolve(), gradient()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.