Skip to main content

Tensor Networks for Machine Learning

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tn4ml-1.0.1.tar.gz (36.7 kB view hashes)

Uploaded Source

Built Distribution

tn4ml-1.0.1-py3-none-any.whl (43.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page