diff --git a/docs/_static/css/segment.min.css b/docs/_static/css/segment.min.css deleted file mode 100644 index 61ba350..0000000 --- a/docs/_static/css/segment.min.css +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * # Semantic UI 2.4.1 - Segment - * http://github.com/semantic-org/semantic-ui/ - * - * - * Released under the MIT license - * http://opensource.org/licenses/MIT - * - */.ui.segment{position:relative;background:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15);margin:1rem 0;padding:1em 1em;border-radius:.28571429rem;border:1px solid rgba(34,36,38,.15)}.ui.segment:first-child{margin-top:0}.ui.segment:last-child{margin-bottom:0}.ui.vertical.segment{margin:0;padding-left:0;padding-right:0;background:none transparent;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none;border-bottom:1px solid rgba(34,36,38,.15)}.ui.vertical.segment:last-child{border-bottom:none}.ui.inverted.segment>.ui.header{color:#fff}.ui[class*="bottom attached"].segment>[class*="top attached"].label{border-top-left-radius:0;border-top-right-radius:0}.ui[class*="top attached"].segment>[class*="bottom attached"].label{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui.attached.segment:not(.top):not(.bottom)>[class*="top attached"].label{border-top-left-radius:0;border-top-right-radius:0}.ui.attached.segment:not(.top):not(.bottom)>[class*="bottom attached"].label{border-bottom-left-radius:0;border-bottom-right-radius:0}.ui.grid>.row>.ui.segment.column,.ui.grid>.ui.segment.column,.ui.page.grid.segment{padding-top:2em;padding-bottom:2em}.ui.grid.segment{margin:1rem 0;border-radius:.28571429rem}.ui.basic.table.segment{background:#fff;border:1px solid rgba(34,36,38,.15);-webkit-box-shadow:0 1px 2px 0 rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15)}.ui[class*="very basic"].table.segment{padding:1em 1em}.ui.placeholder.segment{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;max-width:initial;-webkit-animation:none;animation:none;overflow:visible;padding:1em 1em;min-height:18rem;background:#f9fafb;border-color:rgba(34,36,38,.15);-webkit-box-shadow:0 2px 25px 0 rgba(34,36,38,.05) inset;box-shadow:0 2px 25px 0 rgba(34,36,38,.05) inset}.ui.placeholder.segment .button,.ui.placeholder.segment textarea{display:block}.ui.placeholder.segment .button,.ui.placeholder.segment .field,.ui.placeholder.segment textarea,.ui.placeholder.segment>.ui.input{max-width:15rem;margin-left:auto;margin-right:auto}.ui.placeholder.segment .column .button,.ui.placeholder.segment .column .field,.ui.placeholder.segment .column textarea,.ui.placeholder.segment .column>.ui.input{max-width:15rem;margin-left:auto;margin-right:auto}.ui.placeholder.segment>.inline{-ms-flex-item-align:center;align-self:center}.ui.placeholder.segment>.inline>.button{display:inline-block;width:auto;margin:0 .35714286rem 0 0}.ui.placeholder.segment>.inline>.button:last-child{margin-right:0}.ui.piled.segment,.ui.piled.segments{margin:3em 0;-webkit-box-shadow:'';box-shadow:'';z-index:auto}.ui.piled.segment:first-child{margin-top:0}.ui.piled.segment:last-child{margin-bottom:0}.ui.piled.segment:after,.ui.piled.segment:before,.ui.piled.segments:after,.ui.piled.segments:before{background-color:#fff;visibility:visible;content:'';display:block;height:100%;left:0;position:absolute;width:100%;border:1px solid rgba(34,36,38,.15);-webkit-box-shadow:'';box-shadow:''}.ui.piled.segment:before,.ui.piled.segments:before{-webkit-transform:rotate(-1.2deg);transform:rotate(-1.2deg);top:0;z-index:-2}.ui.piled.segment:after,.ui.piled.segments:after{-webkit-transform:rotate(1.2deg);transform:rotate(1.2deg);top:0;z-index:-1}.ui[class*="top attached"].piled.segment{margin-top:3em;margin-bottom:0}.ui.piled.segment[class*="top attached"]:first-child{margin-top:0}.ui.piled.segment[class*="bottom attached"]{margin-top:0;margin-bottom:3em}.ui.piled.segment[class*="bottom attached"]:last-child{margin-bottom:0}.ui.stacked.segment{padding-bottom:1.4em}.ui.stacked.segment:after,.ui.stacked.segment:before,.ui.stacked.segments:after,.ui.stacked.segments:before{content:'';position:absolute;bottom:-3px;left:0;border-top:1px solid rgba(34,36,38,.15);background:rgba(0,0,0,.03);width:100%;height:6px;visibility:visible}.ui.stacked.segment:before,.ui.stacked.segments:before{display:none}.ui.tall.stacked.segment:before,.ui.tall.stacked.segments:before{display:block;bottom:0}.ui.stacked.inverted.segment:after,.ui.stacked.inverted.segment:before,.ui.stacked.inverted.segments:after,.ui.stacked.inverted.segments:before{background-color:rgba(0,0,0,.03);border-top:1px solid rgba(34,36,38,.35)}.ui.padded.segment{padding:1.5em}.ui[class*="very padded"].segment{padding:3em}.ui.padded.segment.vertical.segment,.ui[class*="very padded"].vertical.segment{padding-left:0;padding-right:0}.ui.compact.segment{display:table}.ui.compact.segments{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.ui.compact.segments .segment,.ui.segments .compact.segment{display:block;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.ui.circular.segment{display:table-cell;padding:2em;text-align:center;vertical-align:middle;border-radius:500em}.ui.raised.segment,.ui.raised.segments{-webkit-box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15);box-shadow:0 2px 4px 0 rgba(34,36,38,.12),0 2px 10px 0 rgba(34,36,38,.15)}.ui.segments{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:relative;margin:1rem 0;border:1px solid rgba(34,36,38,.15);-webkit-box-shadow:0 1px 2px 0 rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15);border-radius:.28571429rem}.ui.segments:first-child{margin-top:0}.ui.segments:last-child{margin-bottom:0}.ui.segments>.segment{top:0;bottom:0;border-radius:0;margin:0;width:auto;-webkit-box-shadow:none;box-shadow:none;border:none;border-top:1px solid rgba(34,36,38,.15)}.ui.segments:not(.horizontal)>.segment:first-child{border-top:none;margin-top:0;bottom:0;margin-bottom:0;top:0;border-radius:.28571429rem .28571429rem 0 0}.ui.segments:not(.horizontal)>.segment:last-child{top:0;bottom:0;margin-top:0;margin-bottom:0;-webkit-box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;border-radius:0 0 .28571429rem .28571429rem}.ui.segments:not(.horizontal)>.segment:only-child{border-radius:.28571429rem}.ui.segments>.ui.segments{border-top:1px solid rgba(34,36,38,.15);margin:1rem 1rem}.ui.segments>.segments:first-child{border-top:none}.ui.segments>.segment+.segments:not(.horizontal){margin-top:0}.ui.horizontal.segments{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;background-color:transparent;border-radius:0;padding:0;background-color:#fff;-webkit-box-shadow:0 1px 2px 0 rgba(34,36,38,.15);box-shadow:0 1px 2px 0 rgba(34,36,38,.15);margin:1rem 0;border-radius:.28571429rem;border:1px solid rgba(34,36,38,.15)}.ui.segments>.horizontal.segments{margin:0;background-color:transparent;border-radius:0;border:none;-webkit-box-shadow:none;box-shadow:none;border-top:1px solid rgba(34,36,38,.15)}.ui.horizontal.segments>.segment{-webkit-box-flex:1;flex:1 1 auto;-ms-flex:1 1 0px;margin:0;min-width:0;background-color:transparent;border-radius:0;border:none;-webkit-box-shadow:none;box-shadow:none;border-left:1px solid rgba(34,36,38,.15)}.ui.segments>.horizontal.segments:first-child{border-top:none}.ui.horizontal.segments>.segment:first-child{border-left:none}.ui.disabled.segment{opacity:.45;color:rgba(40,40,40,.3)}.ui.loading.segment{position:relative;cursor:default;pointer-events:none;text-shadow:none!important;color:transparent!important;-webkit-transition:all 0s linear;transition:all 0s linear}.ui.loading.segment:before{position:absolute;content:'';top:0;left:0;background:rgba(255,255,255,.8);width:100%;height:100%;border-radius:.28571429rem;z-index:100}.ui.loading.segment:after{position:absolute;content:'';top:50%;left:50%;margin:-1.5em 0 0 -1.5em;width:3em;height:3em;-webkit-animation:segment-spin .6s linear;animation:segment-spin .6s linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;border-radius:500rem;border-color:#767676 rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.1);border-style:solid;border-width:.2em;-webkit-box-shadow:0 0 0 1px transparent;box-shadow:0 0 0 1px transparent;visibility:visible;z-index:101}@-webkit-keyframes segment-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes segment-spin{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ui.basic.segment{background:none transparent;-webkit-box-shadow:none;box-shadow:none;border:none;border-radius:0}.ui.clearing.segment:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui.red.segment:not(.inverted){border-top:2px solid #db2828!important}.ui.inverted.red.segment{background-color:#db2828!important;color:#fff!important}.ui.orange.segment:not(.inverted){border-top:2px solid #f2711c!important}.ui.inverted.orange.segment{background-color:#f2711c!important;color:#fff!important}.ui.yellow.segment:not(.inverted){border-top:2px solid #fbbd08!important}.ui.inverted.yellow.segment{background-color:#fbbd08!important;color:#fff!important}.ui.olive.segment:not(.inverted){border-top:2px solid #b5cc18!important}.ui.inverted.olive.segment{background-color:#b5cc18!important;color:#fff!important}.ui.green.segment:not(.inverted){border-top:2px solid #21ba45!important}.ui.inverted.green.segment{background-color:#21ba45!important;color:#fff!important}.ui.teal.segment:not(.inverted){border-top:2px solid #00b5ad!important}.ui.inverted.teal.segment{background-color:#00b5ad!important;color:#fff!important}.ui.blue.segment:not(.inverted){border-top:2px solid #2185d0!important}.ui.inverted.blue.segment{background-color:#2185d0!important;color:#fff!important}.ui.violet.segment:not(.inverted){border-top:2px solid #6435c9!important}.ui.inverted.violet.segment{background-color:#6435c9!important;color:#fff!important}.ui.purple.segment:not(.inverted){border-top:2px solid #a333c8!important}.ui.inverted.purple.segment{background-color:#a333c8!important;color:#fff!important}.ui.pink.segment:not(.inverted){border-top:2px solid #e03997!important}.ui.inverted.pink.segment{background-color:#e03997!important;color:#fff!important}.ui.brown.segment:not(.inverted){border-top:2px solid #a5673f!important}.ui.inverted.brown.segment{background-color:#a5673f!important;color:#fff!important}.ui.grey.segment:not(.inverted){border-top:2px solid #767676!important}.ui.inverted.grey.segment{background-color:#767676!important;color:#fff!important}.ui.black.segment:not(.inverted){border-top:2px solid #1b1c1d!important}.ui.inverted.black.segment{background-color:#1b1c1d!important;color:#fff!important}.ui[class*="left aligned"].segment{text-align:left}.ui[class*="right aligned"].segment{text-align:right}.ui[class*="center aligned"].segment{text-align:center}.ui.floated.segment,.ui[class*="left floated"].segment{float:left;margin-right:1em}.ui[class*="right floated"].segment{float:right;margin-left:1em}.ui.inverted.segment{border:none;-webkit-box-shadow:none;box-shadow:none}.ui.inverted.segment,.ui.primary.inverted.segment{background:#1b1c1d;color:rgba(255,255,255,.9)}.ui.inverted.segment .segment{color:rgba(0,0,0,.87)}.ui.inverted.segment .inverted.segment{color:rgba(255,255,255,.9)}.ui.inverted.attached.segment{border-color:#555}.ui.secondary.segment{background:#f3f4f5;color:rgba(0,0,0,.6)}.ui.secondary.inverted.segment{background:#4c4f52 -webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,.2)),to(rgba(255,255,255,.2)));background:#4c4f52 -webkit-linear-gradient(rgba(255,255,255,.2) 0,rgba(255,255,255,.2) 100%);background:#4c4f52 linear-gradient(rgba(255,255,255,.2) 0,rgba(255,255,255,.2) 100%);color:rgba(255,255,255,.8)}.ui.tertiary.segment{background:#dcddde;color:rgba(0,0,0,.6)}.ui.tertiary.inverted.segment{background:#717579 -webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,.35)),to(rgba(255,255,255,.35)));background:#717579 -webkit-linear-gradient(rgba(255,255,255,.35) 0,rgba(255,255,255,.35) 100%);background:#717579 linear-gradient(rgba(255,255,255,.35) 0,rgba(255,255,255,.35) 100%);color:rgba(255,255,255,.8)}.ui.attached.segment{top:0;bottom:0;border-radius:0;margin:0 -1px;width:calc(100% - (-1px * 2));max-width:calc(100% - (-1px * 2));-webkit-box-shadow:none;box-shadow:none;border:1px solid #d4d4d5}.ui.attached:not(.message)+.ui.attached.segment:not(.top){border-top:none}.ui[class*="top attached"].segment{bottom:0;margin-bottom:0;top:0;margin-top:1rem;border-radius:.28571429rem .28571429rem 0 0}.ui.segment[class*="top attached"]:first-child{margin-top:0}.ui.segment[class*="bottom attached"]{bottom:0;margin-top:0;top:0;margin-bottom:1rem;-webkit-box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;box-shadow:0 1px 2px 0 rgba(34,36,38,.15),none;border-radius:0 0 .28571429rem .28571429rem}.ui.segment[class*="bottom attached"]:last-child{margin-bottom:0}.ui.mini.segment,.ui.mini.segments .segment{font-size:.78571429rem}.ui.tiny.segment,.ui.tiny.segments .segment{font-size:.85714286rem}.ui.small.segment,.ui.small.segments .segment{font-size:.92857143rem}.ui.segment,.ui.segments .segment{font-size:1rem}.ui.large.segment,.ui.large.segments .segment{font-size:1.14285714rem}.ui.big.segment,.ui.big.segments .segment{font-size:1.28571429rem}.ui.huge.segment,.ui.huge.segments .segment{font-size:1.42857143rem}.ui.massive.segment,.ui.massive.segments .segment{font-size:1.71428571rem} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index edb0bbd..b993bc2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -142,10 +142,10 @@ html_context = { 'css_files': [ '_static/css/inferpy_theme.css', - '_static/css/tabs.css', -'_static/css/tab.min.css', -'_static/css/segment.min.css', -'_static/css/menu.min.css', +# '_static/css/tabs.css', +#'_static/css/tab.min.css', +#'_static/css/segment.min.css', +#'_static/css/menu.min.css', ], } @@ -165,7 +165,7 @@ # A list of ignored prefixes for module index sorting. -modindex_common_prefix = ['inferpy.'] +#modindex_common_prefix = ['inferpy.'] ## descomentar # -- Options for HTMLHelp output ------------------------------------------ diff --git a/docs/index.rst b/docs/index.rst index 26c7f93..0a263e0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,214 +3,4 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. - - - -InferPy: Deep Probabilistic Modeling with TensorFlow Made Easy -========================================================================= - - -.. image:: _static/img/logo.png - :scale: 90 % - :align: center - -| - - - - - - -InferPy is a high-level API for probabilistic modeling with deep neural networks written in Python and -capable of running on top of TensorFlow. InferPy's API is strongly inspired by Keras and -it has a focus on enabling flexible data processing, easy-to-code probabilistic modeling, scalable inference, and robust model validation. - -Use InferPy if you need a probabilistic programming language that: - -* Allows easy and fast prototyping of hierarchical probabilistic models with a simple and user-friendly API inspired by Keras. -* Automatically creates computational efficient batch models without the need to deal with complex tensor operations and theoretical concepts. -* Run seamlessly on CPU and GPU by relying on TensorFlow, without having to learn how to use TensorFlow. -* Defines probabilistic models with complex probabilistic constructs containing deep neural networks. - -.. * Process seamlessly small data sets stored on a Panda's data-frame, or large distributed data sets by relying on Apache Spark. - -.. InferPy is to Edward what Keras is to TensorFlow -.. ------------------------------------------------- -.. InferPy's aim is to be to Edward what Keras is to TensorFlow. Edward is a general purpose -.. probabilistic programing language, like TensorFlow is a general computational engine. -.. But this generality comes a at price. Edward's API is -.. verbose and is based on distributions over Tensor objects, which are n-dimensional arrays with -.. complex semantics operations. Probability distributions over Tensors are powerful abstractions -.. but it is not easy to operate with them. InferPy's API is no so general like Edward's API -.. but still covers a wide range of powerful and widely used probabilistic models, which can contain -.. complex probability constructs. - - - - -Related software ------------------------- - -Similar frameworks for deep probabilistic modeling are: - -- `Edward `_ -- `TFP/Edward 2 `_ -- `Pyro `_ -- `Stan `_ -- `Pymc `_ - -The advantage of InferPy resides on its simplicity. A comparison with respect to TFP/Edward 2 and Pyro is provided -for a `logistic regression `_ and for a `variational auto-encoder (VAE) `_ using -the MNIST dataset. - - -Code examples ----------------- - -A set of examples of models defined with InferPy can be found in the `Probabilistic Model Zoo `_ section. -Additionally, more complex examples are provided: `model with Bayesian NN `_ and a -`mixture density network `_. - - - -Citation ------------- - -There are several articles to cite for InferPy. The following one correspond to versions 1.x and describes -the use of InferPy for probabilistic modelling with neural networks. This InferPy version relies on TensorFlow -Probability (TFP) and Edward2. - -.. code:: TeX - - @Article{cozar2019inferpy, - author = {C{\'o}zar, Javier and Caba{\~n}as, Rafael and Salmer{\'o}n, Antonio and Masegosa, Andr{\'e}s R}, - title = {InferPy: Probabilistic Modeling with Deep Neural Networks Made Easy}, - journal = {arXiv preprint arXiv:1908.11161}, - year = {2019}, - } - - -On the other hand, the article whose reference is shown below corresponds to the API in verions 0.x which relies -on the first version of Edward, which is no longer under development: - - -.. code:: TeX - - @article{cabanasInferPy, - Author = {Caba{\~n}as, Rafael and Salmer{\'o}n, Antonio and Masegosa, Andr{\'e}s R}, - Journal = {Knowledge-Based Systems}, - Publisher = {Elsevier}, - Title = {InferPy: Probabilistic Modeling with TensorFlow Made Easy}, - Year = {2019} - } - - -.. .. toctree:: -.. :hidden: - -.. Home - - -.. toctree:: - :includehidden: - :maxdepth: 1 - :caption: Quick Start - - notes/getting30s - notes/gettingGuiding - notes/requirements - notes/installation - - -.. toctree:: - :includehidden: - :maxdepth: 1 - :caption: Inferpy vs Others - - notes/comparative_logreg - notes/comparative_vae_mnist - - -.. toctree:: - :includehidden: - :maxdepth: 1 - :caption: Guides - - notes/guidemodels - notes/guideinference - notes/guidebayesian - notes/guidedata - notes/advancedsetup - notes/videotutorials - -.. notes/guidevalidation - - - - -.. toctree:: - :includehidden: - :maxdepth: 1 - :caption: Examples - - notes/probzoo - notes/bayesianNN - notes/mixture - - - - -.. toctree:: - :maxdepth: 1 - :caption: Package Reference - - modules/inferpy - modules/inferpy.contextmanager - modules/inferpy.data - modules/inferpy.inference - modules/inferpy.layers - modules/inferpy.models - modules/inferpy.queries - modules/inferpy.util - - - -.. toctree:: - :includehidden: - :maxdepth: 1 - :caption: Other - - notes/contact - notes/acknowledgements - - - -.. Indices and tables - ================== - - * :ref:`genindex` - * :ref:`modindex` - * :ref:`search` - - - - -.. role:: bash(code) - :language: bash -.. role:: python(code) - :language: python3 - - - - - - -.. image:: https://travis-ci.org/PGM-Lab/InferPy.svg?branch=master - :target: https://travis-ci.org/PGM-Lab/InferPy - -.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg - :target: https://opensource.org/licenses/Apache-2.0 - - - - +Inferpy \ No newline at end of file diff --git a/docs/index.rst_old b/docs/index.rst_old new file mode 100644 index 0000000..26c7f93 --- /dev/null +++ b/docs/index.rst_old @@ -0,0 +1,216 @@ +.. InferPy documentation master file, created by + sphinx-quickstart on Fri Nov 3 12:26:21 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + + + + +InferPy: Deep Probabilistic Modeling with TensorFlow Made Easy +========================================================================= + + +.. image:: _static/img/logo.png + :scale: 90 % + :align: center + +| + + + + + + +InferPy is a high-level API for probabilistic modeling with deep neural networks written in Python and +capable of running on top of TensorFlow. InferPy's API is strongly inspired by Keras and +it has a focus on enabling flexible data processing, easy-to-code probabilistic modeling, scalable inference, and robust model validation. + +Use InferPy if you need a probabilistic programming language that: + +* Allows easy and fast prototyping of hierarchical probabilistic models with a simple and user-friendly API inspired by Keras. +* Automatically creates computational efficient batch models without the need to deal with complex tensor operations and theoretical concepts. +* Run seamlessly on CPU and GPU by relying on TensorFlow, without having to learn how to use TensorFlow. +* Defines probabilistic models with complex probabilistic constructs containing deep neural networks. + +.. * Process seamlessly small data sets stored on a Panda's data-frame, or large distributed data sets by relying on Apache Spark. + +.. InferPy is to Edward what Keras is to TensorFlow +.. ------------------------------------------------- +.. InferPy's aim is to be to Edward what Keras is to TensorFlow. Edward is a general purpose +.. probabilistic programing language, like TensorFlow is a general computational engine. +.. But this generality comes a at price. Edward's API is +.. verbose and is based on distributions over Tensor objects, which are n-dimensional arrays with +.. complex semantics operations. Probability distributions over Tensors are powerful abstractions +.. but it is not easy to operate with them. InferPy's API is no so general like Edward's API +.. but still covers a wide range of powerful and widely used probabilistic models, which can contain +.. complex probability constructs. + + + + +Related software +------------------------ + +Similar frameworks for deep probabilistic modeling are: + +- `Edward `_ +- `TFP/Edward 2 `_ +- `Pyro `_ +- `Stan `_ +- `Pymc `_ + +The advantage of InferPy resides on its simplicity. A comparison with respect to TFP/Edward 2 and Pyro is provided +for a `logistic regression `_ and for a `variational auto-encoder (VAE) `_ using +the MNIST dataset. + + +Code examples +---------------- + +A set of examples of models defined with InferPy can be found in the `Probabilistic Model Zoo `_ section. +Additionally, more complex examples are provided: `model with Bayesian NN `_ and a +`mixture density network `_. + + + +Citation +------------ + +There are several articles to cite for InferPy. The following one correspond to versions 1.x and describes +the use of InferPy for probabilistic modelling with neural networks. This InferPy version relies on TensorFlow +Probability (TFP) and Edward2. + +.. code:: TeX + + @Article{cozar2019inferpy, + author = {C{\'o}zar, Javier and Caba{\~n}as, Rafael and Salmer{\'o}n, Antonio and Masegosa, Andr{\'e}s R}, + title = {InferPy: Probabilistic Modeling with Deep Neural Networks Made Easy}, + journal = {arXiv preprint arXiv:1908.11161}, + year = {2019}, + } + + +On the other hand, the article whose reference is shown below corresponds to the API in verions 0.x which relies +on the first version of Edward, which is no longer under development: + + +.. code:: TeX + + @article{cabanasInferPy, + Author = {Caba{\~n}as, Rafael and Salmer{\'o}n, Antonio and Masegosa, Andr{\'e}s R}, + Journal = {Knowledge-Based Systems}, + Publisher = {Elsevier}, + Title = {InferPy: Probabilistic Modeling with TensorFlow Made Easy}, + Year = {2019} + } + + +.. .. toctree:: +.. :hidden: + +.. Home + + +.. toctree:: + :includehidden: + :maxdepth: 1 + :caption: Quick Start + + notes/getting30s + notes/gettingGuiding + notes/requirements + notes/installation + + +.. toctree:: + :includehidden: + :maxdepth: 1 + :caption: Inferpy vs Others + + notes/comparative_logreg + notes/comparative_vae_mnist + + +.. toctree:: + :includehidden: + :maxdepth: 1 + :caption: Guides + + notes/guidemodels + notes/guideinference + notes/guidebayesian + notes/guidedata + notes/advancedsetup + notes/videotutorials + +.. notes/guidevalidation + + + + +.. toctree:: + :includehidden: + :maxdepth: 1 + :caption: Examples + + notes/probzoo + notes/bayesianNN + notes/mixture + + + + +.. toctree:: + :maxdepth: 1 + :caption: Package Reference + + modules/inferpy + modules/inferpy.contextmanager + modules/inferpy.data + modules/inferpy.inference + modules/inferpy.layers + modules/inferpy.models + modules/inferpy.queries + modules/inferpy.util + + + +.. toctree:: + :includehidden: + :maxdepth: 1 + :caption: Other + + notes/contact + notes/acknowledgements + + + +.. Indices and tables + ================== + + * :ref:`genindex` + * :ref:`modindex` + * :ref:`search` + + + + +.. role:: bash(code) + :language: bash +.. role:: python(code) + :language: python3 + + + + + + +.. image:: https://travis-ci.org/PGM-Lab/InferPy.svg?branch=master + :target: https://travis-ci.org/PGM-Lab/InferPy + +.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg + :target: https://opensource.org/licenses/Apache-2.0 + + + + diff --git a/docs/modules/inferpy.contextmanager.rst b/docs/modules/inferpy.contextmanager.rst index dc947b4..a6c4045 100644 --- a/docs/modules/inferpy.contextmanager.rst +++ b/docs/modules/inferpy.contextmanager.rst @@ -36,7 +36,6 @@ inferpy.contextmanager.randvar\_registry module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.data.rst b/docs/modules/inferpy.data.rst index 919ea86..59b9b09 100644 --- a/docs/modules/inferpy.data.rst +++ b/docs/modules/inferpy.data.rst @@ -20,7 +20,6 @@ inferpy.data.mnist module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.inference.rst b/docs/modules/inferpy.inference.rst index 4aa27a1..9c5de01 100644 --- a/docs/modules/inferpy.inference.rst +++ b/docs/modules/inferpy.inference.rst @@ -5,6 +5,7 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 inferpy.inference.variational @@ -27,7 +28,6 @@ inferpy.inference.mcmc module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.inference.variational.loss_functions.rst b/docs/modules/inferpy.inference.variational.loss_functions.rst index b8c0a9a..53a8ae2 100644 --- a/docs/modules/inferpy.inference.variational.loss_functions.rst +++ b/docs/modules/inferpy.inference.variational.loss_functions.rst @@ -12,7 +12,6 @@ inferpy.inference.variational.loss\_functions.elbo module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.inference.variational.rst b/docs/modules/inferpy.inference.variational.rst index 13fde22..1b9476d 100644 --- a/docs/modules/inferpy.inference.variational.rst +++ b/docs/modules/inferpy.inference.variational.rst @@ -5,6 +5,7 @@ Subpackages ----------- .. toctree:: + :maxdepth: 4 inferpy.inference.variational.loss_functions @@ -27,7 +28,6 @@ inferpy.inference.variational.vi module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.layers.rst b/docs/modules/inferpy.layers.rst index 972ecd1..dbace9e 100644 --- a/docs/modules/inferpy.layers.rst +++ b/docs/modules/inferpy.layers.rst @@ -12,7 +12,6 @@ inferpy.layers.sequential module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.models.rst b/docs/modules/inferpy.models.rst index 5581cff..735e815 100644 --- a/docs/modules/inferpy.models.rst +++ b/docs/modules/inferpy.models.rst @@ -28,7 +28,6 @@ inferpy.models.random\_variable module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.queries.rst b/docs/modules/inferpy.queries.rst index 9fbcdf3..041a5a3 100644 --- a/docs/modules/inferpy.queries.rst +++ b/docs/modules/inferpy.queries.rst @@ -12,7 +12,6 @@ inferpy.queries.query module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/modules/inferpy.rst b/docs/modules/inferpy.rst index 131ef16..a05223e 100644 --- a/docs/modules/inferpy.rst +++ b/docs/modules/inferpy.rst @@ -1,23 +1,3 @@ inferpy package =============== -Subpackages ------------ - -.. toctree:: - - inferpy.contextmanager - inferpy.data - inferpy.inference - inferpy.layers - inferpy.models - inferpy.queries - inferpy.util - -Module contents ---------------- - -.. automodule:: inferpy - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/modules/inferpy.rst_old b/docs/modules/inferpy.rst_old new file mode 100644 index 0000000..447b67f --- /dev/null +++ b/docs/modules/inferpy.rst_old @@ -0,0 +1,24 @@ +inferpy package +=============== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + inferpy.contextmanager + inferpy.data + inferpy.inference + inferpy.layers + inferpy.models + inferpy.queries + inferpy.util + +Module contents +--------------- + +.. automodule:: inferpy + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/modules/inferpy.util.rst b/docs/modules/inferpy.util.rst index 920c84c..5c56ea7 100644 --- a/docs/modules/inferpy.util.rst +++ b/docs/modules/inferpy.util.rst @@ -68,7 +68,6 @@ inferpy.util.tf\_graph module :undoc-members: :show-inheritance: - Module contents --------------- diff --git a/docs/notes/getting30s.rst b/docs/notes/getting30s.rst index 506440c..8df04c1 100644 --- a/docs/notes/getting30s.rst +++ b/docs/notes/getting30s.rst @@ -1,103 +1,2 @@ Getting Started ================ - -Installation ------------------ - -Install InferPy from PyPI: - -.. code:: bash - - $ python -m pip install inferpy - - -For further details, check the `Installation `_ section. - - - -30 seconds to InferPy --------------------------- - -The core data structure of InferPy is a **probabilistic model**, -defined as a set of **random variables** with a conditional independence -structure. A **random variable** is an object -parameterized by a set of tensors. - -Let's look at a simple non-linear **probabilistic component analysis** model (NLPCA). Graphically the model can -be defined as follows, - -.. figure:: ../_static/img/nlpca.png - :alt: Non-linear PCA - :scale: 60 % - :align: center - - Non-linear PCA - -We start by importing the required packages and defining the constant parameters in the model. - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 1-11 - -A model can be defined by decorating any function with ``@inf.probmodel``. The model is fully specified by -the variables defined inside this function: - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 14-22 - - -The construct ``with inf.datamodel()``, which resembles the **plateau notation**, will replicate -N times the variables enclosed, where N is the data size. - - -In the previous model, the input argument ``decoder`` must be a function implementing a neural network. -This can be defined outside the model as follows. - - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 27-30 - - -Now, we can instantiate our model and obtain samples (from the prior distributions). - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 48-52 - - - - -In variational inference, we need to define a Q-model as follows. - - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 36-42 - - - -Afterwards, we define the parameters of the inference algorithm and fit the model to the data. - - - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 62-66 - - -The inference method can be further configured. But, as in Keras, a core -principle is to try to make things reasonably simple, while allowing the -user the full control if needed. - - - -Finally, we might extract the posterior of ``z``, which is basically the hidden representation -of the data. - - - -.. literalinclude:: ../../examples/docs/getting30s/1.py - :language: python3 - :lines: 71-73 diff --git a/docs/notes/getting30s.rst_old b/docs/notes/getting30s.rst_old new file mode 100644 index 0000000..506440c --- /dev/null +++ b/docs/notes/getting30s.rst_old @@ -0,0 +1,103 @@ +Getting Started +================ + +Installation +----------------- + +Install InferPy from PyPI: + +.. code:: bash + + $ python -m pip install inferpy + + +For further details, check the `Installation `_ section. + + + +30 seconds to InferPy +-------------------------- + +The core data structure of InferPy is a **probabilistic model**, +defined as a set of **random variables** with a conditional independence +structure. A **random variable** is an object +parameterized by a set of tensors. + +Let's look at a simple non-linear **probabilistic component analysis** model (NLPCA). Graphically the model can +be defined as follows, + +.. figure:: ../_static/img/nlpca.png + :alt: Non-linear PCA + :scale: 60 % + :align: center + + Non-linear PCA + +We start by importing the required packages and defining the constant parameters in the model. + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 1-11 + +A model can be defined by decorating any function with ``@inf.probmodel``. The model is fully specified by +the variables defined inside this function: + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 14-22 + + +The construct ``with inf.datamodel()``, which resembles the **plateau notation**, will replicate +N times the variables enclosed, where N is the data size. + + +In the previous model, the input argument ``decoder`` must be a function implementing a neural network. +This can be defined outside the model as follows. + + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 27-30 + + +Now, we can instantiate our model and obtain samples (from the prior distributions). + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 48-52 + + + + +In variational inference, we need to define a Q-model as follows. + + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 36-42 + + + +Afterwards, we define the parameters of the inference algorithm and fit the model to the data. + + + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 62-66 + + +The inference method can be further configured. But, as in Keras, a core +principle is to try to make things reasonably simple, while allowing the +user the full control if needed. + + + +Finally, we might extract the posterior of ``z``, which is basically the hidden representation +of the data. + + + +.. literalinclude:: ../../examples/docs/getting30s/1.py + :language: python3 + :lines: 71-73