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

Learning #1

Closed
wants to merge 118 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
8310f90
compute the gradients for a single dac + python access to it
luciledierckx Oct 30, 2023
324e652
learning module + dac strucutre
luciledierckx Oct 30, 2023
d1a24d7
add preprocessing to the compiler
luciledierckx Oct 31, 2023
9eea428
correction initialisation dac
luciledierckx Oct 31, 2023
2fe3948
end debugging
luciledierckx Oct 31, 2023
d812c74
training loop + integration of learning to main
luciledierckx Nov 2, 2023
33ec86b
add of a logger and of a timeout for compilation
luciledierckx Nov 3, 2023
0b67c3f
small correction of expected distributions
luciledierckx Nov 6, 2023
9b53f6d
Compiling prints
luciledierckx Nov 6, 2023
38982f4
init of dac without distributions to make it lighter + correction log…
luciledierckx Nov 6, 2023
7fec6c4
add real distrib value: to use dac without learner
luciledierckx Nov 7, 2023
c33d3c7
create fdac and fdist files + read from them
luciledierckx Nov 8, 2023
4858789
approx learner (not branching yet)+detailed logger
luciledierckx Nov 21, 2023
5eb0056
branching limited
luciledierckx Nov 22, 2023
356f9e6
compute the gradients for a single dac + python access to it
luciledierckx Oct 30, 2023
9e65b75
learning module + dac strucutre
luciledierckx Oct 30, 2023
adb44cb
add preprocessing to the compiler
luciledierckx Oct 31, 2023
bae9fcd
correction initialisation dac
luciledierckx Oct 31, 2023
2a2c682
end debugging
luciledierckx Oct 31, 2023
ddccab9
training loop + integration of learning to main
luciledierckx Nov 2, 2023
5b18274
add of a logger and of a timeout for compilation
luciledierckx Nov 3, 2023
a8e595c
small correction of expected distributions
luciledierckx Nov 6, 2023
a1c990a
Compiling prints
luciledierckx Nov 6, 2023
00c2f0a
init of dac without distributions to make it lighter + correction log…
luciledierckx Nov 6, 2023
6a95601
add real distrib value: to use dac without learner
luciledierckx Nov 7, 2023
c871fb0
create fdac and fdist files + read from them
luciledierckx Nov 8, 2023
263851d
approx learner (not branching yet)+detailed logger
luciledierckx Nov 21, 2023
39cfb4d
branching limited
luciledierckx Nov 22, 2023
3b962f0
branching limited: is constrained
luciledierckx Nov 22, 2023
91e5fc4
Merge branch 'learning' of https://github.com/aia-uclouvain/schlandal…
luciledierckx Nov 22, 2023
a122244
delete branching limited (use limited instead)
luciledierckx Nov 22, 2023
bea7dca
update approx
luciledierckx Nov 24, 2023
6b7b375
unify learner + allows partial compilation/search
AlexandreDubray Nov 26, 2023
79befb1
change counting for approx + small correction
luciledierckx Nov 27, 2023
4719181
correction is_node_incomplete + log
luciledierckx Nov 27, 2023
d645365
only add decision to partially compiled node + reduce size of output …
AlexandreDubray Nov 28, 2023
49840d5
skip forced value in propagator assignment iter
AlexandreDubray Nov 28, 2023
e74cd00
partial learning: correction of approximate solver use
luciledierckx Nov 28, 2023
c9e6538
Patial DAC works with lb and prefix_proba
luciledierckx Nov 30, 2023
6ed3ea3
adaptative lr + mae loss
luciledierckx Nov 30, 2023
1f40718
simple early stopping
luciledierckx Nov 30, 2023
64668af
changes used for pyschlandals
luciledierckx Dec 5, 2023
b63e576
add multi-threading for dac evaluation + small reorganization
AlexandreDubray Dec 5, 2023
5a84d06
stop distribution reset when layer > 0
AlexandreDubray Dec 5, 2023
5418b1f
correction dac reset + log at each epoch and training timeout
luciledierckx Dec 6, 2023
b93c9f2
updates for pytorch
luciledierckx Dec 7, 2023
fba14e0
log methods for torch + csv file and prints
luciledierckx Dec 8, 2023
1fddd12
approx eval only every x epochs + no distri dist in log
luciledierckx Dec 8, 2023
28316a0
update logg
luciledierckx Dec 8, 2023
317ba26
small error correction in dac reduce function
luciledierckx Dec 10, 2023
799aceb
correction of inputs vector error
luciledierckx Dec 12, 2023
27ba374
correction early stopping
luciledierckx Dec 12, 2023
47bbc1f
njobs + rnd seed
luciledierckx Dec 13, 2023
a92490f
fix upper bound computation
AlexandreDubray Dec 14, 2023
d9cfee2
change of remove dead end + clear distrib mapping
luciledierckx Dec 14, 2023
0e28e66
some small updates
AlexandreDubray Dec 14, 2023
88f0a4f
path value correction
luciledierckx Dec 15, 2023
1959ad6
fix preprocessing value
AlexandreDubray Dec 15, 2023
8d68a73
fix bounds computation with partial solving
AlexandreDubray Dec 15, 2023
5590813
allow to branch on only a subset of the distributions
AlexandreDubray Dec 16, 2023
a2bac10
fix componetn update when adding learned clause
AlexandreDubray Dec 17, 2023
4d0a173
dispatch search-solver function in mode.rs
AlexandreDubray Dec 17, 2023
2fef9e7
correctly choose a distribution from a clause
AlexandreDubray Dec 17, 2023
b395e38
add coverage for all distributions in the queries for learner
AlexandreDubray Dec 18, 2023
868df88
remove rlearned ratio, use line in CNF file instead
AlexandreDubray Dec 20, 2023
b8d688b
Allow DAC to work on any semiring
AlexandreDubray Dec 23, 2023
22851a6
correctly set up tensor, still need to require grad and update parame…
AlexandreDubray Dec 23, 2023
7e17521
backward step for torch
AlexandreDubray Dec 24, 2023
56a5ea0
Add specialized learner for tensor based learning
AlexandreDubray Dec 27, 2023
24096b2
add command line argument for optimizer
AlexandreDubray Dec 27, 2023
5af37d0
add automatic detection of difficult branch for partial compilation
AlexandreDubray Dec 27, 2023
5e1d5ad
use scalar-tensor + log for tensor-based learning
AlexandreDubray Dec 28, 2023
6d8e709
update partial compiler + correctly detect USAT sub-circuit
AlexandreDubray Dec 28, 2023
7c651d7
early stopping and adaptative learning torch
luciledierckx Dec 29, 2023
cb9c7d0
fix detection of partial node in compilation
AlexandreDubray Dec 29, 2023
5c189b9
complete cnf path in csv
luciledierckx Dec 29, 2023
98b7d23
remove random init
luciledierckx Jan 2, 2024
30fcc47
tensor loss not averaged + cleaning
luciledierckx Jan 2, 2024
f8bba80
removing branch approx + remove unsat approx + faster
luciledierckx Jan 5, 2024
150d582
Share learned clauses between compilation and solving + various fixes
AlexandreDubray Jan 6, 2024
d630a01
correction gradient computation
luciledierckx Jan 6, 2024
113747f
correction gradient computation
luciledierckx Jan 6, 2024
59d96d8
small correction
luciledierckx Jan 6, 2024
4155b9a
use correct bounding factor in partially compiled diagrams
AlexandreDubray Jan 8, 2024
db3f3fd
if epsilon
luciledierckx Jan 8, 2024
f9bd31e
Merge branch 'learning' of https://github.com/aia-uclouvain/schlandal…
luciledierckx Jan 8, 2024
dd42e25
if condition
luciledierckx Jan 10, 2024
8a8baea
correctly branch with solver in partial compilation
AlexandreDubray Jan 10, 2024
88e8022
Merge branch 'learning' of https://github.com/aia-uclouvain/schlandal…
luciledierckx Jan 10, 2024
3cec981
modify branching for partial compiler
AlexandreDubray Jan 10, 2024
e942214
distribution_learned + predictions in log
luciledierckx Jan 10, 2024
cab36c2
Merge branch 'learning' of https://github.com/aia-uclouvain/schlandal…
luciledierckx Jan 10, 2024
4cfdc8b
directly evalute partial node in compilation
AlexandreDubray Jan 10, 2024
b33fd1c
correctly compute partial nodes bound
luciledierckx Jan 11, 2024
ad08ff6
add epsilon to compile arg
AlexandreDubray Jan 11, 2024
b8731ac
testfile
luciledierckx Jan 11, 2024
771faca
todo
luciledierckx Jan 12, 2024
6e9bc86
correction testing
luciledierckx Jan 13, 2024
29ec4d5
testing also before training
luciledierckx Jan 14, 2024
70548eb
small clean of learner
AlexandreDubray Jan 18, 2024
19d824a
Start cleaning diagrams module
AlexandreDubray Jan 19, 2024
62d7c2b
Use compiler and DPLL search as unified solver
AlexandreDubray Jan 23, 2024
0bceb12
some more cleaning
AlexandreDubray Jan 24, 2024
9154f0e
Tensor-based learning as feature not enabled by default
AlexandreDubray Jan 24, 2024
237f146
update pyschlandals
AlexandreDubray Jan 24, 2024
aedf22a
cleaning
luciledierckx Jan 24, 2024
e5609e0
Merge branch 'learning' of https://github.com/aia-uclouvain/schlandal…
luciledierckx Jan 24, 2024
223bae7
push skeleton for new doc
AlexandreDubray Jan 24, 2024
f151add
learn parameters
luciledierckx Jan 24, 2024
5fc135a
addition of the logger
luciledierckx Jan 24, 2024
03ebb53
[doc] Modelization
AlexandreDubray Jan 24, 2024
b7ce524
[doc] install + small update
AlexandreDubray Jan 25, 2024
dc9843d
update publish.yml
AlexandreDubray Jan 25, 2024
0250aec
[pyschlandals] Add compilation in python interface
AlexandreDubray Jan 25, 2024
67b8f06
Add more doc
AlexandreDubray Jan 25, 2024
3303dab
learners description
luciledierckx Jan 25, 2024
5dd02c1
Merge branch 'learning' of https://github.com/aia-uclouvain/schlandal…
luciledierckx Jan 25, 2024
3178d82
doc learning
luciledierckx Jan 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Deploy mdBook

on:
push:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: XAMPPRocky/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ pyschlandals/target
.vscode/
pyschlandals/pipytoken
.vimspector.json
*.cnf
doc/book
25 changes: 16 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ license = "AGPL-3.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rustc-hash = "1.1.0"
clap = { version = "3.0.0-beta.4", features = ["derive"] }
assert_float_eq = "1.1.3"
rand = "0.8.5"
nalgebra = "0.31.4"
rug = { version = "1.18.0", features = ["float", "integer"] }
sysinfo = "0.28.1"
search_trail = "0.1.2"
peak_alloc = "0.2.0"
rustc-hash = ">=1.1.0"
clap = { version = ">=4.4.7", features = ["derive"] }
assert_float_eq = ">=1.1.3"
rand = ">=0.8.5"
nalgebra = ">=0.31.4"
rug = { version = ">=1.18.0", features = ["float", "integer"] }
sysinfo = ">=0.28.1"
search_trail = ">=0.1.2"
peak_alloc = ">=0.2.0"
chrono = ">=0.4.31"
rayon = ">=1.8.0"
bitvec = ">=1.0.1"
tch = { version = ">=0.14.0", optional = true }

[dev-dependencies]
criterion = "0.4.0"
paste = "1.0.12"
tempfile = "3"

[features]
tensor = ["dep:tch"]
9 changes: 9 additions & 0 deletions doc/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[book]
authors = ["Alexandre Dubray", "Lucile Dierckx"]
language = "en"
multilingual = false
src = "src"
title = "The Schlandals Book"

[output.html]
mathjax-support = true
30 changes: 30 additions & 0 deletions doc/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Introduction

Schlandals is a state-of-the-art _Projected Weighted Model Counter_ specialized for probabilistic inference over discrete probability distributions.
Currently, there are known modelization for the following problems
- Computing the marginal probabilities of a variable in a Bayesian Network
- Computing the probability that two nodes are connected in a probabilistic graph
- Computing the probability of [ProbLog](https://github.com/ML-KULeuven/problog) programs

For more information on how to use Schlandals and its mechanics, check [the documentation](https://aia-uclouvain.github.io/schlandals/doc).
You can cite Schlandals using the following bibtex entry
```
@InProceedings{dubray_et_al:LIPIcs.CP.2023.15,
author = {Dubray, Alexandre and Schaus, Pierre and Nijssen, Siegfried},
title = {{Probabilistic Inference by Projected Weighted Model Counting on Horn Clauses}},
booktitle = {29th International Conference on Principles and Practice of Constraint Programming (CP 2023)},
pages = {15:1--15:17},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-300-3},
ISSN = {1868-8969},
year = {2023},
volume = {280},
editor = {Yap, Roland H. C.},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/opus/volltexte/2023/19052},
URN = {urn:nbn:de:0030-drops-190520},
doi = {10.4230/LIPIcs.CP.2023.15},
annote = {Keywords: Model Counting, Bayesian Networks, Probabilistic Networks}
}
```
16 changes: 16 additions & 0 deletions doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Summary

[Introduction](README.md)
[Installation](install.md)

- [Schlandals Modelization](modelization/README.md)
- [The Language](modelization/language.md)
- [Encoding Bayesian Networks](modelization/bn.md)
- [Encoding Probabilistic Graphs](modelization/pg.md)
- [Encoding ProbLog Programs](modelization/problog.md)
- [Probabilistic Inference](inference/README.md)
- [Search solver](inference/search.md)
- [Compiler](inference/compilation.md)
- [Learning Distributions Parameters](learning/README.md)
- [Learning Settings](learning/settings.md)
- [Python Interface](python.md)
5 changes: 5 additions & 0 deletions doc/src/inference/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Probabilistic Inference

Schlandals provides exact and \\( \epsilon \\)-bounded approximate inference methods.
It can be used either as a DPLL-style search-based solver or as a compiler that outputs an arithmetic circuit.
Beware that, currently; the compiler is just a search-solver saving its trace. Hence, you should use the search solver if you do not need to keep the circuits for further computation.
Loading
Loading