Esempio n. 1
0
def self_adjoint_eigvals(matrix, name=None):
  """Computes the eigenvalues a self-adjoint  matrix.

  Args:
    matrix: `Tensor` of shape `[N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues of `matrix`. Shape is `[N]`.
  """
  # pylint: disable=protected-access
  e, _ = gen_linalg_ops._self_adjoint_eig_v2(matrix, compute_v=False, name=name)
  return e
Esempio n. 2
0
def self_adjoint_eigvals(tensor, name=None):
  """Computes the eigenvalues of one or more self-adjoint matrices.

  Args:
    tensor: `Tensor` of shape `[..., N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[..., N]`. The vector `e[..., :]` contains the `N`
      eigenvalues of `tensor[..., :, :]`.
  """
  # pylint: disable=protected-access
  e, _ = gen_linalg_ops._self_adjoint_eig_v2(tensor, compute_v=False, name=name)
  return e
Esempio n. 3
0
def self_adjoint_eigvals(tensor, name=None):
  """Computes the eigenvalues of one or more self-adjoint matrices.

  Args:
    tensor: `Tensor` of shape `[..., N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[..., N]`. The vector `e[..., :]` contains the `N`
      eigenvalues of `tensor[..., :, :]`.
  """
  # pylint: disable=protected-access
  e, _ = gen_linalg_ops._self_adjoint_eig_v2(tensor, compute_v=False, name=name)
  return e
Esempio n. 4
0
def self_adjoint_eigvals(matrix, name=None):
    """Computes the eigenvalues a self-adjoint  matrix.

  Args:
    matrix: `Tensor` of shape `[N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues of `matrix`. Shape is `[N]`.
  """
    # pylint: disable=protected-access
    e, _ = gen_linalg_ops._self_adjoint_eig_v2(matrix,
                                               compute_v=False,
                                               name=name)
    return e
Esempio n. 5
0
def self_adjoint_eig(matrix, name=None):
  """Computes the eigen decomposition of a self-adjoint matrix.

  Computes the eigenvalues and eigenvectors of an N-by-N matrix `matrix` such
  that `matrix * v[:,i] = e(i) * v[:,i]`, for i=0...N-1.

  Args:
    matrix: `Tensor` of shape `[N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[N]`.
    v: Eigenvectors. Shape is `[N, N]`. The columns contain the eigenvectors of
      `matrix`.
  """
  # pylint: disable=protected-access
  e, v = gen_linalg_ops._self_adjoint_eig_v2(matrix, compute_v=True, name=name)
  return e, v
Esempio n. 6
0
def self_adjoint_eig(tensor, name=None):
  """Computes the eigen decomposition of a batch of self-adjoint matrices.

  Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices
  in `tensor` such that
  `tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i]`, for i=0...N-1.

  Args:
    tensor: `Tensor` of shape `[..., N, N]`. Only the lower triangular part of
      each inner inner matrix is referenced.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[..., N]`.
    v: Eigenvectors. Shape is `[..., N, N]`. The columns of the inner most
      matrices contain eigenvectors of the corresponding matrices in `tensor`
  """
  # pylint: disable=protected-access
  e, v = gen_linalg_ops._self_adjoint_eig_v2(tensor, compute_v=True, name=name)
  return e, v
Esempio n. 7
0
def self_adjoint_eigvals(tensor, name=None):
  """Computes the eigenvalues of one or more self-adjoint matrices.

  Note: If your program backpropagates through this function, you should replace
  it with a call to tf.self_adjoint_eig (possibly ignoring the second output) to
  avoid computing the eigen decomposition twice. This is because the
  eigenvectors are used to compute the gradient w.r.t. the eigenvalues. See
  _SelfAdjointEigV2Grad in linalg_grad.py.

  Args:
    tensor: `Tensor` of shape `[..., N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[..., N]`. The vector `e[..., :]` contains the `N`
      eigenvalues of `tensor[..., :, :]`.
  """
  # pylint: disable=protected-access
  e, _ = gen_linalg_ops._self_adjoint_eig_v2(tensor, compute_v=False, name=name)
  return e
Esempio n. 8
0
def self_adjoint_eig(tensor, name=None):
  """Computes the eigen decomposition of a batch of self-adjoint matrices.

  Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices
  in `tensor` such that
  `tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i]`, for i=0...N-1.

  Args:
    tensor: `Tensor` of shape `[..., N, N]`. Only the lower triangular part of
      each inner inner matrix is referenced.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[..., N]`.
    v: Eigenvectors. Shape is `[..., N, N]`. The columns of the inner most
      matrices contain eigenvectors of the corresponding matrices in `tensor`
  """
  # pylint: disable=protected-access
  e, v = gen_linalg_ops._self_adjoint_eig_v2(tensor, compute_v=True, name=name)
  return e, v
Esempio n. 9
0
def self_adjoint_eigvals(tensor, name=None):
  """Computes the eigenvalues of one or more self-adjoint matrices.

  Note: If your program backpropagates through this function, you should replace
  it with a call to tf.self_adjoint_eig (possibly ignoring the second output) to
  avoid computing the eigen decomposition twice. This is because the
  eigenvectors are used to compute the gradient w.r.t. the eigenvalues. See
  _SelfAdjointEigV2Grad in linalg_grad.py.

  Args:
    tensor: `Tensor` of shape `[..., N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[..., N]`. The vector `e[..., :]` contains the `N`
      eigenvalues of `tensor[..., :, :]`.
  """
  # pylint: disable=protected-access
  e, _ = gen_linalg_ops._self_adjoint_eig_v2(tensor, compute_v=False, name=name)
  return e
Esempio n. 10
0
def self_adjoint_eig(matrix, name=None):
    """Computes the eigen decomposition of a self-adjoint matrix.

  Computes the eigenvalues and eigenvectors of an N-by-N matrix `matrix` such
  that `matrix * v[:,i] = e(i) * v[:,i]`, for i=0...N-1.

  Args:
    matrix: `Tensor` of shape `[N, N]`.
    name: string, optional name of the operation.

  Returns:
    e: Eigenvalues. Shape is `[N]`.
    v: Eigenvectors. Shape is `[N, N]`. The columns contain the eigenvectors of
      `matrix`.
  """
    # pylint: disable=protected-access
    e, v = gen_linalg_ops._self_adjoint_eig_v2(matrix,
                                               compute_v=True,
                                               name=name)
    return e, v