The aim of this study is to reproduce the experience from Miles Stoudenmire and David Schwab described in the publication "Supervised Learning with Tensor Networks" (http://arxiv.org/abs/1605.05775).
The project aims to study the classification of images from the MNIST database which contains handwritten digits using a tensor network. For that, it uses a tensor decomposition training with basic Machine Learning algorithms, such as gradient descent, but also more sophisticated physics-inspired algorithms.
The goal of the project is to optimize a Matrix Product State so that it will be able to classify inputs. For that, there are differents possibilities. Here, the 2 possibilities developped are :
- a simple algorithm of alternating gradient descent (AGD). At each tensor, the algorithm tries to reduce the loss by computing the gradient of the loss function according to the tensor.
- the Density Matrix Renormalization Group (DMRG) . The algorithm does some sweeps along the MPS and at each bond, it contracts 2 tensors and tries to reduce the loss by computing the gradient of loss function according to the contraction.
The study is more oriented on the second possibilities DMRG. Indeed, this algorithm has a lot of avantages that you can see in the first report.
If you want to test by yourself, you have to clone the repository. After, you just have to execute the 2 commands to install all the packages needeed for the project and especially the package src :
pip install -r requirements.txt
pip install -e .
\data-- the data which is processed or external\externalMNIST Database without any traitment\processedmodified MNIST Database with pictures of 14 pixels by 14 pixels
\docsall the documentation used for the project\notebooksdifferent notebooks with example of code to illustrate the projects and to have some example of the syntax in order to use the package\reportsthe 2 reports made for the projects (the first report is in French)\figuresillustrations of reports
\srcthe package developed to train a tensor network. Each method or class is documented\datasome method to create random data or to load the MNIST dataset\mappingmethods to compute the mapping function\tensorone method to contract a tensor with inputs\tensor_networkall the stuff needeed to train a tensor networkmodelMPS.pythe central class of the project. It defines a tensor network with different methods to train itoptimizer.pydifferent algorithms to reduce the loss : Adam, Gradient Descent with fixed stepsize and Conjugate Gradient Descent\algo_AGDsome methods to compute the gradient and the cost for basic Alternating Gradient Descent\algos_DMRGsome methods to compute the gradient and the cost with Density Matrix Renormalization Group
requirements.txtall the package you need to install so that you can use the project on your own