DOC PREVIEW
GT AE 6382 - Algorithm 862: MATLAB Tensor Classes for Fast Algorithm Prototyping

This preview shows page 1-2-3-4-5-6 out of 19 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 19 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Algorithm 862: MATLAB Tensor Classes forFast Algorithm PrototypingBRETT W. BADER and TAMARA G. KOLDASandia National LaboratoriesTensors (also known as multidimensional arrays or N-way arrays) are used in a variety of ap-plications ranging from chemometrics to psychometrics. We describe four MATLAB classes fortensor manipulations that can be used for fast algorithm prototyping. The tensor class extendsthe functionality of MATLAB’s multidimensional arrays by supporting additional operations suchas tensor multiplication. The tensor as matrix class supports the “matricization” of a tensor, thatis, the conversion of a tensor to a matrix (and vice versa), a commonly used operation in manyalgorithms. Two additional classes represent tensors stored in decomposed formats: cptensor andtuckertensor. We describe all of these classes and then demonstrate their use by showing how toimplement several tensor algorithms that have appeared in the literature.Categories and Subject Descriptors: G.4 [Mathematics of Computing]: Mathematical Software—Algorithm design and analysis; G.1.m [Mathematics of Computing]: Numerical Analysis—Mis-cellaneousGeneral Terms: AlgorithmsAdditional Key Words and Phrases: Higher-order tensors, multilinear algebra, N-way arrays,MATLAB1. INTRODUCTIONA tensor is a multidimensional or N -way array of data; Figure 1 shows a three-way array of size I1× I2× I3. Tensors arise in many applications, includingchemometrics [Smilde et al. 2004], signal processing [Chen et al. 2002], andimage processing [Vasilescu and Terzopoulos 2002]. In this article, we describefour MATLAB classes for manipulating tensors: tensor, tensoras matrix,cptensor, and tucker tensor.This research was supported by the Mathematical, Information, and Computational Sciences Di-vision at the United States Department of Energy and by Sandia National Laboratory, a multi-program laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the UnitedStates Department of Energy under contract DE-AC04-94AL85000.Authors’ addresses: B. W. Bader, T. G. Kolda, Sandia National Laboratories, Albuquerque, NM87185 and Livermore, CA 94551; email: {bwbader,tgkolda}@sandia.gov.Permission to make digital or hard copies of part or all of this work for personal or classroom use isgranted without fee provided that copies are not made or distributed for profit or direct commercialadvantage and that copies show this notice on the first page or initial screen of a display alongwith the full citation. Copyrights for components of this work owned by others than ACM must behonored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers,to redistribute to lists, or to use any component of this work in other works requires prior specificpermission and/or a fee. Permissions may be requested from Publications Dept., ACM, Inc., 2 PennPlaza, Suite 701, New York, NY 10121-0701 USA, fax +1 (212) 869-0481, or [email protected]2006 ACM 0098-3500/06/1200-0635 $5.00ACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006, Pages 635–653.636•B. W. Bader and T. G. KoldaFig. 1. A three-way array.MATLAB is a high-level computing environment that allows users to developmathematical algorithms using familiar mathematical notation. In terms ofhigher-order tensors, MATLAB supports multidimensional arrays (MDAs). Al-lowed operations on MDAs include elementwise operations, permutation of in-dices, and most vector operations (like sum and mean) [The MathWorks, Inc.2004b]. More complex operations, such as the multiplication of two MDAs, arenot supported by MATLAB. This article describes a tensor data type that ex-tends MATLAB’s MDA functionality to support tensor multiplication and morethrough the use of MATLAB’s class functionality [The MathWorks, Inc. 2004a].Basic mathematical notation and operations for tensors, as well as the re-lated MATLAB commands, are described in Section 2. Tensor multiplicationreceives its own section, Section 3, in which we describe both notation andhow to multiply a tensor times a vector, a tensor times a matrix, and a tensortimes another tensor. Conversion of a tensor to a matrix (and vice versa) viathe tensoras matrix class is described in Section 4.A tensor may be stored in factored form as a sum of rank-one tensors. Thereare two commonly accepted factored forms. The first was developed indepen-dently under two names: the CANDECOMP model of Carroll and Chang [1970]and the PARAFAC model of Harshman [1970]. Following the notation inKiers [2000], we refer to this decomposition as the CP model. The second decom-position is the Tucker [1966] model. Both models, as well as the correspondingMATLAB classes cptensor and tucker tensor, are described in Section 5.We note that these MATLAB classes serve a purely supporting role in thesense that they do not contain high-level algorithms—just the data types andtheir associated member functions. Thus, we view this work as complementaryto those packages that provide algorithms for use with tensor data, for example,the N-way toolbox for MATLAB by Andersson and Bro [2000].We use the following notational conventions. Indices are denoted by lower-case letters and span the range from 1 to the uppercase letter of the index,for example, n = 1, 2, ..., N . We denote vectors by lowercase boldface letters,for example, x; matrices by uppercase boldface, for example, U; and tensorsby calligraphic letters, for example, A. Notation for tensor mathematics is stillACM Transactions on Mathematical Software, Vol. 32, No. 4, December 2006.Algorithm 862: Tensor Classes•637Fig. 2. Slices of a third-order tensor.sometimes awkward. We have tried to be as standard as possible, relying onHarshman [2001] and Kiers [2000] for some guidance in this regard.Throughout the article, we refer to numbered examples that the readershould run in MATLAB. These examples are located in the examples direc-tory. Before running the examples, the user should change directories to theexamples directory and run the setup script to set the path. The script runallruns all example scripts in sequence, and the file runall.out is a text file thatshows sample output, which is useful for those who do not have MATLAB athand or who wish to compare their output to ours. These methods have beentested on MATLAB version 7.0.1.24704 (R14) Service Pack 1.2. BASIC NOTATION AND MATLAB COMMANDS FOR TENSORSLet A be a tensor of dimension I1× I2×···×IN. The


View Full Document

GT AE 6382 - Algorithm 862: MATLAB Tensor Classes for Fast Algorithm Prototyping

Download Algorithm 862: MATLAB Tensor Classes for Fast Algorithm Prototyping
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Algorithm 862: MATLAB Tensor Classes for Fast Algorithm Prototyping and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Algorithm 862: MATLAB Tensor Classes for Fast Algorithm Prototyping 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?