april-tools / cirkit

a python framework to build, learn and reason about probabilistic circuits and tensor networks
https://cirkit-docs.readthedocs.io/en/latest/
GNU General Public License v3.0
80 stars 4 forks source link

added indexed categorical layer evaluation #313

Closed gengala closed 2 weeks ago

gengala commented 2 weeks ago

as per title.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.

Project coverage is 68.18%. Comparing base (fee7960) to head (fe1d8a6). Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
cirkit/backend/torch/layers/input.py 44.44% 4 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #313 +/- ## ========================================== - Coverage 68.26% 68.18% -0.09% ========================================== Files 51 51 Lines 5360 5368 +8 Branches 613 616 +3 ========================================== + Hits 3659 3660 +1 - Misses 1486 1492 +6 - Partials 215 216 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

loreloc commented 2 weeks ago

Thank you! Please run the automatic formatter black (see the instructions in README.md). Also, better to avoid unnecessary logic in inference methods. You can cache the result of the if len(torch.unique(self.scope_idx)) > 4096 or self.num_categories > 256 in a boolean value in the init method.