nn

class torchvectorized.nn.EigVals

Differentiable neural network layer (torch.nn.Module) that performs eigendecomposition on every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW and return the eigenvalues.

See Ionescu et al., Matrix backpropagation for deep networks with structured layers, CVPR 2015 for details on the gradients computation

forward(x: torch.Tensor)

Takes a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW and return a volume of their eigenvalues

Parameters:x (torch.Tensor) – A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW
Returns:A tensor with shape (B*D*H*W)x3 where every voxel’s channels are the eigenvalues of the inpur matrix at the same spatial location.
Return type:torch.Tensor
class torchvectorized.nn.Expm

Differentiable neural network layer (torch.nn.Module) that performs matrix exponential on every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.

See Ionescu et al., Matrix backpropagation for deep networks with structured layers, CVPR 2015 for details on the gradients computation

forward(x: torch.Tensor)

Compute the matrix exponential \mathbf{M} = \mathbf{U} exp(\mathbf{\Sigma}) \mathbf{U}^{\top} of every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.

Parameters:x (torch.Tensor) – A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW
Returns:A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.
Return type:torch.Tensor
class torchvectorized.nn.Logm

Differentiable neural network layer (torch.nn.Module) that performs matrix logarithm on every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.

See Ionescu et al., Matrix backpropagation for deep networks with structured layers, CVPR 2015 for details on the gradients computation

forward(x: torch.Tensor)

Compute the matrix exponential \mathbf{M} = \mathbf{U} log(\mathbf{\Sigma}) \mathbf{U}^{\top} of every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.

Parameters:x (torch.Tensor) – A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW
Returns:A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.
Return type:torch.Tensor
class torchvectorized.nn.ExpmLogm

Differentiable neural network layer (torch.nn.Module) that performs consecutive matrix exponential and logarithm on every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.

See Ionescu et al., Matrix backpropagation for deep networks with structured layers, CVPR 2015 for details on the gradients computation

forward(x: torch.Tensor)

Compute the matrix exponential \mathbf{M} = \mathbf{U} exp(\mathbf{\Sigma}) \mathbf{U}^{\top} and the matrix logarithm \mathbf{M} = \mathbf{U} log(\mathbf{\Sigma}) \mathbf{U}^{\top} of every voxel in a volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.

Parameters:x (torch.Tensor) – A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW
Returns:A volume of flattened 3x3 symmetric matrices of shape Bx9xDxHxW.
Return type:torch.Tensor