Skip to content

Commit

Permalink
Merge pull request #129 from elfi-dev/install_docs
Browse files Browse the repository at this point in the history
Updated installation instructions and other details in the docs
  • Loading branch information
vuolleko committed Apr 7, 2017
2 parents f8ab3a8 + b90ad2e commit 86d729d
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 40 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/HIIT/elfi/issues.
Report bugs at https://github.com/elfi-dev/elfi/issues.

If you are reporting a bug, please include:

Expand Down Expand Up @@ -45,7 +45,7 @@ articles, and such.
Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/HIIT/elfi/issues.
The best way to send feedback is to file an issue at https://github.com/elfi-dev/elfi/issues.

If you are proposing a feature:

Expand Down Expand Up @@ -119,7 +119,7 @@ Before you submit a pull request, check that it meets these guidelines:
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.5 and later. Check
https://travis-ci.org/HIIT/elfi/pull_requests
https://travis-ci.org/elfi-dev/elfi/pull_requests
and make sure that the tests pass for all supported Python versions.

Tips
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ ELFI - Engine for Likelihood-Free Inference
<img src="https://cloud.githubusercontent.com/assets/1233418/20178983/6e22ee44-a75c-11e6-8345-5934b55b9dc6.png" width="15%" align="right"></img>

ELFI is a statistical software package written in Python for performing inference with
generative models. The term "likelihood-lree inference" refers to a family of inference
generative models. The term "likelihood-free inference" refers to a family of inference
methods that replace the use of the likelihood function with a data generating simulator
function. This is useful when the likelihood function is not computable or otherwise
function. This is useful when the likelihood function is not computable or otherwise
available but it is possible to make simulations of the process.

Other names or related approaches to likelihood-free inference include Approximative
Expand Down Expand Up @@ -50,7 +50,6 @@ installation.

### Optional dependencies

- `ipyparallel` for parallelization
- `graphviz` for drawing graphical models ([Graphviz](http://www.graphviz.org))


Expand Down
23 changes: 17 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ ELFI is currently tested only with Python 3.5. If you are new to Python, perhaps

.. _Anaconda: https://www.continuum.io/downloads

Currently it is required to use Distributed 1.14.3.
Optional dependencies
---------------------

Optionally you may wish to install also the following packages:

* `graphviz` for drawing graphical models (Graphviz_ must be installed separately)

.. _Graphviz: http://www.graphviz.org

Virtual environment using Anaconda
----------------------------------
Expand Down Expand Up @@ -55,19 +61,24 @@ You can either clone the public repository:

.. code-block:: console
git clone https://github.com/HIIT/elfi.git
git clone https://github.com/elfi-dev/elfi.git
Or download the `tarball`_:

.. code-block:: console
curl -OL https://github.com/HIIT/elfi/tarball/master
curl -OL https://github.com/elfi-dev/elfi/tarball/master
Note that for development it is recommended to base your work on the `dev` branch instead of `master`.

Once you have a copy of the source, you can install it with:

.. code-block:: console
python setup.py install
pip install -e .
This will install ELFI along with its default requirements.

.. _Github repo: https://github.com/elfi-dev/elfi
.. _tarball: https://github.com/elfi-dev/elfi/tarball/master

.. _Github repo: https://github.com/HIIT/elfi
.. _tarball: https://github.com/HIIT/elfi/tarball/master
10 changes: 4 additions & 6 deletions docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ ELFI is a statistical software package written in Python for Approximative Bayes

.. _ABC: https://en.wikipedia.org/wiki/Approximate_Bayesian_computation

The probabilistic inference model is defined as a directed acyclic graph, which allows for an intuitive means to describe inherent dependencies in the model. The inference pipeline is automatically parallelized with Dask_, which scales well from a desktop up to a cluster environment. The package includes functionality for input/output operations and visualization.

.. _Dask: https://dask.pydata.org
The probabilistic inference model is defined as a directed acyclic graph, which allows for an intuitive means to describe inherent dependencies in the model. The inference pipeline is automatically parallelized from multiple cores up to a cluster environment. ELFI also handles seeding the random number generators and storing of the generated data for you so that you can easily repeat or fine tune your inference. Additionally, the package includes functionality for visualization.

Currently implemented ABC methods:

Expand All @@ -17,12 +15,12 @@ Currently implemented ABC methods:

.. _BOLFI: http://jmlr.csail.mit.edu/papers/v17/15-017.html

GitHub page: https://github.com/HIIT/elfi
GitHub page: https://github.com/elfi-dev/elfi

See examples under the notebooks_ directory to get started. Limited user-support may be asked from elfi-support.at.hiit.fi, but the `Gitter chat`_ is preferable.

.. _notebooks: https://github.com/HIIT/elfi/tree/master/notebooks
.. _Gitter chat: https://gitter.im/HIIT/elfi?utm_source=share-link&utm_medium=link&utm_campaign=share-link
.. _notebooks: https://github.com/elfi-dev/notebooks
.. _Gitter chat: https://gitter.im/elfi-dev/elfi?utm_source=share-link&utm_medium=link&utm_campaign=share-link

Licenses:

Expand Down
5 changes: 3 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ To use ELFI in a project::

import elfi

For tutorials, please see the Jupyter Notebooks under the `notebooks directory`_.
For tutorials, please see the Jupyter Notebooks under the `notebooks directory`_. Feel free to add your own in the zoo_.

.. _notebooks directory: https://github.com/HIIT/elfi/tree/master/notebooks
.. _notebooks directory: https://github.com/elfi-dev/notebooks
.. _zoo: https://github.com/elfi-dev/zoo
20 changes: 20 additions & 0 deletions examples/ma2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,32 @@ def MA2(t1, t2, n_obs=100, batch_size=1, random_state=None):
def autocov(x, lag=1):
"""Autocovariance assuming a (weak) univariate stationary process with mean 0.
Realizations are in rows.
Parameters
----------
x : np.array of size (n, m)
lag : int, optional
Returns
-------
C : np.array of size (n,)
"""
C = np.mean(x[:, lag:]*x[:, :-lag], axis=1)
return C


def discrepancy(x, y):
"""Euclidean distance between data.
Parameters
----------
x : tuple of np.arrays of size (n,)
y : tuple of np.arrays of size (n,)
Returns
-------
d : np.array of size (n,)
"""
d = np.linalg.norm(np.column_stack(x) - np.column_stack(y), ord=2, axis=1)
return d

Expand Down
22 changes: 11 additions & 11 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Testing
pytest==3.0.3
tox==2.4.1
coverage==4.2
pytest-cov==2.4.0
pytest>=3.0.3
tox>=2.4.1
coverage>=4.2
pytest-cov>=2.4.0

# Linting
flake8==3.0.4
pep8-naming==0.4.1
flake8-docstrings==1.0.2
isort==4.2.5
flake8-isort==2.0.1
flake8>=3.0.4
pep8-naming>=0.4.1
flake8-docstrings>=1.0.2
isort>=4.2.5
flake8-isort>=2.0.1

# Documentation
Sphinx==1.4.8
watchdog==0.8.3
Sphinx>=1.4.8
watchdog>=0.8.3
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
numpy>=1.8
scipy>=0.16.1
matplotlib>=1.1
GPy>=1.0.9
networkX>=1.11
ipyparallel>=6
12 changes: 3 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@

packages = ['elfi'] + ['elfi.' + p for p in find_packages('elfi')]

requirements = [
'numpy>=1.8',
'scipy>=0.16.1',
'matplotlib>=1.1',
'GPy>=1.0.9',
'networkX>=1.11',
'ipyparallel>=6.0'
]
with open('requirements.txt', 'r') as f:
requirements = f.read().splitlines()

optionals = {
'doc': ['Sphinx'],
Expand All @@ -30,7 +24,7 @@
keywords='abc likelihood-free statistics',
packages=packages,
version=__version__,
author='HIIT',
author='ELFI authors',
author_email='elfi-support@hiit.fi',
url='http://elfi.readthedocs.io',

Expand Down

0 comments on commit 86d729d

Please sign in to comment.