Computes the maximum error for dy/dx between the computed Jacobian and the
numerically estimated Jacobian.
This function will modify the tensors passed in as it adds more operations
and hence changing the consumers of the operations of the input tensors.
This function adds operations to the current session. To compute the error
using a particular device, such as a GPU, use the standard methods for
setting a device (e.g. using with sess.graph.device() or setting a device
function in the session constructor).
Args
x
a tensor or list of tensors
x_shape
the dimensions of x as a tuple or an array of ints. If x is a list,
then this is the list of shapes.
y
a tensor
y_shape
the dimensions of y as a tuple or an array of ints.
x_init_value
(optional) a numpy array of the same shape as "x"
representing the initial value of x. If x is a list, this should be a list
of numpy arrays. If this is none, the function will pick a random tensor
as the initial value.
delta
(optional) the amount of perturbation.
init_targets
list of targets to run to initialize model params.
extra_feed_dict
dict that allows fixing specified tensor values
during the Jacobian calculation.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.test.compute_gradient_error\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/gradient_checker.py#L346-L393) |\n\nComputes the gradient error. (deprecated) \n\n tf.compat.v1.test.compute_gradient_error(\n x,\n x_shape,\n y,\n y_shape,\n x_init_value=None,\n delta=0.001,\n init_targets=None,\n extra_feed_dict=None\n )\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.test.compute_gradient in 2.0, which has better support for functions. Note that the two versions have different usage, so code change is needed.\n\nComputes the maximum error for dy/dx between the computed Jacobian and the\nnumerically estimated Jacobian.\n\nThis function will modify the tensors passed in as it adds more operations\nand hence changing the consumers of the operations of the input tensors.\n\nThis function adds operations to the current session. To compute the error\nusing a particular device, such as a GPU, use the standard methods for\nsetting a device (e.g. using with sess.graph.device() or setting a device\nfunction in the session constructor).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `x` | a tensor or list of tensors |\n| `x_shape` | the dimensions of x as a tuple or an array of ints. If x is a list, then this is the list of shapes. |\n| `y` | a tensor |\n| `y_shape` | the dimensions of y as a tuple or an array of ints. |\n| `x_init_value` | (optional) a numpy array of the same shape as \"x\" representing the initial value of x. If x is a list, this should be a list of numpy arrays. If this is none, the function will pick a random tensor as the initial value. |\n| `delta` | (optional) the amount of perturbation. |\n| `init_targets` | list of targets to run to initialize model params. |\n| `extra_feed_dict` | dict that allows fixing specified tensor values during the Jacobian calculation. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The maximum error in between the two Jacobians. ||\n\n\u003cbr /\u003e"]]