![]() |
Sleipnir C++ API
|
#include <sleipnir/autodiff/adjoint_expression_graph.hpp>
Public Member Functions | |
| AdjointExpressionGraph (const Variable< Scalar > &root) | |
| void | update_values () |
| VariableMatrix< Scalar > | generate_gradient_tree (const VariableMatrix< Scalar > &wrt) const |
| void | append_gradient_triplets (gch::small_vector< Eigen::Triplet< Scalar > > &triplets, int row, const VariableMatrix< Scalar > &wrt) const |
This class is an adaptor type that performs value updates of an expression's adjoint graph.
| Scalar | Scalar type. |
|
inlineexplicit |
Generates the adjoint graph for the given expression.
| root | The root node of the expression. |
|
inline |
Updates the adjoints in the expression graph (computes the gradient) then appends the adjoints of wrt to the sparse matrix triplets.
| triplets | The sparse matrix triplets. |
| row | The row of wrt. |
| wrt | Vector of variables with respect to which to compute the Jacobian. |
|
inline |
Returns the variable's gradient tree.
This function lazily allocates variables, so elements of the returned VariableMatrix will be empty if the corresponding element of wrt had no adjoint. Ensure Variable::expr isn't nullptr before calling member functions.
| wrt | Variables with respect to which to compute the gradient. |
|
inline |
Update the values of all nodes in this adjoint graph based on the values of their dependent nodes.