Automatic Differentiation =============================== Backward-Mode Automatic Differentiation -------------------------------------------------- .. uml:: title Abstract Model of Backward-Mode Automatic Differentiation package graph { class child_node { + using scalar_type = Scalar + node() : shared_ptr + sensitivity() : scalar_type } class node { + using scalar_type = Scalar + children() : vector } node o-- child_node class node_differentiator { + using scalar_type = Scalar + compute(top_node: shared_ptr) + coeff(node: shared_ptr) : scalar_type } node_differentiator o-- node } class variable { + using scalar_type = Scalar + value() : scalar_type + node() : shared_ptr } variable o-- node note as variable_note This class provides many arithmetic operators. endnote variable .. variable_note class "(Global Functions)" as global_func_diff { + differentiate(func_value: FuncValue, args: Args) : Result } global_func_diff ..> variable global_func_diff ..> node_differentiator note as differentiate_note FuncValue and Args types can be * variable class, * Eigen::Matrix class. Result type varies according to FuncValue and Args types. endnote global_func_diff . differentiate_note