Skip to main content

function_space.jacobian

function_space.jacobian(model, params, inputs, dtype, /)

The Jacobian of the flattened outputs with respect to params.

One jacrev per example, vmapped over the examples.

Parameters

Name Type Description Default
model ModelFn The model as a function of the params. required
params Params The parameters. Their order sets the order of the columns. required
inputs Inputs \(N\) examples. Shared leaves (is_shared) go to every example as they are. required
dtype torch.dtype The dtype of the result. required

Returns

Name Type Description
Tensor The Jacobian, \([N E, P]\), for \(E\) output entries per example and \(P\) parameters. Row \(n E + e\) is output entry \(e\) of example \(n\).