Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured smoothing #69

Merged
merged 11 commits into from
Mar 4, 2021
Merged

Structured smoothing #69

merged 11 commits into from
Mar 4, 2021

Conversation

talf301
Copy link
Member

@talf301 talf301 commented Mar 3, 2021

This adds smoothing for structured logic circuits, respecting the current vtree. Appears to be working - looking for more example tests that don't have dependencies in Probabilistic circuits.
I couldn't find a way around doing work at both AND and OR nodes, it's possible there is some unnecessary work going on.
As of right now this will only work on logic circuits due to typing issues. A future pr should add a "structured decomposable" trait which would allow this to work with structured prob nodes as well.

@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #69 (45e1988) into master (6659045) will increase coverage by 2.02%.
The diff coverage is 97.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #69      +/-   ##
==========================================
+ Coverage   82.04%   84.06%   +2.02%     
==========================================
  Files          29       29              
  Lines        2389     2454      +65     
==========================================
+ Hits         1960     2063     +103     
+ Misses        429      391      -38     
Impacted Files Coverage Δ
src/LogicCircuits.jl 100.00% <ø> (ø)
src/queries.jl 97.60% <75.00%> (-0.78%) ⬇️
src/transformations.jl 95.54% <98.27%> (+0.20%) ⬆️
src/Utils/data.jl 65.66% <100.00%> (ø)
src/Utils/trees.jl 98.38% <100.00%> (+0.02%) ⬆️
src/satisfies_flow.jl 47.45% <100.00%> (+14.93%) ⬆️
src/abstract_logic_nodes.jl 91.76% <0.00%> (+1.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6659045...7c9058f. Read the comment docs.

Comment on lines +21 to +24
slc = smooth(sdd)
plc = propagate_constants(sdd, remove_unary=true)
structplc = compile(StructLogicCircuit, vtr, plc)
sstructplc = smooth(structplc)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to smooth it twice? Is it because propagage constants need smooth circuit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The smoothed logic circuit is totally orthogonal, it's just for testing. I'm using probabilistic equivalence checking to make sure the smoothing didn't somehow change the meaning of the circuit (that you get the same thing regardless of how you smooth).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, makes sense, I see now, initially read line 22 wrong.

@talf301 talf301 merged commit c7db8ff into master Mar 4, 2021
@talf301 talf301 deleted the structured-smoothing branch March 4, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for smoothing structured decomposable circuits
2 participants