Sleipnir C++ API
|
#include <sleipnir/autodiff/ExpressionGraph.hpp>
Public Member Functions | |
ExpressionGraph (Variable &root) | |
void | Update () |
VariableMatrix | GenerateGradientTree (const VariableMatrix &wrt) const |
void | ComputeAdjoints (function_ref< void(int row, double adjoint)> func) |
This class is an adaptor type that performs value updates of an expression's computational graph in a way that skips duplicates.
|
inlineexplicit |
Generates the deduplicated computational graph for the given expression.
root | The root node of the expression. |
|
inline |
Updates the adjoints in the expression graph, effectively computing the gradient.
func | A function that takes two arguments: an int for the gradient row, and a double for the adjoint (gradient value). |
|
inline |
Returns the variable's gradient tree.
wrt | Variables with respect to which to compute the gradient. |
|
inline |
Update the values of all nodes in this computational tree based on the values of their dependent nodes.