qiboteam / qiboml

Quantum Machine Learning using Qibo
Apache License 2.0
11 stars 3 forks source link

Pytorch interface autodifferentiation #37

Closed BrunoLiegiBastonLiegi closed 1 month ago

BrunoLiegiBastonLiegi commented 2 months ago

This tries to adapt #20 to for incorporating autodifferentiation, both native with pytorch and custom by defining a new autograd.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 85.95890% with 41 lines in your changes missing coverage. Please review.

Project coverage is 62.22%. Comparing base (51037fd) to head (920889f). Report is 30 commits behind head on model.

Files with missing lines Patch % Lines
src/qiboml/operations/differentiation.py 69.44% 22 Missing :warning:
src/qiboml/models/keras.py 59.25% 11 Missing :warning:
src/qiboml/models/decoding.py 95.94% 3 Missing :warning:
src/qiboml/models/ansatze.py 83.33% 2 Missing :warning:
src/qiboml/models/encoding.py 95.34% 2 Missing :warning:
src/qiboml/models/pytorch.py 98.30% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/qiboteam/qiboml/pull/37/graphs/tree.svg?width=650&height=150&src=pr&token=9HMBD3N3D6&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) ```diff @@ Coverage Diff @@ ## model #37 +/- ## ========================================== - Coverage 65.10% 62.22% -2.88% ========================================== Files 13 14 +1 Lines 682 826 +144 ========================================== + Hits 444 514 +70 - Misses 238 312 +74 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qiboml/pull/37/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qiboteam/qiboml/pull/37/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `62.22% <85.95%> (-2.88%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [src/qiboml/backends/jax.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Fbackends%2Fjax.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9iYWNrZW5kcy9qYXgucHk=) | `46.00% <100.00%> (+2.84%)` | :arrow_up: | | [src/qiboml/models/pytorch.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Fmodels%2Fpytorch.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9tb2RlbHMvcHl0b3JjaC5weQ==) | `98.59% <98.30%> (-1.41%)` | :arrow_down: | | [src/qiboml/models/ansatze.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Fmodels%2Fansatze.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9tb2RlbHMvYW5zYXR6ZS5weQ==) | `85.71% <83.33%> (-14.29%)` | :arrow_down: | | [src/qiboml/models/encoding.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Fmodels%2Fencoding.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9tb2RlbHMvZW5jb2RpbmcucHk=) | `95.34% <95.34%> (ø)` | | | [src/qiboml/models/decoding.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Fmodels%2Fdecoding.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9tb2RlbHMvZGVjb2RpbmcucHk=) | `95.94% <95.94%> (ø)` | | | [src/qiboml/models/keras.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Fmodels%2Fkeras.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9tb2RlbHMva2VyYXMucHk=) | `63.41% <59.25%> (-36.59%)` | :arrow_down: | | [src/qiboml/operations/differentiation.py](https://app.codecov.io/gh/qiboteam/qiboml/pull/37?src=pr&el=tree&filepath=src%2Fqiboml%2Foperations%2Fdifferentiation.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9tbC9vcGVyYXRpb25zL2RpZmZlcmVudGlhdGlvbi5weQ==) | `54.54% <69.44%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/qiboteam/qiboml/pull/37/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)