Computes the singular value decompositions of one or more matrices.
Computes the SVD of each inner matrix in `input` such that `input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])`
# a is a tensor containing a batch of matrices.
# s is a tensor of singular values for each matrix.
# u is the tensor containing the left singular vectors for each matrix.
# v is the tensor containing the right singular vectors for each matrix.
s, u, v = svd(a)
s, _, _ = svd(a, compute_uv=False)
Nested Classes
class | Svd.Options | Optional attributes for Svd
|
Constants
String | OP_NAME | The name of this op, as known by TensorFlow core engine |
Public Methods
static Svd.Options |
computeUv(Boolean computeUv)
|
static <T extends TType> Svd<T> |
create(Scope scope, Operand<T> input, Options... options)
Factory method to create a class wrapping a new Svd operation.
|
static Svd.Options |
fullMatrices(Boolean fullMatrices)
|
Output<T> |
s()
Singular values.
|
Output<T> |
u()
Left singular vectors.
|
Output<T> |
v()
Left singular vectors.
|
Inherited Methods
Constants
public static final String OP_NAME
The name of this op, as known by TensorFlow core engine
Public Methods
public static Svd.Options computeUv (Boolean computeUv)
Parameters
computeUv | If true, left and right singular vectors will be computed and returned in `u` and `v`, respectively. If false, `u` and `v` are not set and should never referenced. |
---|
public static Svd<T> create (Scope scope, Operand<T> input, Options... options)
Factory method to create a class wrapping a new Svd operation.
Parameters
scope | current scope |
---|---|
input | A tensor of shape `[..., M, N]` whose inner-most 2 dimensions form matrices of size `[M, N]`. Let `P` be the minimum of `M` and `N`. |
options | carries optional attributes values |
Returns
- a new instance of Svd
public static Svd.Options fullMatrices (Boolean fullMatrices)
Parameters
fullMatrices | If true, compute full-sized `u` and `v`. If false (the default), compute only the leading `P` singular vectors. Ignored if `compute_uv` is `False`. |
---|
public Output<T> u ()
Left singular vectors. If `full_matrices` is `False` then shape is `[..., M, P]`; if `full_matrices` is `True` then shape is `[..., M, M]`. Undefined if `compute_uv` is `False`.
public Output<T> v ()
Left singular vectors. If `full_matrices` is `False` then shape is `[..., N, P]`. If `full_matrices` is `True` then shape is `[..., N, N]`. Undefined if `compute_uv` is false.