Neurocomputing 318 (2018) 196–200
Contents lists available at ScienceDirect
Neurocomputing
journal homepage: www.elsevier.com/locate/neucom
TensorD: A tensor decomposition library in TensorFlow
Liyang Hao
1
, Siqi Liang
1
, Jinmian Ye, Zenglin Xu
∗
SMILE Lab, School of Computer Science and Engineering, University of Electronic Science and Technology of China, 2006 Xiyuan Ave, West Hi-Tech Zone,
Chengdu, Sichuan 61 1 731 , China
a r t i c l e i n f o
Article history:
Received 10 March 2018
Revised 26 June 2018
Accepted 21 August 2018
Available online 1 September 2018
Communicated by Dr Zhu Jianke
Keywords:
Tensor decomposition
Multi-way analysis
Tensor toolbox
a b s t r a c t
The TensorD toolbox is a Python tensor library built on TensorFlow. It provides tensor decomposition
methods as well as basic tensor operations. In addition, other features of TensorD include GPU com-
patibility, high modularity of structure, and open source. It facilitate the practice of tensor methods
in computer vision, deep learning and other related research fields. The TensorD toolbox is available at
https://github.com/Large-Scale-Tensor-Decomposition/tensorD.
© 2018 Elsevier B.V. All rights reserved.
1. Introduction
Tensors, also known as multi-way arrays, are generalizations of
matrices to represent multi-way relationships of multiway data.
For example, a three-mode tensor (user, advertisement, context)
can be used to represent the multiway interaction in online adver-
tising data. Tensor decomposition is a standard tool of analyzing
tensor data, which shares the same spirit of factor analysis [1–
4]
and aims to extract latent factors for each mode of tensor data.
In the past decades, tensor decomposition methods have been
used in various applications, such as compressing models in deep
neural networks [5–7] , providing integrated context information in
recommendation systems [8–12] , and processing high dimensional
visual data in computer vision [13,14] . Though there already exist
several tensor decomposition libraries (which will be discussed
in Section 2 ), it is still inconvenient for researchers to use tensor
methods in their research. In 2016, TensorFlow [15] was proposed
for latest research needs and GPU computing, and it has been
widely used and various third-party packages [16–19] have been
developed. However, TensorFlow still lacks an out-of-the-box ten-
sor decomposition package, harming the enthusiasm of researchers
to investigate tensor methods.
Therefor,it is necessary to build a new tensor library based
on TensorFlow such that it can provide tensor decomposition and
other basic tensor operations for researchers. In this paper, we
∗
Corresponding author.
E-mail address: zlxu@uestc.edu.cn (Z. Xu).
1
Authors contributed equally
propose a open source, extensible tensor decomposition toolbox
named TensorD
2
to solve these problems.
2. Background
There have been a few tensor libraries in literature.
Some libraries are orthogonal to TensorD , but addressing vari-
ous tensor problems. The Tensor Algebra Compiler (taco) [20] pro-
vides optimized tensor computation kernel and a novel code gen-
eration for tensor expressions [21] , but suffers from lack of friendly
programming interfaces for high level tensor applications. The Ten-
sor [22] provides multiple precision computation, optimized tensor
contraction operation and allowing MATLAB-style programming.
High-Performance Tensor Transpose (HPTT) library [23] is a C ++
library which also contributes to high-performance tensor trans-
position but CPU-oriented.
Others offer high-level tensor algorithms like tensor decompo-
sition or tensor regression. Sandia National Laboratories released
TensorToolbox version 2.6 in 2015 [24] . Another MATLAB library
is MATLAB Tensor Tools (MTT) released in 2014 [25] , and it con-
tains some common tensor algorithms. Though both of these two
are easy to use and install, they all have difficulties in large-scale
deployments contributed to MATLAB, which is not a license-free
platform. Tensorly , focusing on tensor decomposition, was imple-
mented in 2016 [26] . It enables tensor computation on GPU with
MXNet backend, but it still does not work on TensorFlow. Pretty
Tensor [27] offers high-level API for Fluent Networks in Tensor-
Flow, but it does not contain any decomposition algorithms.
2
https://github.com/Large- Scale- Tensor- Decomposition/tensorD .
https://doi.org/10.1016/j.neucom.2018.08.055
0925-2312/© 2018 Elsevier B.V. All rights reserved.