View source on GitHub
|
Return the least-squares solution to a linear matrix equation.
tf.keras.ops.lstsq(
a, b, rcond=None
)
Computes the vector x that approximately solves the equation
a @ x = b. The equation may be under-, well-, or over-determined
(i.e., the number of linearly independent rows of a can be less than,
equal to, or greater than its number of linearly independent columns).
If a is square and of full rank, then x (but for round-off error)
is the exact solution of the equation. Else, x minimizes the
L2 norm of b - a * x.
If there are multiple minimizing solutions, the one with the smallest L2 norm is returned.
Returns | |
|---|---|
Tensor with shape (N,) or (N, K) containing
the least-squares solutions.
|
View source on GitHub