This class is an adaptor type that performs value updates of an expression's computational graph in a way that skips duplicates.
More...
#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/autodiff/ExpressionGraph.hpp>
This class is an adaptor type that performs value updates of an expression's computational graph in a way that skips duplicates.
◆ ExpressionGraph()
sleipnir::detail::ExpressionGraph::ExpressionGraph |
( |
ExpressionPtr & | root | ) |
|
|
inlineexplicit |
Generates the deduplicated computational graph for the given expression.
- Parameters
-
root | The root node of the expression. |
◆ ComputeAdjoints()
void sleipnir::detail::ExpressionGraph::ComputeAdjoints |
( |
function_ref< void(int row, double adjoint)> | func | ) |
|
|
inline |
Updates the adjoints in the expression graph, effectively computing the gradient.
- Parameters
-
func | A function that takes two arguments: an int for the gradient row, and a double for the adjoint (gradient value). |
◆ GenerateGradientTree()
Returns the variable's gradient tree.
- Parameters
-
wrt | Variables with respect to which to compute the gradient. |
◆ Update()
void sleipnir::detail::ExpressionGraph::Update |
( |
| ) |
|
|
inline |
Update the values of all nodes in this computational tree based on the values of their dependent nodes.
The documentation for this class was generated from the following file:
- /home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/autodiff/ExpressionGraph.hpp