TensorNetwork is an open source library for implementing tensor network algorithms in TensorFlow. We describe a tree tensor network (TTN) algorithm for approximating the ground state of either a periodic quantum spin chain (1D) or a lattice model on a thin torus (2D), and implement the algorithm using TensorNetwork. We use a standard energy minimization procedure over a TTN ansatz with bond dimension
χ, with a computational cost that scales as
O(χ4). Using bond dimension
χ∈[32,256] we compare the use of CPUs with GPUs and observe significant computational speed-ups, up to a factor of
100, using a GPU and the TensorNetwork library.
Image classification is a fundamental task in computer vision that involves assigning labels to images based on their content. In recent years, deep learning techniques based on classical neural networks (CNN) have achieved modern performance on many image classification tasks. However, there is growing interest in using quantum neural networks (QNNs) for image classification, as quantum computing has the potential to improve the accuracy and speed of computation. We demonstrate the potential of our QNN model and QCNN model by applying it to the fashion MNIST dataset. The results indicate that the QNN model exhibits faster training speed and higher testing set accuracy compared to a QCNN with a similar architecture.
Tensor networks, originally designed to address computational problems in quantum many-body physics, have recently been applied to machine learning tasks. However, compared to quantum physics, where the reasons for the success of tensor network approaches over the last 30 years is well understood, very little is yet known about why these techniques work for machine learning. The goal of this paper is to investigate entanglement properties of tensor network models in a current machine learning application, in order to uncover general principles that may guide future developments. We revisit the use of tensor networks for supervised image classification using the MNIST data set of handwritten digits, as pioneered by Stoudenmire and Schwab [Adv. in Neur. Inform. Proc. Sys. 29, 4799 (2016)]. Firstly we hypothesize about which state the tensor network might be learning during training. For that purpose, we propose a plausible candidate state
∣Σℓ⟩ (built as a superposition of product states corresponding to images in the training set) and investigate its entanglement properties. We conclude that
∣Σℓ⟩ is so robustly entangled that it cannot be approximated by the tensor network used in that work, which must therefore be representing a very different state. Secondly, we use tensor networks with a block product structure, in which entanglement is restricted within small blocks of
n×n pixels/qubits. We find that these states are extremely expressive (e.g. training accuracy of
99.97% already for
n=2), suggesting that long-range entanglement may not be essential for image classification. However, in our current implementation, optimization leads to over-fitting, resulting in test accuracies that are not competitive with other current approaches.
Tensor Networks have emerged as a prominent alternative to neural networks for addressing Machine Learning challenges in foundational sciences, paving the way for their applications to real-life problems. This paper introduces tn4ml, a novel library designed to seamlessly integrate Tensor Networks into optimization pipelines for Machine Learning tasks. Inspired by existing Machine Learning frameworks, the library offers a user-friendly structure with modules for data embedding, objective function definition, and model training using diverse optimization strategies. We demonstrate its versatility through two examples: supervised learning on tabular data and unsupervised learning on an image dataset. Additionally, we analyze how customizing the parts of the Machine Learning pipeline for Tensor Networks influences performance metrics.
We present tensor networks for feature extraction and refinement of classifier performance. These networks can be initialised deterministically and have the potential for implementation on near-term intermediate-scale quantum (NISQ) devices. Feature extraction proceeds through a direct combination and compression of images amplitude-encoded over just
logNpixels qubits. Performance is refined using `Quantum Stacking', a deterministic method that can be applied to the predictions of any classifier regardless of structure, and implemented on NISQ devices using data re-uploading. These procedures are applied to a tensor network encoding of data, and benchmarked against the 10 class MNIST and fashion MNIST datasets. Good training and test accuracy are achieved without any variational training.