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.2.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

tn4ml-1.0.2-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file tn4ml-1.0.2.tar.gz.

File metadata

  • Download URL: tn4ml-1.0.2.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for tn4ml-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fdc658bc071d764fcb94135719f926dd715b561b644bc9655e7432a224a79fef
MD5 03f9c1b3f7faa950efcbf03511ec19d4
BLAKE2b-256 1e11adf7c4c7af388e24be637d9230041ccbc28364832687570cf9f6a6bca81c

See more details on using hashes here.

File details

Details for the file tn4ml-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: tn4ml-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for tn4ml-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc0e2c188ae81d9580a0636743dd8218b4ebdf905551b6202884a5579b3deb4a
MD5 547482e2c72b997963913b15c43c80e0
BLAKE2b-256 c5f038111218f206d51434608a551b410a309b09b704de5d79fafe432a5e6190

See more details on using hashes here.

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