Sleipnir Python API
Loading...
Searching...
No Matches
jormungandr.autodiff.Gradient Class Reference

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)
 

Detailed Description

This class calculates the gradient of a a variable with respect to a
vector of variables.

The gradient is only recomputed if the variable expression is
quadratic or higher order.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None jormungandr.autodiff.Gradient.__init__ (   self,
Variable  variable,
Variable  wrt 
)
Constructs a Gradient object.

Parameter ``variable``:
    Variable of which to compute the gradient.

Parameter ``wrt``:
    Variable with respect to which to compute the gradient.

◆ __init__() [2/2]

None jormungandr.autodiff.Gradient.__init__ (   self,
Variable  variable,
VariableMatrix  wrt 
)
Constructs a Gradient object.

Parameter ``variable``:
    Variable of which to compute the gradient.

Parameter ``wrt``:
    Vector of variables with respect to which to compute the gradient.

Member Function Documentation

◆ get()

VariableMatrix jormungandr.autodiff.Gradient.get (   self)
Returns the gradient as a VariableMatrix.

This is useful when constructing optimization problems with
derivatives in them.

◆ value()

scipy.sparse.csc_matrix[float] jormungandr.autodiff.Gradient.value (   self)
Evaluates the gradient at wrt's value.

The documentation for this class was generated from the following file: