Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
joserapa98 committed May 10, 2024
2 parents 610c878 + fc4d52d commit 546147b
Show file tree
Hide file tree
Showing 122 changed files with 20,654 additions and 422 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:

jobs:
tests:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip torch opt_einsum
- name: Install pytest
run: pip install pytest pytest-cov
- name: Test components
run: pytest tests/test_components.py --cov=tensorkrowch
- name: Test operations
if: always()
run: pytest tests/test_operations.py --cov=tensorkrowch
- name: Test embeddings
if: always()
run: pytest tests/test_embeddings.py --cov=tensorkrowch
- name: Test decompositions
if: always()
run: pytest tests/decompositions/test_svd_decompositions.py --cov=tensorkrowch
- name: Test MPS
if: always()
run: pytest tests/models/test_mps.py --cov=tensorkrowch
- name: Test MPO
if: always()
run: pytest tests/models/test_mpo.py --cov=tensorkrowch
- name: Test PEPS
if: always()
run: pytest tests/models/test_peps.py --cov=tensorkrowch
- name: Test Tree
if: always()
run: pytest tests/models/test_tree.py --cov=tensorkrowch
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ instance/
target/

# Jupyter Notebook
*.ipynb
# *.ipynb
.ipynb_checkpoints

# IPython
Expand Down Expand Up @@ -154,8 +154,8 @@ cython_debug/

# Project folders
/training_scripts
/data
/examples
/old_examples
*data/

# Distribute package instructions
/dist_pkg
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ python -m pytest -v

inside the repository folder.

> [!NOTE]
Certain tests may experience failure as a result of statistical anomalies or
hardware constraints. We advise reviewing the error messages to determine if
these failures stem from such occurrences. Should this be the case, consider
rerunning the tests to ascertain if the errors persist.


## Example

Expand Down Expand Up @@ -156,6 +162,25 @@ enhance your understanding and proficiency with **TensorKrowch**.
* [Creating a Hybrid Neural-Tensor Network Model](https://joserapa98.github.io/tensorkrowch/_build/html/tutorials/6_mix_with_pytorch.html)


## Example Notebooks

In addition to the informative tutorials, there is also a collection of examples
that serve as practical demonstrations of how to apply **TensorKrowch** in
various contexts, showcasing its versatility.

With the code provided in the examples, you will be able to reproduce key research
findings that bridge the gap between tensor networks and machine learning. These
examples provide a hands-on approach to understanding the intricacies of
**TensorKrowch**, allowing you to explore its potential and adapt it to your
specific needs.

* [Training MPS in different ways](https://joserapa98.github.io/tensorkrowch/_build/html/examples/training_mps.html)
* [Hybrid Tensorial Neural Network model](https://joserapa98.github.io/tensorkrowch/_build/html/examples/hybrid_tnn_model.html)
* [Tensorizing Neural Networks](https://joserapa98.github.io/tensorkrowch/_build/html/examples/tensorizing_nn.html)
* [DMRG-like training of MPS](https://joserapa98.github.io/tensorkrowch/_build/html/examples/mps_dmrg.html)
* [Hybrid DMRG-like training of MPS](https://joserapa98.github.io/tensorkrowch/_build/html/examples/mps_dmrg_hybrid.html)


## License

TensorKrowch is licensed under the MIT License. Please see the [LICENSE](https://github.com/joserapa98/tensorkrowch/blob/master/LICENSE.txt) file for more information.
Expand Down
Loading

0 comments on commit 546147b

Please sign in to comment.