Differentiate a target node with respect to a given node by numerical differentiation.
approx_gradient(graph, target, node, index = 1, eps = 1e-04)
cg_graph object, graph that is differentiated.
cg_node object, node in the graph that is differentiated. Alternatively, argument target
can be a character scalar denoting the name of the node in the graph that is differentiated.
cg_node object, node with respect to which the target node is differentiated. Alternatively, argument node
can be a character scalar denoting the name of the node in the graph to which the target node is differentiated.
numerical scalar, index of the target node that is differentiated. Defaults to the first element.
numerical scalar, step size. Defaults to 1e-4.
numerical vector or array.