tf.compat.v1.hessians  |  TensorFlow v2.16.1 (original) (raw)

tf.compat.v1.hessians

Stay organized with collections Save and categorize content based on your preferences.

Constructs the Hessian of sum of ys with respect to x in xs.

tf.compat.v1.hessians(
    ys,
    xs,
    name='hessians',
    colocate_gradients_with_ops=False,
    gate_gradients=False,
    aggregation_method=None
)

hessians() adds ops to the graph to output the Hessian matrix of yswith respect to xs. It returns a list of Tensor of length len(xs)where each tensor is the Hessian of sum(ys).

The Hessian is a matrix of second-order partial derivatives of a scalar tensor (see https://en.wikipedia.org/wiki/Hessian_matrix for more details).

Args
ys A Tensor or list of tensors to be differentiated.
xs A Tensor or list of tensors to be used for differentiation.
name Optional name to use for grouping all the gradient ops together. defaults to 'hessians'.
colocate_gradients_with_ops See gradients() documentation for details.
gate_gradients See gradients() documentation for details.
aggregation_method See gradients() documentation for details.
Returns
A list of Hessian matrices of sum(ys) for each x in xs.
Raises
LookupError if one of the operations between xs and ys does not have a registered gradient function.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.