From 53879b6f9646b42323a5d7977f785cb281d467aa Mon Sep 17 00:00:00 2001 From: Q_D <56118785+Quinten-D@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:01:41 +0200 Subject: [PATCH 1/7] add documentation source files --- .DS_Store | Bin 0 -> 6148 bytes src/.DS_Store | Bin 0 -> 6148 bytes src/docs/.DS_Store | Bin 0 -> 6148 bytes src/docs/Makefile | 20 +++++++ src/docs/make.bat | 35 ++++++++++++ src/docs/source/.DS_Store | Bin 0 -> 6148 bytes src/docs/source/api.rst | 79 +++++++++++++++++++++++++++ src/docs/source/conf.py | 55 +++++++++++++++++++ src/docs/source/index.rst | 32 +++++++++++ src/docs/source/install.rst | 56 +++++++++++++++++++ src/docs/source/neural_predicate.rst | 4 ++ src/docs/source/problog.rst | 4 ++ 12 files changed, 285 insertions(+) create mode 100644 .DS_Store create mode 100644 src/.DS_Store create mode 100644 src/docs/.DS_Store create mode 100644 src/docs/Makefile create mode 100644 src/docs/make.bat create mode 100644 src/docs/source/.DS_Store create mode 100644 src/docs/source/api.rst create mode 100644 src/docs/source/conf.py create mode 100644 src/docs/source/index.rst create mode 100644 src/docs/source/install.rst create mode 100644 src/docs/source/neural_predicate.rst create mode 100644 src/docs/source/problog.rst diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5172429f264de2441865cb4700216d4256da9242 GIT binary patch literal 6148 zcmeH~J!%6%427R!7lt%jx}3%b$PET#pTHLgIFQEJ;E>dF^gR7ES*H$5cmnB-G%I%Z zD|S`@Z2$T80!#olbXV*=%*>dt@PRwdU#I)^a=X5>;#J@&VrHyNnC;iLL0pQvfVyTmjO&;ssLc!1UOG})p;=82 zR;?Ceh}WZ?+UmMqI#RP8R>OzYoz15hnq@nzF`-!xQ4j$Um=RcIKKc27r2jVm&svm< zfC&6E0=7P!4tu^-ovjbA=k?dB`g+i*aXG_}p8zI)6mRKa+;6_1_R^8c3Qa!(fk8n8 H{*=HsM+*^= literal 0 HcmV?d00001 diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a4034ac6528253061b7dc7f7509846dfcc58cd3a GIT binary patch literal 6148 zcmeHKyH3ME5Zom$BBe=5dB4CPoTBgr`2my|rLl5RBBt++&Wn>0c-{UAJX|k08{&%q2h4k`_>xk=Czkl7F z4nsTaV|VG0)nq5<{=6Hutqpd-HTWgj)(9#<1*iZOpaN9j8wJp_4f91XJr$q=RN$(B zeIE+UxF(Om{^@}85dhpF?7+Rx65wJ1a7`YA5dkzx!BMI?VrY~jUNWyHkHJwcn!|_Y z$(j?2`svuec)Dl}rl$f_;IjfYdjm`B|BtXA=6}l}r~noCrwVAd-mF)6x$Lcz*R)<+ uU{A1jAlK93ycL7J730BL@%@LqV)t0D$z!mWBktv3{s@>Z1QqxT1>OKvJ0D*F literal 0 HcmV?d00001 diff --git a/src/docs/.DS_Store b/src/docs/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4b883465d384fa3ca53c7d3deb3e2c215ca8ef7b GIT binary patch literal 6148 zcmeH~L2AQ53`M`%v;?}zvdg(bZ(u@tf?S{^E~Q{%NJ!S+_1gW?sNi6dWf#d8XuhM7 zX7F2B5dd2r+c#hVU`}_%k1td6efNnyWaN=*aYlPu?{{6l`2JUFtESSW{K22#CNr0iV5T3-AB$^b7O9=g34r1a6do%~tExk}sFNb@H0tYYY8@ r{%6dMbS}|~snLr0!&~v|D6jZ4_nXwAYLqh`NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/src/docs/source/.DS_Store b/src/docs/source/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cbbdce77ef65f54c141d724d46ead0156118ede4 GIT binary patch literal 6148 zcmeH~O-{ow5QU$i5*2K^Wa%q#1FI@0-~jxzT_6PoDd|2tuFabtDykHgEYKTi{NnM9 zt$d4244|wJyE|Y7U`aQ{hYfSHb@Q2BWW==i9wT0{-3{CBrJrS=4_NIL9x-6VGyPcK zcia-!TpF>*8{W}*!X85$(0Au|R8#~+KmOMUnzU*?B%T2R{9hD q%b4rw9K01%y%lp}t@!p^UbSbgx6~=r%Nh4_s(u8Fi%bOmg1{$9oE%dC literal 0 HcmV?d00001 diff --git a/src/docs/source/api.rst b/src/docs/source/api.rst new file mode 100644 index 00000000..e4c74163 --- /dev/null +++ b/src/docs/source/api.rst @@ -0,0 +1,79 @@ +API Documentation +================= + +embeddings +---------- +.. automodule:: deepproblog.embeddings + :members: + :show-inheritance: + +tensor +------ +.. automodule:: deepproblog.tensor + :members: + :show-inheritance: + +query +----- +.. automodule:: deepproblog.query + :members: + :show-inheritance: + +dataset +------- +.. automodule:: deepproblog.dataset + :members: + :show-inheritance: + + +network +------- +.. automodule:: deepproblog.network + :members: + :show-inheritance: + +optimizer +--------- +.. automodule:: deepproblog.optimizer + :members: + :show-inheritance: + +model +----- +.. autoclass:: deepproblog.model.Model + :members: + +train +----- +.. automodule:: deepproblog.train + :members: + :show-inheritance: + +evaluate +-------- +.. automodule:: deepproblog.evaluate + :members: + :show-inheritance: + +solver +------- +.. automodule:: deepproblog.solver + :members: + :show-inheritance: + +engine +------ +.. automodule:: deepproblog.engines.engine + :members: + :show-inheritance: + +semiring +-------- +.. automodule:: deepproblog.semiring + :members: + :show-inheritance: + +arithmetic circuit +------------------ +.. autoclass:: deepproblog.arithmetic_circuit.ArithmeticCircuit + :members: diff --git a/src/docs/source/conf.py b/src/docs/source/conf.py new file mode 100644 index 00000000..9a6d6861 --- /dev/null +++ b/src/docs/source/conf.py @@ -0,0 +1,55 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. +#import pathlib +#import sys +#sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix()) + +import sys +import os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# sys.path.insert(0, os.path.abspath('.')) + +sys.path.insert(0, os.path.abspath("../../")) + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'DeepProbLog' +copyright = '2023, KU Leuven, DTAI Research Group' +author = 'KU Leuven, DTAI Research Group' +#release = '1.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx.ext.todo", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.graphviz", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", + "sphinx.ext.inheritance_diagram", +] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = 'furo' +html_static_path = ['_static'] diff --git a/src/docs/source/index.rst b/src/docs/source/index.rst new file mode 100644 index 00000000..908c3e88 --- /dev/null +++ b/src/docs/source/index.rst @@ -0,0 +1,32 @@ +.. DeepProbLog documentation master file, created by + sphinx-quickstart on Tue Aug 8 11:25:48 2023. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +DeepProbLog +======================================= +Welcome to DeepProbLog's documentation. + +DeepProbLog is an extension of ProbLog that integrates Probabilistic Logic Programming with deep learning by introducing the neural predicate. The neural predicate represents probabilistic facts whose probabilites are parameterized by neural networks. + +.. raw:: html + +
+ +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + install + problog + neural_predicate + api + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/src/docs/source/install.rst b/src/docs/source/install.rst new file mode 100644 index 00000000..b3f6b402 --- /dev/null +++ b/src/docs/source/install.rst @@ -0,0 +1,56 @@ +Installing DeepProbLog +====================== + +Installation +------------ +DeepProbLog can easily be installed using the following command: +Make sure the following packages are installed: + +.. code-block:: bash + + pip install deepproblog + +Test +---- +To make sure your installation works, install pytest + +.. code-block:: bash + + pip install pytest + +and run + +.. code-block:: bash + + python -m deepproblog test + + +Requirements +------------ + +DeepProbLog has the following requirements: + +* Python > 3.9 +* [ProbLog](https://dtai.cs.kuleuven.be/problog/) +* [PySDD](https://pysdd.readthedocs.io/en/latest/) +* [PyTorch](https://pytorch.org/) +* [TorchVision](https://pytorch.org/vision/stable/index.html) + +Approximate Inference +--------------------- +To use Approximate Inference, we have the followign additional requirements + +* [PySwip](https://github.com/ML-KULeuven/pyswip) + +.. code-block:: + + pip install git+https://github.com/ML-KULeuven/pyswip + +* [SWI-Prolog < 9.0.0](https://www.swi-prolog.org/) + +The latter can be installed on Ubuntu with the following commands: + +.. code-block:: bash + + sudo apt-add-repository ppa:swi-prolog/stable + sudo apt install swi-prolog=8.4* swi-prolog-nox=8.4* swi-prolog-x=8.4* diff --git a/src/docs/source/neural_predicate.rst b/src/docs/source/neural_predicate.rst new file mode 100644 index 00000000..f831c18e --- /dev/null +++ b/src/docs/source/neural_predicate.rst @@ -0,0 +1,4 @@ +DeepProbLog and the Neural Predicate +==================================== + +Information about the neural predicate is available `here `_. diff --git a/src/docs/source/problog.rst b/src/docs/source/problog.rst new file mode 100644 index 00000000..6636e2ed --- /dev/null +++ b/src/docs/source/problog.rst @@ -0,0 +1,4 @@ +ProbLog +======= + +ProbLog documentation and tutorials are available `here `_. From b9ec79b06ecb4a5557df37af30212455b819d119 Mon Sep 17 00:00:00 2001 From: Q_D <56118785+Quinten-D@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:33:14 +0200 Subject: [PATCH 2/7] Update .DS_Store --- src/docs/.DS_Store | Bin 6148 -> 6148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/docs/.DS_Store b/src/docs/.DS_Store index 4b883465d384fa3ca53c7d3deb3e2c215ca8ef7b..56241dce29d38c0124c3b358f2b1f8dff2460632 100644 GIT binary patch delta 76 zcmZoMXfc=|&e%4wP;8=}q9_vs0|O%ig8&0VGDB)gadJ*letyoxhw76JL|8VijANhp gL25HQhX4m-+s23AnJ4p$=&}NpGaT4#D{`0_04vND{{R30 delta 94 zcmZoMXfc=|&e%S&P;8=}qA)W90|O%ig8&0VN?CAGUQT{q`ox2p(jZ}0h9rhkhD?SW mgcL~e#-2p>&FmZk9E|N74}NE!%rBzL$gtT_ Date: Thu, 31 Aug 2023 12:42:57 +0200 Subject: [PATCH 3/7] ignore DS_Store --- .DS_Store | Bin 6148 -> 6148 bytes src/.gitignore | 2 ++ src/docs/source/.DS_Store | Bin 6148 -> 6148 bytes 3 files changed, 2 insertions(+) diff --git a/.DS_Store b/.DS_Store index 5172429f264de2441865cb4700216d4256da9242..ec23fe7b3c44f75245051607e2c168d6ef2a6cb2 100644 GIT binary patch delta 118 zcmZoMXfc=|&e%4wP>hv>fq{WzVxfpI6OaJ{AexbZL4ctwcw&U1D2U6#kiwA3P|Q$L z7F?8B`mu~2NHo+2a5!~pAw4;p}UkDL@cLp(zcq3 zGcYhrT&AkX1(YpeNM*=nC}79|t4U=jMpDDL@nS98W_AvK4xsTHFMem9%r9cd!3fmd M0K}U;MD{QP08b7ecK`qY delta 69 zcmZoMXfc=|#>CJ*u~2NHo+2aD!~pBb1|lqz`5C1rdoU_)p2}FnHhBT#sm<&h{2V}a Zn Date: Thu, 31 Aug 2023 12:45:14 +0200 Subject: [PATCH 4/7] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index ec23fe7b3c44f75245051607e2c168d6ef2a6cb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyJ`bL43y$43~5}Z++Xk?EXMf)|3Dyy5C}FnkNT>7mp?5tk_g!6KpHn@1k&uz zNxR$>r<0la>T|m^TbS7#PPA`^sqr~|Vt2(5oo9S)4!gJg?j`q={7VFD2iw}Kz1zoG z{S4f}p3m4zr-+jRQa}nw0VyB_{;L3bHf?^Ns3--bfE4&ufZvA(C-%ZIF+Lp#F#-Sw z&|z4|ECFmJfW2@`1OxLd1!k$&h~ZfdzExf?922wLJZ{E0b+gxm;&D6p7U||aQBev= zfl~!$xm~dTKf?c*|4)mwlLAuUrWEjDy;-mDO4VB@FUMZn;7@So9N{#qqXZ$^F)-RO gHf+Zak(7CjYdr6TV`7wpk8+@X2B?cn3S3)(ACM*(p#T5? From f677d997757af2e87ec4ebd3e7400778cab1d333 Mon Sep 17 00:00:00 2001 From: Quinten Dewulf <56118785+Quinten-D@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:46:52 +0200 Subject: [PATCH 5/7] Delete src/.DS_Store --- src/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/.DS_Store diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100644 index a4034ac6528253061b7dc7f7509846dfcc58cd3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyH3ME5Zom$BBe=5dB4CPoTBgr`2my|rLl5RBBt++&Wn>0c-{UAJX|k08{&%q2h4k`_>xk=Czkl7F z4nsTaV|VG0)nq5<{=6Hutqpd-HTWgj)(9#<1*iZOpaN9j8wJp_4f91XJr$q=RN$(B zeIE+UxF(Om{^@}85dhpF?7+Rx65wJ1a7`YA5dkzx!BMI?VrY~jUNWyHkHJwcn!|_Y z$(j?2`svuec)Dl}rl$f_;IjfYdjm`B|BtXA=6}l}r~noCrwVAd-mF)6x$Lcz*R)<+ uU{A1jAlK93ycL7J730BL@%@LqV)t0D$z!mWBktv3{s@>Z1QqxT1>OKvJ0D*F From 9992c6e6fd6eed5f9313be45f20d8102987eb97b Mon Sep 17 00:00:00 2001 From: Quinten Dewulf <56118785+Quinten-D@users.noreply.github.com> Date: Thu, 31 Aug 2023 12:48:32 +0200 Subject: [PATCH 6/7] Delete src/docs/.DS_Store --- src/docs/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/docs/.DS_Store diff --git a/src/docs/.DS_Store b/src/docs/.DS_Store deleted file mode 100644 index 56241dce29d38c0124c3b358f2b1f8dff2460632..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKONs(95UrXK5!|?(Wv<{2f;cDe0^$cZjSY&k?v>}7qxtH?Ku;^K+{i1ayrfbu zA#c&uB_g`G?B*gf5t+aZF-wzmfEN5xuA}9IB z?`{07PRFJ_9^$h5r!h(er~nn90#twsJW~KQ+iWrou`L z@D>0#Lf8#+?GNs1tJ2|paO%c* Date: Thu, 31 Aug 2023 12:48:55 +0200 Subject: [PATCH 7/7] Delete src/docs/source/.DS_Store --- src/docs/source/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/docs/source/.DS_Store diff --git a/src/docs/source/.DS_Store b/src/docs/source/.DS_Store deleted file mode 100644 index 2442e6e64497694e4e60a9b419ac105a9564d6b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%TB{E5S)cdRB-8$qkn-vh^q1h{Qw?qg^)snXyBYrXU4l!O3ArGXjfW~?R_{N zDYh4YEkCz+zyiRWDl~N_MAMU|i*TM1t>)DnGH^ZybcIpo zH;&mR1Ia)#aAZK|L!kCgig_r}LoG@S^Kj0W z@M{7GM-PWZ@nNy@Pw`@Pb>=VC9o9Hzn+zlaV+JmLxX}H7&tGP;$RCH~C>clw{uu){ zTdh}1ZYu89U)$4NTd0pziTnn2DD00O0UYQYxvfUG7xn4a1P+eMqWKz5%!fcFB%5U5 H3=Dh&^GhkT