https://github.com/cqcl/classification-with-qttn

https://github.com/cqcl/classification-with-qttn

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: nature.com, ieee.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.8%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: CQCL
  • Language: Python
  • Default Branch: main
  • Size: 13.1 MB
Statistics
  • Stars: 6
  • Watchers: 3
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme

README.md

Sequence Processing with Quantum Tensor Networks

Resources for "Sequence Processing with Quantum Tensor Networks".

Requirements

Install the requirements with pip install -r requirements.txt.

The tensor network contraction is performed using a combination of discopy and jax.

First, follow these instructions to install JAX with the relevant accelerator support.

Documentation of discopy can be found here.

Datasets

| Name | Paper | | |-------------------|------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------| | protein-binding | A primer on deep learning in genomics | link | | clickbait | Stop Clickbait: Detecting and preventing clickbaits in online news media | link | | rotten-tomatoes | Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. | link | | imdb | Learning Word Vectors for Sentiment Analysis | link |

The imdb dataset is not included in the repository. It can be downloaded from the link above, then preprocessed with the preprocessing scripts.

Processing

  • BIO_preprocess.py preprocesses the protein-binding dataset. This takes the genetic strings and translates them to index representation. For TTN and CTN it also pads to appropriate powers of 2.
  • TTN_preprocess.py takes in sequences and acquires the appropriate offsets for fast contraction in TTN_train.py.
  • CTN_slide_preprocess.py takes in sequences and saves them as lists of subsequences of the desired window size.
  • NLP_parsing.py parses language data into a syntactic tree using Lambeq's CCG parser.
  • NLP_preprocess.py translates trees into sequential instructions for syntactic models (STN, SCTN). For the other tree models (CTN, TTN) it also pads sequences in groups of the nearest power of two. There is also the option to cut the data keeping the X most common syntactic structures while maintaining dataset balance. This is necessary for SCTN.

Models

  • TTN_train.py is all scalable models [PTN, STN, TTN]. Example datasets included are: protein-binding, rotten-tomatoes, clickbait.
  • CTN_train.py is the CTN model. Example datasets included are protein-binding and reduced clickbait.
  • SCTN_train.py is the SCTN model. Example datasets included are reduced clickbait.
  • CTN_slide.py is the sliding window option or the CTNs model. Example datasets included are protein-binding, rotten-tomatoes.

JIT compilation for CTN_train.py and SCTN_train.py takes time in the beginning, but speeds up the training process. The first epoch will be slow, but subsequent epochs will be faster. JIT compiltation can be disabled in the config file.

Owner

  • Name: Cambridge Quantum
  • Login: CQCL
  • Kind: organization
  • Location: Cambridge, UK

Quantum Software and Technologies

GitHub Events

Total
  • Watch event: 3
  • Push event: 1
  • Fork event: 1
Last Year
  • Watch event: 3
  • Push event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • Pillow ==10.0.0
  • PyYAML ==6.0.1
  • Pygments ==2.16.1
  • absl-py ==1.4.0
  • appnope ==0.1.3
  • asttokens ==2.2.1
  • backcall ==0.2.0
  • chex ==0.1.82
  • contourpy ==1.1.0
  • cycler ==0.11.0
  • decorator ==5.1.1
  • discopy ==0.6.0
  • executing ==1.2.0
  • fonttools ==4.42.0
  • graphviz ==0.20.1
  • h5py ==3.9.0
  • importlib-metadata ==6.8.0
  • importlib-resources ==6.0.1
  • ipython ==8.14.0
  • jax ==0.4.14
  • jaxlib ==0.4.14
  • jedi ==0.19.0
  • joblib ==1.3.2
  • kiwisolver ==1.4.4
  • matplotlib ==3.7.2
  • matplotlib-inline ==0.1.6
  • ml-dtypes ==0.2.0
  • networkx ==3.1
  • numpy ==1.25.2
  • opt-einsum ==3.3.0
  • optax ==0.1.7
  • packaging ==23.1
  • parso ==0.8.3
  • pexpect ==4.8.0
  • pickleshare ==0.7.5
  • prompt-toolkit ==3.0.39
  • ptyprocess ==0.7.0
  • pure-eval ==0.2.2
  • pyparsing ==3.0.9
  • python-dateutil ==2.8.2
  • scikit-learn ==1.3.0
  • scipy ==1.11.1
  • six ==1.16.0
  • stack-data ==0.6.2
  • tensornetwork ==0.4.6
  • threadpoolctl ==3.2.0
  • toolz ==0.12.0
  • tqdm ==4.66.1
  • traitlets ==5.9.0
  • typing_extensions ==4.7.1
  • wcwidth ==0.2.6
  • zipp ==3.16.2