Skip to content

Commit

Permalink
Updated for 0.2.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbonesana committed Aug 27, 2021
1 parent 30efdec commit 56327b1
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 102 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- New ApproxLP0 algorithm ( #83 )
- Renamed `approxlp` package to `approxpl1` ( #84 )
- Added new `VertexToRandomBayesian` converter ( #84 )

Extra:
- Replaced CI/CD pipeline with GitHub actions ( #84 )
- Added CITATION.cff and CITATION.bib files

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Add the following code in the pom.xml of your project:
<dependency>
<groupId>ch.idsia</groupId>
<artifactId>crema</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 3 additions & 0 deletions docs/notes/bayesianinference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ the model. This will return the posterior of a variable considered the root of t
.. literalinclude:: ../../examples/BeliefPropagation.java
:language: java
:lines: 42-44
:dedent: 2


To perform an inference on a variable, as an example if you want the marginal of ``P(A)``, use the ``query()`` method as
Expand All @@ -23,6 +24,7 @@ in the example below:
.. literalinclude:: ../../examples/BeliefPropagation.java
:language: java
:lines: 55-60
:dedent: 2


If you want to use evidence, you need to create first a ``TIntIntHashMap`` that will include the state of the various
Expand All @@ -31,6 +33,7 @@ variables, in the belo case we query for ``P(A | B=0)``:
.. literalinclude:: ../../examples/BeliefPropagation.java
:language: java
:lines: 62-69
:dedent: 2


Full example:
Expand Down
17 changes: 4 additions & 13 deletions docs/notes/contact.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
Contact and Support
======================


.. image:: ../_static/img/idsia.png
.. image:: _static/img/idsia.png
:scale: 60 %
:align: center
:target: http://www.idsia.ch

:target: https://www.idsia.ch/

Crema has been developed at the Swiss AI Lab IDSIA (Istituto Dalle Molle di Studi sull'Intelligenza Artificiale),
a not-for-profit research institute for Artificial Intelligence.

Crema has been developed at the Swiss AI Lab IDSIA (Istituto Dalle Molle di Studi sull'Intelligenza Artificiale).
The members of the development and research team are:


- David Huber ([email protected])

- Rafael Cabañas ([email protected])

- Alessandro Antonucci ([email protected])

- Marco Zaffalon ([email protected])

- Claudio Bonesana ([email protected])


If you have any question, please use `Github issues <https://github.com/IDSIA/crema/issues>`_.


8 changes: 2 additions & 6 deletions docs/notes/guideinference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ run the query. The result is an object of class VertexFactor.

.. literalinclude:: ../../examples/docs/inferEx1.java
:language: java
:lines: 34-39
:lines: 39-42


Approximate inference can be done by means of linear programming. For this, create
the an object of class ``CredalApproxLP`` and then run the query. Note
that the output is an ``IntervalFactor``.



.. literalinclude:: ../../examples/docs/inferEx2.java
:language: java
:lines: 48-54


:lines: 52-58
2 changes: 1 addition & 1 deletion docs/notes/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Crema can be easily included at any maven project. For this, add the following c
<dependency>
<groupId>ch.idsia</groupId>
<artifactId>crema</artifactId>
<version>0.1.6</version>
<version>0.2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
67 changes: 0 additions & 67 deletions docs/notes/markdownguide.md

This file was deleted.

Binary file modified docs/static/img/idsia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions docs/tutorials/domains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Domains
.. contents:: Table of Contents
:local:


Domain interface
=======

Expand All @@ -24,6 +25,7 @@ This simple interface declares basic methods to query the domain about variables
.. Note::
Returned arrays should never be modified!


SimpleDomain
============

Expand All @@ -33,22 +35,24 @@ This class encapsulates two integer arrays. One with the variable labels and one
.. literalinclude:: ../../src/test/java/ch/idsia/crema/tutorial/DomainsTutorial.java
:start-after: [simple-domain]
:end-before: [simple-domain]
:dedent: 8
:dedent: 2

.. Warning::
When creating a :code:`SimpleDomain` the list of variables must be sorted!
Crema will **not** automatically sort them, but for some operations will assume they are.


DomainBuilder
=============
While creating a :code:`SimpleDomain` by passing the arrays of variables and their sizes is possible and valid,

While creating a :code:`SimpleDomain` by passing the arrays of variables and their sizes is possible and valid,
a slightly more friendly method is available using the :code:`DomainBuilder`.
Laveraging the ellipses of Java the :code:`DomainBuilder` class avoids the explicit creation of the arrays as shown in the following example.

.. literalinclude:: ../../src/test/java/ch/idsia/crema/tutorial/DomainsTutorial.java
:start-after: [domain-builder-1]
:end-before: [domain-builder-1]
:dedent: 8
:dedent: 2


Strides
Expand All @@ -71,27 +75,26 @@ We we first look at how :code:`Strides` instances can be created conveniently.
.. Note::
The variable's cardinalities are accumlated starting from the variable at index 0.


.. literalinclude:: ../../src/test/java/ch/idsia/crema/tutorial/DomainsTutorial.java
:start-after: [strides]
:end-before: [strides]
:dedent: 8
:dedent: 2

Again, just as with the :code:`SimpleDomain`, creating the object specifying the arrays is valid, but not the most readable solution.
The following example shows an alternative way of creation where variables are added along with their cardinality.

.. literalinclude:: ../../src/test/java/ch/idsia/crema/tutorial/DomainsTutorial.java
:start-after: [domain-builder-strides]
:end-before: [domain-builder-strides]
:dedent: 8
:dedent: 2


Alternative ways to create strides are based on operations on them. Generally Domains are considered unmutable objects and any alteration will result in a new instance.

.. literalinclude:: ../../src/test/java/ch/idsia/crema/tutorial/DomainsTutorial.java
:start-after: [strides-remove]
:end-before: [strides-remove]
:dedent: 8
:dedent: 2

A number of common set operations are available:

Expand All @@ -100,8 +103,6 @@ A number of common set operations are available:
- remove

.. _Enhanced domain:

Working with Strides
--------------------



4 changes: 2 additions & 2 deletions docs/tutorials/factors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
Factors
===============

Credo supports different ways to represent the probability functions defined over the variables. A structure of different categorization
and abstraction around factors have been implemented. At the top of this all we have the concept of :code:`GenericFactor`.
Crema supports different ways to represent the probability functions defined over the variables. A structure of different categorization
and abstraction around factors have been implemented. At the top of this all we have the concept of :code:`GenericFactor`.
2 changes: 1 addition & 1 deletion docs/tutorials/networks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For a Bayesian Network we will use a :code:`BayesianFactor`.
.. literalinclude:: ../../src/test/java/ch/idsia/crema/tutorial/NetworkTutorial.java
:start-after: [creating-sparse-model]
:end-before: [creating-sparse-model]
:dedent: 8
:dedent: 2
:language: java


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ch.idsia</groupId>
<artifactId>crema</artifactId>
<version>0.2.1.beta.2</version>
<version>0.2.1</version>

<name>Credal Model Algorithms</name>

Expand Down

0 comments on commit 56327b1

Please sign in to comment.