added backward sampling - #403
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #403 +/- ##
==========================================
- Coverage 68.71% 67.44% -1.28%
==========================================
Files 58 58
Lines 6007 6140 +133
Branches 773 804 +31
==========================================
+ Hits 4128 4141 +13
- Misses 1590 1709 +119
- Partials 289 290 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Nice PR and a very needed speedup! My only comment is that I think the sampling logic should be implemented at the layer level like it's the case with forward sampling, otherwise it gets harder to create new layers because you need to know every query that needs new custom logic. |
|
super cool, thanks @gengala! |
|
I had a quick look and I agree with @chbricout and @arranger1044. On top of that, it worries me a bit the integration with the
I have a local branch where I added PS: I tested the PR wrt. the sampling tests from the conditional sampling branch, and the code passed all of those that implements (categorical leaves and folded circuits). They are non-exhaustive though. |
|
@gengala any news on this PR? |
db06fcb to
d3e2a98
Compare
…he tuple (unsqueeze) form
supports TorchSumLayer, TorchCPTLayer, TorchHadamardLayer, and TorchCategoricalLayer input layers, on folded circuits. Other layers raise NotImplementedError. Unfolded circuits aren't supported yet.
For testing, train a circuit on mnist and then do: