Title: | Multilinear Algebra |
---|---|
Description: | A set of tools for basic tensor operators. A tensor in the context of data analysis in a multidimensional array. The tools in this package rely on using any discrete transformation (e.g. Fast Fourier Transform (FFT)). Standard tools included are the Eigenvalue decomposition of a tensor, the QR decomposition and LU decomposition. Other functionality includes the inverse of a tensor and the transpose of a symmetric tensor. Functionality in the package is outlined in Kernfeld, E., Kilmer, M., and Aeron, S. (2015) <doi:10.1016/j.laa.2015.07.021>. |
Authors: | Kyle Caudle [aut, cre], Randy Hoover [ctb], Jackson Cates [ctb], Evertt Sandbo [ctb] |
Maintainer: | Kyle Caudle <[email protected]> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2025-02-15 04:56:20 UTC |
Source: | https://github.com/cran/TensorTools |
This will converts array to S3 object tensor. Vectors and matrices must first be converted to an array before applying as.Tensor.
as.Tensor(t)
as.Tensor(t)
t |
Numeric, array of numbers |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
indices <- c(2,3,4) arr <- array(runif(prod(indices)), dim = indices) arrT <- as.Tensor(arr); arrT
indices <- c(2,3,4) arr <- array(runif(prod(indices)), dim = indices) arrT <- as.Tensor(arr); arrT
The Frobenius norm of an array is the square root of the sum of its squared elements. This function works for vector and matrix arguments as well.
fnorm(tnsr)
fnorm(tnsr)
tnsr |
a 3-mode tensor S3 class object |
The Frobenius norm
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Friedland, S., & Aliabadi, M. (2018). Linear algebra and matrices. Society for Industrial and Applied Mathematics.
T <- t_rand(modes=c(2,2,4)) fnorm(T$data)
T <- t_rand(modes=c(2,2,4)) fnorm(T$data)
Decomposes a a matrix into the product of a lower triangular matrix and an upper triangular matrix.
LU(A)
LU(A)
A |
Complex, square matrix of complex numbers |
A lower triangular matrix L and an upper triangular matrix U so that A=LU
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Stewart, G. W. (1998). Matrix algorithms: volume 1: basic decompositions. Society for Industrial and Applied Mathematics.
indices <- c(2,3,4) z <- complex(real = rnorm(16), imag = rnorm(16)) A <- matrix(z,nrow=4) LU(A)
indices <- c(2,3,4) z <- complex(real = rnorm(16), imag = rnorm(16)) A <- matrix(z,nrow=4) LU(A)
10000 MNIST training images (1000 of every digit), reformatted into a tensor: 28 x 10000 x 28. 1000 MNIST test images (100 of every digit), reformatted into a tensor: 28 x 1000 x 28
data("Mnist")
data("Mnist")
The format is:
Mnist$train$images, Mnist$train$labels
Mnist$test$images, Mnist$test$labels
Deng L (2012). “The mnist database of handwritten digit images for machine learning research.” IEEE Signal Processing Magazine, 29(6), 141–142
data("Mnist")
data("Mnist")
Converts the complex matrices P and D into matrices of eigenvectors and eigenvalues with real entries.
polar(P,D)
polar(P,D)
P |
the eigenvectors from an eigenvalue decomposition. |
D |
the eigenvalues from an eigenvalue decomposition. |
P the polar form (real-valued) matrix of eigenvectors. D the polar form (real-valued) matrix of eigenvalues.
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Bhatia, R. (2013). Matrix analysis (Vol. 169). Springer Science & Business Media.
z <- complex(real = rnorm(16), imag = rnorm(16)) M <- matrix(z,nrow=4) decomp <- eigen(M) polar(decomp$vectors,decomp$values)
z <- complex(real = rnorm(16), imag = rnorm(16)) M <- matrix(z,nrow=4) decomp <- eigen(M) polar(decomp$vectors,decomp$values)
Decomposes a complex matrix into the product of an upper triangular matrix and a lower triangular matrix.
QR(A)
QR(A)
A |
square matrix with complex entries |
an orthogonal matrix Q and an upper triangular matrix R so that A = QR.
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Stewart, G. W. (1998). Matrix algorithms: volume 1: basic decompositions. Society for Industrial and Applied Mathematics.
z <- complex(real = rnorm(16), imag = rnorm(16)) A <- matrix(z,nrow=4) QR(A)
z <- complex(real = rnorm(16), imag = rnorm(16)) A <- matrix(z,nrow=4) QR(A)
4 tensors (128 x 128 x 128) for 4 different gray scale images. boat, flashlight, keyboard, scooter.
data("raytrace")
data("raytrace")
The format is:
raytrace$boat
raytrace$flashlight
raytrace$keyboard
raytrace$scooter
Hoover RC, Braman KS, Hao N (2011b). “Pose estimation from a single image using tensor decomposition and an algebra of circulants.” In 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 2928–2934. IEEE.
data(raytrace)
data(raytrace)
Generate a Tensor with specified modes whose entries are iid normal(0,1).
t_rand(modes = c(3, 4, 5))
t_rand(modes = c(3, 4, 5))
modes |
the 3 modes of the output Tensor |
an S3 Tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Imported from rTensor2 package version 2.0.0.
t_rand(c(4,4,4))
t_rand(c(4,4,4))
Performs the transpose of a symmetric 3-mode tensor using any discrete transform.
t_tpose(tnsr, tform)
t_tpose(tnsr, tform)
tnsr |
a 3-mode tensor |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Brachat, J., Comon, P., Mourrain, B., & Tsigaridas, E. (2010). Symmetric tensor decomposition. Linear Algebra and its Applications, 433(11-12), 1851-1872.
T <- t_rand(modes=c(2,3,4)) print(t_tpose(T,"dct"))
T <- t_rand(modes=c(2,3,4)) print(t_tpose(T,"dct"))
Performs the Discrete Wavelet Transform of a 3-mode Tensor.
tDWT(tnsr)
tDWT(tnsr)
tnsr |
A 3-mode Tensor |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
G. Strang and T. Nguyen, Wavelets and filter banks. SIAM, 1996. A. Haar, "Zur theorie der orthogonalen funktionensysteme", Mathematische annalen, vol. 69, no. 3, pp. 331-371, 1910.
Jensen, A., & la Cour-Harbo, A. (2011). Ripples in mathematics: the discrete wavelet transform. Springer Science & Business Media.
T <- t_rand(modes=c(2,3,4)) print(tDWT(T))
T <- t_rand(modes=c(2,3,4)) print(tDWT(T))
The Eigenvalue decomposition of a tensor T ( x
x
) decomposes the tensor into
a tensor of eigenvectors (P) and a diagonal tensor of eigenvalues (D) so that
T = P D inv(P).
tEIG(tnsr, tform)
tEIG(tnsr, tform)
tnsr |
a 3-mode S3 tensor class object ( |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
P, a tensor of Eigenvectors ( x
x
)
D, a diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tEIG(T,"dst")
T <- t_rand(modes=c(2,2,4)) tEIG(T,"dst")
Eigenvalue decomposition of 3-mode tensor using the discrete cosine transform.
tEIGdct(tnsr)
tEIGdct(tnsr)
tnsr |
a 3-mode S3 tensor class object ( |
P, tensor of Eigenvectors ( x
x
)
D, diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) print(tEIGdct(T))
T <- t_rand(modes=c(2,2,4)) print(tEIGdct(T))
Eigenvalue decomposition of 3-mode tensor using the discrete Hadley transform.
tEIGdht(tnsr)
tEIGdht(tnsr)
tnsr |
a 3-mode S3 tensor class object ( |
P, tensor of Eigenvectors ( x
x
)
D, diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) print(tEIGdht(T))
T <- t_rand(modes=c(2,2,4)) print(tEIGdht(T))
Eigenvalue decomposition of 3-mode tensor using the discrete sine transform.
tEIGdst(tnsr)
tEIGdst(tnsr)
tnsr |
a 3-mode S3 tensor class object ( |
P, tensor of Eigenvectors ( x
x
)
D, diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) print(tEIGdst(T))
T <- t_rand(modes=c(2,2,4)) print(tEIGdst(T))
Eigenvalue decomposition of 3-mode tensor using the discrete Walsh Hadley transform.
tEIGdwht(tnsr)
tEIGdwht(tnsr)
tnsr |
a 3-mode S3 tensor class object ( |
P, tensor of Eigenvectors ( x
x
)
D, diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) print(tEIGdwht(T))
T <- t_rand(modes=c(2,2,4)) print(tEIGdwht(T))
Eigenvalue decomposition of 3-mode tensor using the discrete wavelet transform.
tEIGdwt(tnsr)
tEIGdwt(tnsr)
tnsr |
a 3-mode S3 tensor class object ( |
P, tensor of Eigenvectors ( x
x
)
D, diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) print(tEIGdwt(T))
T <- t_rand(modes=c(2,2,4)) print(tEIGdwt(T))
Eigenvalue decomposition of 3-mode tensor using the discrete fast fourier transform.
tEIGfft(tnsr)
tEIGfft(tnsr)
tnsr |
a 3-mode S3 tensor class object ( |
P, tensor of Eigenvectors ( x
x
)
D, diagonal tensor of Eigenvalues ( x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) print(tEIGfft(T))
T <- t_rand(modes=c(2,2,4)) print(tEIGfft(T))
Creates an S3 class for a tensor
Tensor(data, x, y, z)
Tensor(data, x, y, z)
data |
Numeric numbers in the tensor |
x |
mode 1 dimension |
y |
mode 2 dimension |
z |
mode 3 dimension |
S3 class tensor
Performs inverse of 3-mode tensor using any discrete wavelet transform.
tIDWT(tnsr)
tIDWT(tnsr)
tnsr |
a 3-mode tensor S3 class object |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
T <- t_rand(modes=c(2,3,4)) print(tIDWT(T))
T <- t_rand(modes=c(2,3,4)) print(tIDWT(T))
Performs inverse of 3-mode tensor using any discrete transform.
tINV(tnsr, tform)
tINV(tnsr, tform)
tnsr |
a 3-mode tensor S3 class object |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
T <- t_rand(modes=c(2,2,4)) print(tINV(T,"dst"))
T <- t_rand(modes=c(2,2,4)) print(tINV(T,"dst"))
Performs inverse of 3-mode tensor using the discrete cosine transform.
tINVdct(tnsr)
tINVdct(tnsr)
tnsr |
a 3-mode S3 tensor class object |
S3 class tensor #' @examples T <- t_rand(modes=c(2,2,4)) print(tINVdct(T))
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Performs inverse of 3-mode tensor using the discrete Hadley transform.
tINVdht(tnsr)
tINVdht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
T <- t_rand(modes=c(2,2,4)) print(tINVdht(T))
T <- t_rand(modes=c(2,2,4)) print(tINVdht(T))
Performs inverse of 3-mode tensor using the discrete sine transform.
tINVdst(tnsr)
tINVdst(tnsr)
tnsr |
a 3-mode S3 tensor class object |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
T <- t_rand(modes=c(2,2,4)) print(tINVdst(T))
T <- t_rand(modes=c(2,2,4)) print(tINVdst(T))
Performs inverse of 3-mode tensor using the discrete Walsh Hadley transform.
tINVdwht(tnsr)
tINVdwht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
T <- t_rand(modes=c(2,2,4)) print(tINVdwht(T))
T <- t_rand(modes=c(2,2,4)) print(tINVdwht(T))
Performs inverse of 3-mode tensor using the discrete wavelet transform.
tINVdwt(tnsr)
tINVdwt(tnsr)
tnsr |
a 3-mode S3 tensor class object |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
tnsr <- t_rand(modes=c(2,2,4)) print(tINVdwt(tnsr))
tnsr <- t_rand(modes=c(2,2,4)) print(tINVdwt(tnsr))
Performs inverse of 3-mode tensor using the discrete fast fourier transform.
tINVfft(tnsr)
tINVfft(tnsr)
tnsr |
a 3-mode S3 tensor class object |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
T <- t_rand(modes=c(2,2,4)) print(tINVfft(T))
T <- t_rand(modes=c(2,2,4)) print(tINVfft(T))
Linear discriminate analysis (LDA) on a 3D tensor
tLDA(tnsr, nClass, nSamplesPerClass, tform)
tLDA(tnsr, nClass, nSamplesPerClass, tform)
tnsr |
a 3-mode tensor S3 class object |
nClass |
Number of classes |
nSamplesPerClass |
Samples in each class |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Xanthopoulos, P., Pardalos, P. M., Trafalis, T. B., Xanthopoulos, P., Pardalos, P. M., & Trafalis, T. B. (2013). Linear discriminant analysis. Robust data mining, 27-33.
data("Mnist") T <- Mnist$train$images myorder <- order(Mnist$train$labels) # tLDA need to be sorted by classes T_sorted <- T$data[,myorder,] # Using small tensor, 2 images for each class for demonstration T <- T_sorted[,c(1:2,1001:1002,2001:2002,3001:3002,4001:4002, 5001:5002,6001:6002,7001:7002,8001:8002,9001:9002),] tLDA(as.Tensor(T),10,2,"dct")
data("Mnist") T <- Mnist$train$images myorder <- order(Mnist$train$labels) # tLDA need to be sorted by classes T_sorted <- T$data[,myorder,] # Using small tensor, 2 images for each class for demonstration T <- T_sorted[,c(1:2,1001:1002,2001:2002,3001:3002,4001:4002, 5001:5002,6001:6002,7001:7002,8001:8002,9001:9002),] tLDA(as.Tensor(T),10,2,"dct")
Decomposes a 3 model tensor into a lower triangular tensor and an upper triangular tensor.
tLU(tnsr, tform)
tLU(tnsr, tform)
tnsr |
a 3-mode tensor S3 class object |
tform |
Any discrete transform. fft: Fast Fourier Transform dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
L, The lower triangular tensor object
U, The upper triangular tensor object a Tensor3-class object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLU(T,"dst")
T <- t_rand(modes=c(2,2,4)) tLU(T,"dst")
LU decomposition of a 3D tensor using the discrete cosine transform
tLUdct(tnsr)
tLUdct(tnsr)
tnsr |
a 3-mode S3 tensor class object |
L, The lower triangular S3 tensor object
U, The upper triangular S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLUdct(T)
T <- t_rand(modes=c(2,2,4)) tLUdct(T)
LU decomposition of a 3D tensor using the discrete Hadley transform
tLUdht(tnsr)
tLUdht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
L, The lower triangular S3 tensor object
U, The upper triangular S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLUdht(T)
T <- t_rand(modes=c(2,2,4)) tLUdht(T)
LU decomposition of a 3D tensor using the discrete sine transform
tLUdst(tnsr)
tLUdst(tnsr)
tnsr |
a 3-mode S3 tensor class object |
L, The lower triangular S3 tensor object
U, The upper triangular S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLUdst(T)
T <- t_rand(modes=c(2,2,4)) tLUdst(T)
LU decomposition of a 3D tensor using the discrete Walsh Hadley transform
tLUdwht(tnsr)
tLUdwht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
L, The lower triangular S3 tensor object
U, The upper triangular S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLUdwht(T)
T <- t_rand(modes=c(2,2,4)) tLUdwht(T)
LU decomposition of a 3D tensor using the discrete wavelet transform
tLUdwt(tnsr)
tLUdwt(tnsr)
tnsr |
a 3-mode S3 tensor class object |
L, The lower triangular S3 tensor object
U, The upper triangular S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLUdwt(T)
T <- t_rand(modes=c(2,2,4)) tLUdwt(T)
LU decomposition of a 3D tensor using the discrete fast fourier transform
tLUfft(tnsr)
tLUfft(tnsr)
tnsr |
a 3-mode S3 tensor class object |
L, The lower triangular S3 tensor object
U, The upper triangular S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tLUfft(T)
T <- t_rand(modes=c(2,2,4)) tLUfft(T)
Determines the mean of a 3D tensor along mode 2
tmean(tnsr)
tmean(tnsr)
tnsr |
a 3D tensor of dimensions n1,n2,n3 |
S3 tensor class object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
tnsr <- t_rand(modes=c(3,4,5)) tmean(tnsr)
tnsr <- t_rand(modes=c(3,4,5)) tmean(tnsr)
Performs the tensor product of two 3D tensors using any discrete transform
tmult(x, y, tform)
tmult(x, y, tform)
x |
a 3-mode S3 tensor class object |
y |
a 3-mode S3 tensor class object |
tform |
Any discrete transform. fft: Fast Fourier Transform dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
S3 tensor object
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T1 <- t_rand(modes=c(2,2,4)) T2 <- t_rand(modes=c(2,3,4)) print(tmult(T1,T2,"dst"))
T1 <- t_rand(modes=c(2,2,4)) T2 <- t_rand(modes=c(2,3,4)) print(tmult(T1,T2,"dst"))
Decomposes a 3 mode tensor T into the product of The left singular value tensor object and a right singular value tensor object so that T = QR.
tQR(tnsr, tform)
tQR(tnsr, tform)
tnsr |
a 3-mode tensor S3 class object |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
Q, The left singular value tensor object ()
R, The right singular value tensor object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQR(T,"dst")
T <- t_rand(modes=c(2,2,4)) tQR(T,"dst")
QR decomposition of a 3D tensor using the discrete cosine transform
tQRdct(tnsr)
tQRdct(tnsr)
tnsr |
a 3-mode S3 tensor class object |
Q, The left singular value S3 tensor class object ()
R, The right singular value Se tensor class object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQRdct(T)
T <- t_rand(modes=c(2,2,4)) tQRdct(T)
QR decomposition of a 3D tensor using the discrete Hadley transform
tQRdht(tnsr)
tQRdht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
Q, The left singular value S3 tensor class object ()
R, The right singular value Se tensor class object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQRdht(T)
T <- t_rand(modes=c(2,2,4)) tQRdht(T)
QR decomposition of a 3D tensor using the discrete sine transform
tQRdst(tnsr)
tQRdst(tnsr)
tnsr |
a 3-mode S3 tensor class object |
Q, The left singular value S3 tensor class object ()
R, The right singular value Se tensor class object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQRdst(T)
T <- t_rand(modes=c(2,2,4)) tQRdst(T)
QR decomposition of a 3D tensor using the discrete Walsh Hadley transform
tQRdwht(tnsr)
tQRdwht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
Q, The left singular value S3 tensor class object ()
R, The right singular value Se tensor class object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQRdwht(T)
T <- t_rand(modes=c(2,2,4)) tQRdwht(T)
QR decomposition of a 3D tensor using the discrete wavelet transform
tQRdwt(tnsr)
tQRdwt(tnsr)
tnsr |
a 3-mode S3 tensor class object |
Q, The left singular value S3 tensor class object ()
R, The right singular value Se tensor class object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQRdwt(T)
T <- t_rand(modes=c(2,2,4)) tQRdwt(T)
QR decomposition of a 3D tensor using the fast fourier transform
tQRfft(tnsr)
tQRfft(tnsr)
tnsr |
a 3-mode S3 tensor class object |
Q, The left singular value S3 tensor class object ()
R, The right singular value Se tensor class object ()
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tQRfft(T)
T <- t_rand(modes=c(2,2,4)) tQRfft(T)
Performs a Singular Value Decomposition of 3 mode tensor T using any discrete transform. The result is a left singular value tensor object U, a right singular value tensor object V, and a diagonal tensor S so that T = USV^t
tSVD(tnsr, tform)
tSVD(tnsr, tform)
tnsr |
a 3-mode tensor S3 class object |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
If the SVD is performed on a x
x
tensor, the components in the returned value are:
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,3,4)) print(tSVD(T,"dst"))
T <- t_rand(modes=c(2,3,4)) print(tSVD(T,"dst"))
Singular value decomposition (SVD) of a 3D tensor using the discrete cosine transform
tSVDdct(tnsr)
tSVDdct(tnsr)
tnsr |
a 3-mode S3 tensor class object |
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
V: The right singular value tensor object (
x
x
)
S: A diagonal tensor (
x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tSVDdct(T)
T <- t_rand(modes=c(2,2,4)) tSVDdct(T)
Singular value decomposition (SVD) of a 3D tensor using the discrete Hadley transform
tSVDdht(tnsr)
tSVDdht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
V: The right singular value tensor object (
x
x
)
S: A diagonal tensor (
x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tSVDdht(T)
T <- t_rand(modes=c(2,2,4)) tSVDdht(T)
Singular value decomposition (SVD) of a 3D tensor using the discrete sine transform
tSVDdst(tnsr)
tSVDdst(tnsr)
tnsr |
a 3-mode S3 tensor class object |
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
V: The right singular value tensor object (
x
x
)
S: A diagonal tensor (
x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tSVDdst(T)
T <- t_rand(modes=c(2,2,4)) tSVDdst(T)
Singular value decomposition (SVD) of a 3D tensor using the discrete Walsh Hadley transform
tSVDdwht(tnsr)
tSVDdwht(tnsr)
tnsr |
a 3-mode S3 tensor class object |
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
V: The right singular value tensor object (
x
x
)
S: A diagonal tensor (
x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tSVDdwht(T)
T <- t_rand(modes=c(2,2,4)) tSVDdwht(T)
Singular value decomposition (SVD) of a 3D tensor using the discrete wavelet transform
tSVDdwt(tnsr)
tSVDdwt(tnsr)
tnsr |
a 3-mode S3 tensor class object |
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
V: The right singular value tensor object (
x
x
)
S: A diagonal tensor (
x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tSVDdwt(T)
T <- t_rand(modes=c(2,2,4)) tSVDdwt(T)
Singular value decomposition (SVD) of a 3D tensor using the fast fourier transform
tSVDfft(tnsr)
tSVDfft(tnsr)
tnsr |
a 3-mode S3 tensor class object |
U, the left singular value tensor object ( x
x
)
V, The right singular value tensor object ( x
x
)
S: A diagonal tensor ( x
x
)#' @examples
V: The right singular value tensor object (
x
x
)
S: A diagonal tensor (
x
x
)
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
M. E. Kilmer, C. D. Martin, and L. Perrone, “A third-order generalization of the matrix svd as a product of third-order tensors,” Tufts University, Department of Computer Science, Tech. Rep. TR-2008-4, 2008
K. Braman, "Third-order tensors as linear operators on a space of matrices", Linear Algebra and its Applications, vol. 433, no. 7, pp. 1241-1253, 2010.
T <- t_rand(modes=c(2,2,4)) tSVDfft(T)
T <- t_rand(modes=c(2,2,4)) tSVDfft(T)