Skip to content

bsc-quantic/tn4ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Tensor Networks for Machine Learning

Static Badge Static Badge
tn4ml is a Python library that handles tensor networks for machine learning applications. It is built on top of Quimb, for Tensor Network objects, and JAX, for optimization pipeline.
For now, the library supports 1D Tensor Network structures: Matrix Product State, Matrix Product Operator and Spaced Matrix Product Operator.
It supports different embedding functions, initialization techniques, and optimization strategies.

Installation

First create a virtualenv using pyenv or conda. Then install the package and its dependencies.

With pip:

pip install tn4ml

or directly from github:

pip install -U git+https://github.com/bsc-quantic/tn4ml.git

If you want to test and edit the code, you can clone local version of the package and install.

git clone https://github.com/bsc-quantic/tn4ml.git
pip install -e tn4ml/

Documentation

Visit tn4ml.readthedocs.io

Example notebooks

There are working examples of supervised learning (classification), and unsupervised learning (anomaly detection), both on MNIST images.

TN for Classification
TN for Anomaly Detection
TN for Anomaly Detection with DMRG-like method

License

MIT license - check it out here

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages