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

GraphPPL version 4.0.0 #204

Merged
merged 714 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
714 commits
Select commit Hold shift + click to select a range
1166762
Implement `VarDict`
wouterwln Feb 28, 2024
9de0ced
Update map on vardict
wouterwln Feb 29, 2024
2be2715
Update graph_engine.jl
wouterwln Feb 29, 2024
cc75277
Fix tests for vardict
wouterwln Feb 29, 2024
34ad780
Add filter method, documentation, and more tests to VarDict implement…
bvdmitri Mar 1, 2024
03142f0
More tests
bvdmitri Mar 1, 2024
9de8055
Merge branch 'dev-4.0.0' into bounded-bitsettuple
wouterwln Mar 4, 2024
25ffd3c
Merge pull request #156 from ReactiveBayes/bounded-bitsettuple
wouterwln Mar 4, 2024
383d8ad
don't memoize
wouterwln Mar 5, 2024
3e25460
new is_partition and to_tuple functions
wouterwln Mar 5, 2024
69d076c
Change type inference for in_lhs and dispatch on count
wouterwln Mar 6, 2024
55be6a0
Merge pull request #158 from ReactiveBayes/new_partition
wouterwln Mar 6, 2024
907d708
Remove the interfaces from the options
bvdmitri Mar 6, 2024
0fd22e2
Remove dependency on Memoization
wouterwln Mar 6, 2024
bd16295
Merge pull request #159 from ReactiveBayes/performance
wouterwln Mar 6, 2024
fd3bb5b
Remove memoization import
wouterwln Mar 6, 2024
f3b7a19
type stable factor node creation
wouterwln Mar 7, 2024
34470c7
Update type stability of splittedrange
wouterwln Mar 7, 2024
b5e5175
type stable nested models
wouterwln Mar 7, 2024
c35abea
Merge pull request #160 from ReactiveBayes/type-stability
wouterwln Mar 7, 2024
9a2a2f4
Fix splittedrange bug in variational constraints engine
wouterwln Mar 7, 2024
cf50ddd
fix iteration bug
wouterwln Mar 7, 2024
56a94a2
add nodedata of neighbor to properties
wouterwln Mar 7, 2024
835b28f
remove nodelabel casting
wouterwln Mar 7, 2024
d52ab51
Use `any` and `all` in place of `for` loop
bvdmitri Mar 7, 2024
ea8bde6
Merge branch 'dev-4.0.0' into nodedata-in-properties
wouterwln Mar 7, 2024
b42d58a
change apply_constraints! to use foreach
wouterwln Mar 7, 2024
07c9ed9
Add compile time keys for the extra properties
bvdmitri Mar 8, 2024
f760291
Merge pull request #161 from ReactiveBayes/dev-extra-compile-time-keys
wouterwln Mar 8, 2024
f2ce604
Merge branch 'dev-4.0.0' into nodedata-in-properties
bvdmitri Mar 8, 2024
c636643
fix tests
bvdmitri Mar 8, 2024
5bc5984
Merge pull request #162 from ReactiveBayes/nodedata-in-properties
bvdmitri Mar 8, 2024
0cd7473
Add more type stability
bvdmitri Mar 8, 2024
824647b
Small show bug
bvdmitri Mar 8, 2024
17e608e
2prev
bvdmitri Mar 8, 2024
6ddec8f
Materialize anonymous variables later only if needed
bvdmitri Mar 8, 2024
e199e5b
Add tests
bvdmitri Mar 8, 2024
57d745f
Merge pull request #163 from ReactiveBayes/dev-fform-type
wouterwln Mar 8, 2024
54228dc
Merge pull request #164 from ReactiveBayes/dev-anonymous-materializat…
wouterwln Mar 8, 2024
0c7207c
Add more exceptions to DistributionsExt object
bvdmitri Mar 11, 2024
4c11790
make format
wouterwln Mar 11, 2024
5f937f6
implement `interface_aliases`
wouterwln Mar 11, 2024
39d7b2a
Add Dirichlet exception to DistributionsExt
wouterwln Mar 11, 2024
ef25eb6
Allow function in constraints macro
wouterwln Mar 12, 2024
5a6d5ff
Allow function calls in meta macro
wouterwln Mar 12, 2024
c06d375
Shorten constraints and meta macros
wouterwln Mar 12, 2024
42a1ba8
Merge pull request #168 from ReactiveBayes/165-function-based-syntax-…
wouterwln Mar 12, 2024
39a68ce
Fix submodels as keyword arguments
bvdmitri Mar 12, 2024
1077c93
Merge pull request #169 from ReactiveBayes/dev-allow-node-labels-comp…
wouterwln Mar 12, 2024
f46f35a
make format
wouterwln Mar 12, 2024
061c0c4
Play around with a different implementation
bvdmitri Mar 12, 2024
3614914
Improve the implementation and add more tests
bvdmitri Mar 12, 2024
ddd6b73
More tests
bvdmitri Mar 12, 2024
15aa654
Merge branch 'dev-4.0.0' into 143-interface-aliases-should-be-possible
bvdmitri Mar 12, 2024
72dc30c
Merge branch 'dev-4.0.0' into 143-interface-aliases-should-be-possible
bvdmitri Mar 12, 2024
fded07a
Merge pull request #167 from ReactiveBayes/143-interface-aliases-shou…
bvdmitri Mar 12, 2024
1160917
2prev
bvdmitri Mar 12, 2024
f6cb7b9
Compose simple operators with brackets
bvdmitri Mar 12, 2024
4eee5d9
Allow saving of models
wouterwln Mar 13, 2024
25628f5
Merge pull request #170 from ReactiveBayes/166-feature-request-abilit…
wouterwln Mar 13, 2024
9759fea
Fix incorrect dispatch in the multiplication of constraints
bvdmitri Mar 13, 2024
db8e42c
Merge pull request #171 from ReactiveBayes/dev-fix-joint-constraint
bvdmitri Mar 13, 2024
50a3078
Add exception to Categorical
bvdmitri Mar 13, 2024
d92d560
Implement global MeanField and BetheFactorization constraints
wouterwln Mar 13, 2024
918bbbc
Update docstrings for MeanField and BetheFactorization
wouterwln Mar 13, 2024
569b2ec
Update docstrings for Stochastic and Deterministic
wouterwln Mar 13, 2024
e15acaa
make format
wouterwln Mar 13, 2024
c56c324
Merge pull request #172 from ReactiveBayes/allow-meanfield-bethe-as-g…
bvdmitri Mar 13, 2024
cc4e20d
make format
wouterwln Mar 13, 2024
466346c
Implement minor optimizations in the constraints algorithm
bvdmitri Mar 13, 2024
b4393e0
Merge branch 'dev-4.0.0' into dev-minor-optimizations
bvdmitri Mar 13, 2024
bcd7ae4
More changes
bvdmitri Mar 13, 2024
4bc587a
Prettify the code
bvdmitri Mar 13, 2024
e98d5e2
Merge pull request #173 from ReactiveBayes/dev-minor-optimizations
bvdmitri Mar 14, 2024
9776cd8
Start implementing the backend
bvdmitri Mar 14, 2024
d4bcc99
Fix some tests
bvdmitri Mar 14, 2024
6ce62ea
Fix tests
bvdmitri Mar 14, 2024
c9a5e8c
Fix tests
bvdmitri Mar 14, 2024
3334164
Make tests green again
bvdmitri Mar 14, 2024
0b3e5cf
2prev
bvdmitri Mar 14, 2024
3469f2b
Indices for multidimensional constriants initial commit
wouterwln Mar 14, 2024
ef25f62
Reduce call to getcontext for vectors
wouterwln Mar 14, 2024
c7e1f0b
Refactor 'create_model' function
bvdmitri Mar 14, 2024
5e3f022
2prev
bvdmitri Mar 14, 2024
8a76139
NodeBehaviour depends on the model backend
bvdmitri Mar 14, 2024
a72cdcf
2prev
bvdmitri Mar 14, 2024
e4a5d14
NodeType uses backend
bvdmitri Mar 14, 2024
4ea271d
aliases uses backend
bvdmitri Mar 14, 2024
15fcb1d
interfaces uses backend
bvdmitri Mar 14, 2024
35b3ebb
factor_alias uses backend
bvdmitri Mar 14, 2024
7b8fa69
interface_aliases uses backend
bvdmitri Mar 14, 2024
d9b2336
2prev
bvdmitri Mar 14, 2024
2c32346
default_parametrization uses backend
bvdmitri Mar 14, 2024
229f10c
Fix benchmarks
bvdmitri Mar 14, 2024
ba1be45
Move bracketing to RxInfer
bvdmitri Mar 15, 2024
580dbc6
move warn datavar in RxInfer
bvdmitri Mar 15, 2024
2ea3de8
Matrix constraint resolution
wouterwln Mar 15, 2024
49570fb
add NotImplementedError test
wouterwln Mar 15, 2024
248e24d
new test
bvdmitri Mar 15, 2024
5db23a5
Merge pull request #174 from ReactiveBayes/dev-4.0.0-backend
wouterwln Mar 15, 2024
6ac4322
Start implementing the backend
bvdmitri Mar 14, 2024
8d19442
Fix some tests
bvdmitri Mar 14, 2024
e6ae705
Fix tests
bvdmitri Mar 14, 2024
4b74aba
Fix tests
bvdmitri Mar 14, 2024
2a9adb0
Make tests green again
bvdmitri Mar 14, 2024
3b2d3e1
2prev
bvdmitri Mar 14, 2024
08aba57
Refactor 'create_model' function
bvdmitri Mar 14, 2024
53c584b
2prev
bvdmitri Mar 14, 2024
13e0281
NodeBehaviour depends on the model backend
bvdmitri Mar 14, 2024
d4ffb69
2prev
bvdmitri Mar 14, 2024
8d41901
NodeType uses backend
bvdmitri Mar 14, 2024
55d6810
aliases uses backend
bvdmitri Mar 14, 2024
e4b89dc
interfaces uses backend
bvdmitri Mar 14, 2024
e0c9115
factor_alias uses backend
bvdmitri Mar 14, 2024
06b267c
interface_aliases uses backend
bvdmitri Mar 14, 2024
2b02b02
2prev
bvdmitri Mar 14, 2024
3c8d501
default_parametrization uses backend
bvdmitri Mar 14, 2024
ff7da6a
Fix benchmarks
bvdmitri Mar 14, 2024
f5e85e5
Move bracketing to RxInfer
bvdmitri Mar 15, 2024
cc746e0
move warn datavar in RxInfer
bvdmitri Mar 15, 2024
a1352a0
new test
bvdmitri Mar 15, 2024
55e6076
Indices for multidimensional constriants initial commit
wouterwln Mar 14, 2024
edbe56b
Matrix constraint resolution
wouterwln Mar 15, 2024
aaad491
Merge with dev-4.0.0
wouterwln Mar 15, 2024
892bc92
Merge branch 'dev-4.0.0' into indices-for-multidim-resizablearray
wouterwln Mar 15, 2024
c4944c6
make format
wouterwln Mar 15, 2024
76bdd6b
abstract away implementational detail in constraint tests
wouterwln Mar 18, 2024
fd74e84
Update constraints with nicer error for splittedranges
wouterwln Mar 18, 2024
8081050
Update `check_variate_compatability` implementation
wouterwln Mar 18, 2024
00a8952
Merge pull request #179 from ReactiveBayes/check_variate_compat
wouterwln Mar 18, 2024
61f21de
Fix passing multidim slices to submodels
wouterwln Mar 19, 2024
0303fad
Merge branch 'dev-4.0.0' into indices-for-multidim-resizablearray
wouterwln Mar 19, 2024
392b180
remove double definition
wouterwln Mar 19, 2024
1a0d336
Add keys for marginal and messages form constraints
bvdmitri Mar 19, 2024
d1b9450
Custom errors
wouterwln Mar 19, 2024
639e8bd
Fix tests
bvdmitri Mar 19, 2024
0a711e0
add tests
wouterwln Mar 19, 2024
ccbcd10
Merge pull request #180 from ReactiveBayes/dev-4.0.0-form-constraints
bvdmitri Mar 19, 2024
db172d4
add getextra with default
bvdmitri Mar 19, 2024
1a72dcf
skip a getindex for large splittedarrays
wouterwln Mar 19, 2024
54eb171
Merge branch 'dev-4.0.0' into indices-for-multidim-resizablearray
wouterwln Mar 19, 2024
b99d6a7
Merge pull request #175 from ReactiveBayes/indices-for-multidim-resiz…
wouterwln Mar 19, 2024
b225c30
Merge branch 'dev-4.0.0' into dev-4.0.0-get-extra-or-default
wouterwln Mar 19, 2024
c04f5ce
remove .counter shenanigans
bvdmitri Mar 19, 2024
c126558
Merge branch 'dev-4.0.0' into dev-4.0.0-model-counter
wouterwln Mar 19, 2024
dba134a
Merge pull request #183 from ReactiveBayes/dev-4.0.0-model-counter
wouterwln Mar 19, 2024
65983dd
Change weird constraints warning
wouterwln Mar 19, 2024
ef05ce1
Merge branch 'dev-4.0.0' into 176-weird-warning-while-using-constrain…
wouterwln Mar 19, 2024
6a8f46a
Update variational_constraints_engine_tests.jl
wouterwln Mar 19, 2024
53a23b4
fix `check_variate_compatability` bug
wouterwln Mar 19, 2024
f1c28b4
Merge pull request #184 from ReactiveBayes/176-weird-warning-while-us…
wouterwln Mar 19, 2024
7835eba
Merge branch 'dev-4.0.0' into dev-4.0.0-get-extra-or-default
wouterwln Mar 19, 2024
37c54e3
Merge pull request #182 from ReactiveBayes/dev-4.0.0-get-extra-or-def…
wouterwln Mar 19, 2024
93e940a
evaluate fform only if it is being used in a combination with anonymo…
bvdmitri Mar 19, 2024
2fe8454
Merge branch 'dev-4.0.0' into dev-engine-ignores-constant-nodes
bvdmitri Mar 19, 2024
c23f8ee
Add ProxyLabel of AnonymousVariable to the list of exceptions
bvdmitri Mar 19, 2024
21c7478
Fix tests
bvdmitri Mar 19, 2024
14e8516
Fix complex constraint construction
wouterwln Mar 19, 2024
503e943
Change dispatch of `check_variate_compatability` to `AbstractArray`
wouterwln Mar 19, 2024
20a9458
Merge pull request #185 from ReactiveBayes/dev-engine-ignores-constan…
bvdmitri Mar 19, 2024
e4052db
Merge branch 'dev-4.0.0' into 181-passing-a-vector-of-rvs-to-submodel…
wouterwln Mar 19, 2024
1ded935
Add documentation for parsing issue
wouterwln Mar 19, 2024
84dec61
Merge pull request #186 from ReactiveBayes/177-complex-constraint-doe…
wouterwln Mar 19, 2024
9fed896
Merge pull request #187 from ReactiveBayes/181-passing-a-vector-of-rv…
wouterwln Mar 19, 2024
8ddf267
add getkey method for nodedataextrakey
bvdmitri Mar 20, 2024
c1150a8
Allow `MeanField` constraints
wouterwln Mar 20, 2024
55e9d49
make format
wouterwln Mar 20, 2024
68f1367
Update src/plugins/variational_constraints/variational_constraints_en…
wouterwln Mar 20, 2024
8b6b0ac
Add test for meanfield on matrix
wouterwln Mar 20, 2024
5c10550
Merge pull request #189 from ReactiveBayes/188-meanfield-constraint-i…
wouterwln Mar 20, 2024
fcf91c9
Transfer tests from ReactiveMP
bvdmitri Mar 20, 2024
63ccc69
Merge pull request #190 from ReactiveBayes/dev-func-index-tests
wouterwln Mar 20, 2024
90c38b5
Revisit macro construction and broken tests
wouterwln Mar 20, 2024
aa103a2
Merge pull request #191 from ReactiveBayes/cleanup
wouterwln Mar 20, 2024
35a9f8b
Fix broadcasting for simple cases
wouterwln Mar 21, 2024
caba74b
Fix broken test
wouterwln Mar 21, 2024
efdf7cc
Add broadcasting in anonymous variables
wouterwln Mar 22, 2024
5cabe10
Implement `broadcastable` for NodeLabel and ProxyLabel
wouterwln Mar 22, 2024
d7714bd
add tests
wouterwln Mar 22, 2024
8927050
fix `combine_axes` bug
wouterwln Mar 22, 2024
f3e55b3
add test for dangling `materialize_anonymous_variable`
wouterwln Mar 22, 2024
2727cfe
add more tests
bvdmitri Mar 22, 2024
098b4fa
make format
wouterwln Mar 22, 2024
eecd83a
Merge pull request #192 from ReactiveBayes/broadcasting
wouterwln Mar 22, 2024
22d769e
Merge branch 'dev-4.0.0' into dev-more-tests
wouterwln Mar 22, 2024
1998282
Merge pull request #193 from ReactiveBayes/dev-more-tests
wouterwln Mar 22, 2024
420fa29
Update model_macro.jl
wouterwln Mar 22, 2024
611be3a
more tests for broadcasting
bvdmitri Mar 22, 2024
5f012a3
Fix broadcasting over ranges
bvdmitri Mar 22, 2024
47a361d
Fix complex ranges
bvdmitri Mar 22, 2024
560cfc1
add comments to tests
bvdmitri Mar 22, 2024
15fd0a6
fix typo in tests
bvdmitri Mar 22, 2024
da59937
More test cases
bvdmitri Mar 25, 2024
45ff133
save intermediate results
bvdmitri Mar 25, 2024
612424b
fix tests
bvdmitri Mar 25, 2024
bdbe7f0
Ensure documentation runs with latest changes
wouterwln Mar 25, 2024
1c4e830
Test factorization with the new logic
bvdmitri Mar 25, 2024
2cbd198
Merge pull request #194 from ReactiveBayes/dev-4.0.0-ranged-broadcasting
bvdmitri Mar 25, 2024
f605d72
Merge branch 'dev-4.0.0' into dev-4.0.0-fold-datavars
bvdmitri Mar 25, 2024
8bd3e90
more tests
bvdmitri Mar 25, 2024
fada3f4
Fix bug in broadcasting over only constants
wouterwln Mar 25, 2024
5f2dc3c
Remove compose from ext dependencies
wouterwln Mar 25, 2024
5d42da8
Add plotting example to documentation
wouterwln Mar 25, 2024
ffe3a0d
More tests
bvdmitri Mar 25, 2024
3305358
fix 2prev
bvdmitri Mar 25, 2024
4cc174d
Fix bug
wouterwln Mar 25, 2024
6be16af
fix typo
wouterwln Mar 25, 2024
a9debee
Add additional documentation
wouterwln Mar 25, 2024
a4882f2
Merge pull request #196 from ReactiveBayes/dev-4.0.0-fold-datavars
wouterwln Mar 25, 2024
aaa9959
generalize more
bvdmitri Mar 25, 2024
3d4cfc7
Allow return statement from the model/submodels
bvdmitri Mar 25, 2024
133ae43
Merge pull request #197 from ReactiveBayes/dev-4.0.0-save-return-values
wouterwln Mar 26, 2024
257230a
Merge pull request #195 from ReactiveBayes/documentation
wouterwln Mar 26, 2024
9641312
add new constructor for LazyIndex
bvdmitri Mar 26, 2024
a61ad59
Allow switching backend for construction
wouterwln Mar 27, 2024
83c6b76
make format
wouterwln Mar 28, 2024
1897f71
add migration guide
wouterwln Mar 28, 2024
7fe2330
make some structs mutable
wouterwln Mar 28, 2024
8616aa0
change fields of factorID to const
wouterwln Mar 28, 2024
78286ad
Add `with_backend` and change model macro usage of backend
wouterwln Apr 2, 2024
0b3c4c0
Prettify and add tests
bvdmitri Apr 2, 2024
f2ded5a
Update migration.md
wouterwln Apr 2, 2024
4f6804b
Fix tests
bvdmitri Apr 2, 2024
3f6d895
More tests
bvdmitri Apr 2, 2024
aaa8261
Fix broken test
bvdmitri Apr 2, 2024
528a78c
More tests
bvdmitri Apr 2, 2024
b07aef9
Merge pull request #200 from ReactiveBayes/with-backend
bvdmitri Apr 2, 2024
c5df883
Merge pull request #199 from ReactiveBayes/mutable
bvdmitri Apr 2, 2024
a10cdcc
Prettify the documentation
bvdmitri Apr 2, 2024
803f289
Remove the `Old` module
bvdmitri Apr 2, 2024
c8e4d63
2prev
bvdmitri Apr 2, 2024
e367eef
Prettify the docs
bvdmitri Apr 2, 2024
1f8a27c
Set warnonly to false
bvdmitri Apr 2, 2024
e245e14
Fix the docs build
bvdmitri Apr 2, 2024
55df844
Merge branch 'dev-4.0.0' into migration-guide
bvdmitri Apr 2, 2024
3cab18c
Fix merge
bvdmitri Apr 2, 2024
d218487
Merge pull request #198 from ReactiveBayes/migration-guide
bvdmitri Apr 2, 2024
5eb5d33
Initiate the Syntax Guide
bvdmitri Apr 2, 2024
e678304
add 2docs
bvdmitri Apr 2, 2024
ff246fe
Update README and version number
bvdmitri Apr 2, 2024
05ff72a
add 2docs
bvdmitri Apr 2, 2024
861f119
add documentation for node id plugin
bvdmitri Apr 3, 2024
166a468
Update syntax guide
wouterwln Apr 3, 2024
e7fab3f
Minor fixes
bvdmitri Apr 3, 2024
c17c7c2
2prev
bvdmitri Apr 3, 2024
4db652b
minor changes to the syntax guide
bvdmitri Apr 3, 2024
7a0c87b
Merge pull request #201 from ReactiveBayes/dev-4.0.0-documentation-bv…
bvdmitri Apr 3, 2024
4e07521
Merge pull request #202 from ReactiveBayes/dev-4.0.0-documentation-bv…
bvdmitri Apr 3, 2024
e73c6f5
Merge pull request #203 from ReactiveBayes/dev-4.0.0-documentation
bvdmitri Apr 3, 2024
c6ee51a
Merge branch 'main' into dev-4.0.0
wouterwln Apr 3, 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
26 changes: 26 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
style = "blue"
indent = 4
margin = 140
always_for_in = true
whitespace_typedefs = true
whitespace_ops_in_indices = true
remove_extra_newlines = true
import_to_using = false
pipe_to_function_call = false
short_to_long_function_def = false
long_to_short_function_def = false
always_use_return = false
whitespace_in_kwargs = true
annotate_untyped_fields_with_any = false
format_docstrings = false
conditional_to_if = true
trailing_comma = false
indent_submodule = false
align_assignment = true
align_struct_field = true
align_conditional = true
align_pair_arrow = true
align_matrix = false
join_lines_based_on_source = false
separate_kwargs_with_semicolon = false
surround_whereop_typeparameters = true
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- "src/old/"
- "ext/"
41 changes: 35 additions & 6 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
name: CompatHelper
on:
schedule:
- cron: '00 00 * * *'
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} # optional
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
26 changes: 9 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.7'
- '1.8'
- '1.9'
- '1.10'
- 'nightly'
os:
- ubuntu-latest
arch:
Expand All @@ -36,27 +33,22 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
docs:
name: Documentation
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.10'
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ demo/*wip.ipynb
demo/*.jl

.idea
.vscode
.vscode/


**/*.aux
**/*.log
Expand All @@ -46,5 +47,10 @@ Coverage.ipynb

**/.DS_Store

benchmark/tune.json
benchmark_*md

examples/*Compiled
statprof
profile.pb.gz
.swp
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
scripts_init:
julia --startup-file=no --project=scripts/ -e 'using Pkg; Pkg.instantiate(); Pkg.update(); Pkg.precompile();'

project_init:
julia --startup-file=no --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.update(); Pkg.precompile();'

lint: scripts_init ## Code formating check
julia --startup-file=no --project=scripts/ scripts/format.jl

format: scripts_init ## Code formating run
julia --startup-file=no --project=scripts/ scripts/format.jl --overwrite

bench: ## Run benchmark, use `make bench branch=...` to test against a specific branch
julia --startup-file=no --project=scripts/ scripts/bench.jl $(branch)

doc_init:
julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate();'

docs: doc_init ## Generate documentation
julia --project=docs/ docs/make.jl
40 changes: 34 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,48 @@
name = "GraphPPL"
uuid = "b3f8163a-e979-4e85-b43e-1f63d8c8b42c"
authors = ["Dmitry Bagaev <[email protected]>"]
version = "3.1.0"
authors = ["Wouter Nuijten <[email protected]>", "Dmitry Bagaev <[email protected]>"]
version = "4.0.0"

[deps]
BitSetTuples = "0f2f92aa-23a3-4d05-b791-88071d064721"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
NamedTupleTools = "d9ec5142-1e00-5aa0-9d6a-321866360f50"
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TupleTools = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6"
Unrolled = "9602ed7d-8fef-5bc8-8597-8f21381861e8"

[weakdeps]
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GraphPlot = "a2cc645c-3eea-5389-862e-a155d0052231"

[extensions]
GraphPPLDistributionsExt = "Distributions"
GraphPPLPlottingExt = ["Cairo", "GraphPlot"]

[compat]
MacroTools = "0.5.6"
TupleTools = "1.2.0"
BitSetTuples = "1.1"
Cairo = "1.0"
DataStructures = "0.18"
Dictionaries = "0.4"
Distributions = "0.25"
Documenter = "1.0"
GraphPlot = "0.5"
MacroTools = "0.5"
MetaGraphsNext = "0.6, 0.7"
NamedTupleTools = "0.14"
Static = "0.8"
StaticArrays = "1.6"
TupleTools = "1.4"
Unrolled = "0.1"
julia = "1.6"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Documenter"]
test = ["Documenter"]
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,46 @@
[ci-img]: https://github.com/reactivebayes/GraphPPL.jl/actions/workflows/ci.yml/badge.svg?branch=master
[ci-url]: https://github.com/reactivebayes/GraphPPL.jl/actions

GraphPPL.jl is a probabilistic programming language focused on probabilistic graphical models. This repository is aimed for advanced users, please refer to the [ReactiveMP.jl](https://github.com/reactivebayes/ReactiveMP.jl) repository for more comprehensive and self-contained documentation and usages examples.
GraphPPL.jl is a probabilistic programming language focused on probabilistic graphical models. GraphPPL.jl materializes a probabilistic model as a factor graph and provides a set of tools for model specification. GraphPPL.jl is a part of the [RxInfer](https://rxinfer.ml) ecosystem, but it does not explicitly depend on any inference backend. GraphPPL exports a high-level DSL for model specification and allows users to append arbitrary information to nodes in the model. This information can be used by inference backends to perform inference on the model.

## Installation

To install GraphPPL.jl, you can use the Julia package manager. From the Julia REPL, type `]` to enter the Pkg REPL mode and run:

```julia
pkg> add GraphPPL
```

# Model Specification in GraphPPL

GraphPPL.jl provides a high-level DSL for model specification. The DSL is based on the [Julia's](https://julialang.org) macro system and allows users to specify probabilistic models in a concise and intuitive way. The DSL is based on the following principles:

- **Model specification should read as a Julia program**. GraphPPL.jl introduces the `~` syntax for model specification.
- **Any GraphPPL model is a valid submodel**. GraphPPL.jl allows users to specify models as a composition of submodels. This allows users to reuse models and specify complex models in a modular way.
- **Model specification should be extensible**. GraphPPL.jl allows users to extend the DSL with custom model specification procedures. This allows developers of inference backend to inject desired behavior to the model specification process.

To achieve tihs, GraphPPL.jl specifies a protocol for the `@model` macro:
```julia
@model function beta_bernoulli(x)
θ ~ Beta(1, 1)
for i in eachindex(x)
x[i] ~ Bernoulli(θ)
end
end
```

# Inference Backend

GraphPPL.jl does not export any Bayesian inference backend. It provides a simple DSL parser, model generation, constraints specification and meta specification helpers. To run inference on
generated models user needs to have a Bayesian inference backend with GraphPPL.jl support (e.g. [ReactiveMP.jl](https://github.com/reactivebayes/ReactiveMP.jl)).
GraphPPL.jl does not export any Bayesian inference backend. It provides a complex DSL parser, model generation, constraints specification and meta specification helpers. To run inference on
generated models a user needs to have a Bayesian inference backend with GraphPPL.jl support (e.g. [RxInfer.jl](https://rxinfer.ml)).

# Documentation

For more information about GraphPPL.jl please refer to the [documentation](https://biaslab.github.io/GraphPPL.jl/stable).

> [!NOTE]
> `GraphPPL.jl` API has been changed in version `4.0.0`. See [Migration Guide](https://reactivebayes.github.io/GraphPPL.jl/stable/) for more details.


# License

Expand Down
9 changes: 9 additions & 0 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using BenchmarkTools

const SUITE = BenchmarkGroup()

include("graph_engine.jl")
include("model_creation.jl")

SUITE["graph_engine"] = benchmark_graph_engine()
SUITE["model_creation"] = benchmark_model_creation()
88 changes: 88 additions & 0 deletions benchmark/graph_engine.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using BenchmarkTools
using GraphPPL

function benchmark_graph_engine()
SUITE = BenchmarkGroup(["graph_creation"])

# Benchmark how long it takes to create a model structure
SUITE["create_model"] = @benchmarkable GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend()) evals = 1

# Benchmark how long it takes to get the context of a model
SUITE["getcontext"] = @benchmarkable GraphPPL.getcontext(model) evals = 1 setup = begin
model = GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend())
end

# Benchmark how long it takes to create a factor node
SUITE["factor_node_creation"] = benchmark_factor_node_creation()

# Benchmark how long it takes to get or create a variable node
SUITE["variable_node_creation"] = benchmark_variable_node_creation()

return SUITE
end

# Benchmark how long it takes to create a factor node
function benchmark_factor_node_creation()
SUITE = BenchmarkGroup()

# This SUITE benchmarks how long it takes to create a factor node `$f` with `n` variables as input
for f in (sum,), n in Int.(exp10.(0:4))
SUITE["make_node! (n inputs)", f, n] = @benchmarkable GraphPPL.make_node!(model, ctx, $f, y, (in = x,)) evals =
1 setup = begin
model = GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend())
ctx = GraphPPL.getcontext(model)
y = GraphPPL.getorcreate!(model, ctx, :y, nothing)
foreach(1:($n)) do i
GraphPPL.getorcreate!(model, ctx, :x, i)
end
x = GraphPPL.getorcreate!(model, ctx, :x, 1)
end
end

# This SUITE benchmarks how long it takes to create `n` factor nodes with the same variable as input
for f in (sum,), n in Int.(exp10.(0:4))
SUITE["make_node! (n nodes)", f, n] = @benchmarkable foreach(
_ -> GraphPPL.make_node!(model, ctx, $f, y, (in = x,)), 1:($n)
) evals = 1 setup = begin
model = GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend())
ctx = GraphPPL.getcontext(model)
y = GraphPPL.getorcreate!(model, ctx, :y, nothing)
x = GraphPPL.getorcreate!(model, ctx, :x, nothing)
end
end

return SUITE
end

function benchmark_variable_node_creation()
SUITE = BenchmarkGroup()

# This SUITE benchmarks how long it takes to create a single variable node
SUITE["getorcreate! (individual)"] = @benchmarkable GraphPPL.getorcreate!(model, ctx, :x, nothing) evals = 1 setup =
begin
model = GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend())
ctx = GraphPPL.getcontext(model)
end

# This SUITE benchmarks how long it takes to add `n` individual variable nodes
for n in Int.(exp10.(0:4))
SUITE["getorcreate! (n individual)", n] = @benchmarkable foreach(
_ -> GraphPPL.getorcreate!(model, ctx, :x, nothing), 1:($n)
) evals = 1 setup = begin
model = GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend())
ctx = GraphPPL.getcontext(model)
end
end

# THIS SUITE benchmarks how long it takes to add vector based bariables of size `n`
for n in Int.(exp10.(0:4))
SUITE["getorcreate! (n vector)", n] = @benchmarkable foreach(
i -> GraphPPL.getorcreate!(model, ctx, :x, i), 1:($n)
) evals = 1 setup = begin
model = GraphPPL.Model(identity, GraphPPL.PluginsCollection(), GraphPPL.DefaultBackend())
ctx = GraphPPL.getcontext(model)
end
end

return SUITE
end
Loading
Loading