Database Reference
In-Depth Information
Tensor
(abstract)
StaticTensor
SparseTensor
FunctionTensor
Tucker (abstract)
CondecompParafac
Decomposition
HigherOrderSVD
TensorTrain
Fig. 12.13 Class hierarchies of tensors. The classes in the gray boxes belong to the Factorizations
subpackage
// Create G as DRS from F:
SparseMatrixRowBased G ¼ new SparseMatrixRowBased(F);
// Matrix multiplication. H ¼ G*B^T:
Matrix H ¼ G.times( B.transpose() );
// Vector multiplication. w ¼ G*v:
double[] v ¼ {1, 2, 0};
double[] w ¼ G.mult(v);
// Convert G to full matrix I:
Matrix I ¼ G.toMatrix();
Tensor
The abstract class Tensor is the root of all tensor implementations. The tensor class
hierarchy is shown in Fig. 12.13 . The factorization part will be explained later.
In general, the tensor implementations are built upon a column-based structure.
That is, content is stored in columns rather than rows.
For working with a dense tensor, the class StaticTensor shall be used. In this
case, the tensor is stored in a one-dimensional double array. The indexes of the
array are linearized tensor entries. As depicted in Fig. 12.13 , there exists also a
sparse version of tensors - the class SparseTensor . This class uses a hash map
to store nonzero. Thus, the linearized indexes form the keys, and the values are
the corresponding tensor entries. The class FunctionTensor is a wrapper for a
high-dimensional function which is provided through the TensorFunction
interface. The tensor classes implement a set of central operations of Tensor
(Sect. 9.1.1 ) :
 
Search WWH ::




Custom Search