Jacobian¶
Calculate the Jacobian matrix for a given graph with respect to one or more of its parameters.
This node accepts a graph (a function of some inputs) that calculates a vector-valued output, and returns a modified graph that will calculate, for a subset of inputs of interest, the matrix of partial derivatives for each of the vector components. This matrix represents a linear approximation to the function at the given point. For a function of n inputs and m outputs, the Jacobian matrix is an m x n matrix. Note that calculating the Jacobian can be computationally expensive; in some situations one may instead calculate Jacobian-vector products, which are more efficient. More Info... Version 0.5.0
Ports/Properties¶
function¶
Function to process.
- verbose name: Function
- default value: None
- port type: GraphPort
- value type: Graph
function__signature¶
Signature for the "function" input. This represents the signature for the subgraph that is wired into the "function" port. This is formatted as in (a,b,c) ~> (b,c) where a,b,c are names of placeholders that are expected in the subgraph that goes in, and out of, the "function" port. Alternatively, it can also be provided in data structure form as a list of lists, as in: [['a','b','c'], ['b','c'].
- verbose name: Function [Signature]
- default value: (params)~>(params)
- port type: Port
- value type: object (can be None)
variables¶
Variables with respect to which the gradient will be calculated. If not given, this defaults to the first positional argument of the function, i.e., the first name in the signature.
- verbose name: Differentiate With Respect To
- default value: None
- port type: ListPort
- value type: list (can be None)
extra_outputs¶
If True, the derivative will only be calculated for the first output of the graph, with additional outputs being passed through unchanged. In this case the graph is expected to return a list of two or more elements.
- verbose name: Have Extra Outputs
- default value: False
- port type: BoolPort
- value type: bool (can be None)
backend¶
Compute backend to use. If the chosen backend is not installed, the system will fall back to the backend configured in the backend_fallback setting (numpy by default). This computation is currently only supported by the jax backend, and the data will be converted to this backend unless the backend is set to 'keep', which you can choose to reduce overhead if you know that the data is already in the jax backend.
- verbose name: Backend
- default value: jax
- port type: EnumPort
- value type: str (can be None)
automove_data¶
Automatically move data to the chosen backend. This adds a slight performance overhead if the data is already on the desired backend and is only included for convenience.
- verbose name: Automove Data
- default value: True
- port type: BoolPort
- value type: bool (can be None)
mode¶
Whether to calculate the Jacobian using forward- or reverse-mode autodifferentiation. Which is more efficient depends on the shape of the Jacobian matrix (i.e., the number of inputs and outputs).
- verbose name: Mode
- default value: forward
- port type: EnumPort
- value type: str (can be None)
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)