Tractables / ProbabilisticCircuits.jl

Probabilistic Circuits from the Juice library
https://tractables.github.io/ProbabilisticCircuits.jl/dev
Apache License 2.0
104 stars 11 forks source link

1D gaussian input node implementation (WIP) #129

Open ams939 opened 1 year ago

ams939 commented 1 year ago

This PR proposes an implementation of a 1D Gaussian input node (in relation to Issue #128). Currently implemented are some of the new input node code and related IO functions, along with their respective tests.

I'm currently trying to figure out how to implement the 'update_params' function, but I'm a bit confused on how to utilize the missing flow, flow and flow*value to do so. Any tips or feedback on this or any other aspects of the code would be much appreciated.

Other implementational details of note that are open questions are:

trappmartin commented 1 year ago

'sample_state' function currently does not use the 'threshold' parameter, uses randn(). What problems might this pose in terms of reproducibility?

Is the threshold parameter the seed? It seems that sample_state doesn't take a random number generator, this seems odd to me. @khosravipasha, how is reproducibility guaranteed at the moment?

codecov[bot] commented 1 year ago

Codecov Report

Base: 41.10% // Head: 28.29% // Decreases project coverage by -12.81% :warning:

Coverage data is based on head (2945a58) compared to base (27cb093). Patch coverage: 25.39% of modified lines in pull request are covered.

:exclamation: Current head 2945a58 differs from pull request most recent head 5b9b295. Consider uploading reports for the commit 5b9b295 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #129 +/- ## =========================================== - Coverage 41.10% 28.29% -12.81% =========================================== Files 23 24 +1 Lines 1927 1990 +63 =========================================== - Hits 792 563 -229 - Misses 1135 1427 +292 ``` | [Impacted Files](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl) | Coverage Δ | | |---|---|---| | [src/io/plot.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL2lvL3Bsb3Quamw=) | `80.00% <0.00%> (-8.89%)` | :arrow_down: | | [src/nodes/gaussian\_dist.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL25vZGVzL2dhdXNzaWFuX2Rpc3Quamw=) | `6.38% <6.38%> (ø)` | | | [src/io/jpc\_io.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL2lvL2pwY19pby5qbA==) | `99.21% <100.00%> (+0.08%)` | :arrow_up: | | [src/queries/map\_cpu.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL3F1ZXJpZXMvbWFwX2NwdS5qbA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: | | [src/queries/sample\_cpu.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL3F1ZXJpZXMvc2FtcGxlX2NwdS5qbA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: | | [src/structures/hclts.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL3N0cnVjdHVyZXMvaGNsdHMuamw=) | `0.00% <0.00%> (-74.73%)` | :arrow_down: | | [src/queries/likelihood\_cpu.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL3F1ZXJpZXMvbGlrZWxpaG9vZF9jcHUuamw=) | `0.00% <0.00%> (-59.62%)` | :arrow_down: | | [src/nodes/binomial\_dist.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL25vZGVzL2Jpbm9taWFsX2Rpc3Quamw=) | `3.65% <0.00%> (-51.22%)` | :arrow_down: | | [src/nodes/indicator\_dist.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL25vZGVzL2luZGljYXRvcl9kaXN0Lmps) | `50.00% <0.00%> (-16.67%)` | :arrow_down: | | [src/queries/likelihood.jl](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl#diff-c3JjL3F1ZXJpZXMvbGlrZWxpaG9vZC5qbA==) | `0.00% <0.00%> (-2.90%)` | :arrow_down: | | ... and [1 more](https://codecov.io/gh/Juice-jl/ProbabilisticCircuits.jl/pull/129?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl) | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Juice-jl)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.