## PyTorch – torch.linalg.cond()

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:30:16

To compute the condition number of a matrix with respect to a matrix norm, we could apply torch.linalg.cond() method. It returns a new tensor with computed condition number. It accepts a matrix, a batch of matrices and also batches of matrices. A matrix is a 2D torch Tensor. It supports ... Read More

## PyTorch – How to compute the pseudoinverse of a matrix?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:26:38

To compute the pseudoinverse of a square matrix, we could apply torch.linalg.pinv() method. It returns a new tensor with pseudoinverse of the given matrix. It accepts a matrix, a batch of matrices and also batches of matrices. A matrix is a 2D torch Tensor. It supports input of float, double, ... Read More

## PyTorch – How to compute the inverse of a square matrix?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:21:14

To compute the inverse of a square matrix, we could apply torch.linalg.inv() method. It returns a new tensor with inverse of the given matrix. It accepts a square matrix, a batch of square matrices, and also batches of square matrices.A matrix is a 2D torch Tensor. It supports input of ... Read More

## PyTorch – How to compute the norm of a vector or matrix?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:16:07

To compute the norm of a vector or a matrix, we could apply torch.linalg.norm() method. It returns a new tensor with computed norm. It accepts a vector, matrix, a batch of matrices and also batches of matrices.A vector is a 1D torch Tensor where a matrix is a 2D torch ... Read More

## PyTorch – torch.linalg.solve() Method

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:15:03

To solve a square system of linear equations with unique solution, we could apply the torch.linalg.solve() method. This method takes two parameters −first, the coefficient matrix A, andsecond, the right-hand tensor b.Where A is a square matrix and b is a vector. The solution is unique if A invertible. We ... Read More

## PyTorch – How to compute the determinant of a square matrix?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:14:10

To compute the determinant of a square matrix, we could apply torch.linalg.det() method. It returns a new tensor with computed determinant. It accepts a square matrix, a batch of square matrices and also batches of square matrices. It supports matrix of float, double, cfloat, and cdouble data types.We could also ... Read More

## PyTorch – How to compute the logistic sigmoid function of tensor elements?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:12:35

To compute the logistic function of elements of a tensor, we use torch.special.expit() method. It returns a new tensor with computed logistic function element-wise. It accepts torch tensor of any dimension. We could also apply torch.sigmoid() method to compute the logistic function of elements of the tensor. It is an ... Read More

## PyTorch – How to compute QR decomposition of a matrix?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:10:48

torch.linalg.qr() computes the QR decomposition of a matrix or a batch of matrices. It accepts matrix and batch of matrices of float, double, cfloat and cdouble data types.It returns a named tuple (Q, R). Q is orthogonal when the matrix is real valued and unitary when matrix is complex valued. ... Read More

## PyTorch – How to compute the error function of a tensor?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:10:14

To compute the error function of a tensor, we use the torch.special.erf() method. It returns a new tensor with computed error function. It accepts torch tensor of any dimension. It is also known as Gauss error functionStepsWe could use the following steps to compute the error function of a tensor ... Read More

## PyTorch – How to compute the eigenvalues and eigenvectors of a square matrix?

Shahid Akhtar Khan

Updated on 07-Jan-2022 06:08:11

torch.linalg.eig() computes the Eigen value decomposition of a square matrix or a batch of square matrices. It accepts matrix and batch of matrices of float, double, cfloat and cdouble data types. It returns a named tuple (eigenvalues, eigenvectors). The eigenvalues and eigenvectors are always complex valued. The eigenvectors are given ... Read More

Previous 1 ... 3 4 5 6 7 8 9 ... 12 Next