![]() |
Sleipnir Python API
|
Public Member Functions | |
| None | __init__ (self, Variable variable, Variable wrt) |
| None | __init__ (self, Variable variable, VariableMatrix wrt) |
| VariableMatrix | get (self) |
| scipy.sparse.csc_matrix[float] | value (self) |
This class calculates the gradient of a variable with respect to a
vector of variables.
The gradient is only recomputed if the variable expression is
quadratic or higher order.
Template parameter ``Scalar``:
Scalar type.
Constructs a Gradient object.
Parameter ``variable``:
Variable of which to compute the gradient.
Parameter ``wrt``:
Variable with respect to which to compute the gradient.
| None jormungandr.autodiff.Gradient.__init__ | ( | self, | |
| Variable | variable, | ||
| VariableMatrix | wrt | ||
| ) |
| VariableMatrix jormungandr.autodiff.Gradient.get | ( | self | ) |
Returns the gradient as a VariableMatrix.
This is useful when constructing optimization problems with
derivatives in them.
Returns:
The gradient as a VariableMatrix.
| scipy.sparse.csc_matrix[float] jormungandr.autodiff.Gradient.value | ( | self | ) |
Evaluates the gradient at wrt's value.
Returns:
The gradient at wrt's value.