Skip to content

Commit

Permalink
Merge pull request #201 from elfi-dev/dev
Browse files Browse the repository at this point in the history
Release 0.6
  • Loading branch information
vuolleko authored Jul 3, 2017
2 parents a13e831 + 9191800 commit f8d88c4
Show file tree
Hide file tree
Showing 93 changed files with 7,203 additions and 3,346 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ var/
.installed.cfg
*.egg

# Images
*.png
*.svg
*.jpg
*.jpeg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
28 changes: 22 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
language: python
python:
- "3.5"
matrix:
include:
- os: linux
language: python
python: 3.5
- os: linux
language: python
python: 3.6
- os: osx
language: generic
before_install:
- mkdir -p /Users/travis/.matplotlib
- "echo 'backend: TkAgg' > /Users/travis/.matplotlib/matplotlibrc"
- brew update
- brew install python3
- virtualenv env -p python3
- source env/bin/activate

cache: pip
# command to install dependencies

install:
- pip install numpy
- pip install -r requirements-dev.txt
- pip install -e .
# command to run tests

script:
- ipcluster start -n 2 --daemon
- travis_wait 20 make test
#- travis_wait 20 make test
- make test
26 changes: 25 additions & 1 deletion CHANGELOG.md → CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
# Change Log
Changelog
==========


0.6 (2017-07-03)
----------------

- Changed some of the internal variable names in methods.py. Most notable outputs is now
output_names.
- methods.py renamed to parameter_inference.py
- Changes in elfi.methods.results module class names:
- OptimizationResult (a new result type)
- Result -> Sample
- ResultSMC -> SmcSample
- ResultBOLFI -> BolfiSample
- Changes in BO/BOLFI:
- take advantage of priors
- take advantage of seed
- improved optimization scheme
- bounds must be a dict
- two new toy examples added: Gaussian and the Ricker model

0.5 (2017-05-19)
----------------

Major update, a lot of code base rewritten.

Most important changes:

- revised syntax for model definition (esp. naming)
- scheduler-independent parallelization interface (currently supports native & ipyparallel)
- methods can now be run iteratively
Expand All @@ -19,12 +41,14 @@ See the updated notebooks and documentation for examples and details.

0.3.1 (2017-01-31)
------------------

- Clean up requirements
- Set graphviz and unqlite optional
- PyPI release (pip install elfi)

0.2.2 - 0.3
-----------

- The inference problem is now contained in an Inference Task object.
- SMC-ABC has been reimplemented.
- Results from inference are now contained in a Result object.
Expand Down
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean clean-test clean-pyc clean-build docs help
.PHONY: clean clean-test clean-pyc clean-build docs notebook-docs help
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
Expand Down Expand Up @@ -64,16 +64,28 @@ coverage: ## check code coverage quickly with the default Python
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/elfi.rst
rm -f docs/elfi.bo.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ elfi
$(MAKE) -C docs clean
$(MAKE) notebook-docs
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html
# $(BROWSER) docs/_build/html/index.html

servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
CONTENT_URL := http://research.cs.aalto.fi/pml/software/elfi/docs/0.6/

notebook-docs: ## Conver notebooks to rst docs. Assumes you have them in `notebooks` directory.
jupyter nbconvert --to rst ../notebooks/quickstart.ipynb --output-dir docs
sed -i '' 's|\(quickstart_files/quickstart.*\.\)|'${CONTENT_URL}'\1|g' docs/quickstart.rst

jupyter nbconvert --to rst ../notebooks/tutorial.ipynb --output-dir docs/usage
sed -i '' 's|\(tutorial_files/tutorial.*\.\)|'${CONTENT_URL}usage/'\1|g' docs/usage/tutorial.rst

jupyter nbconvert --to rst ../notebooks/BOLFI.ipynb --output-dir docs/usage
sed -i '' 's|\(BOLFI_files/BOLFI.*\.\)|'${CONTENT_URL}usage/'\1|g' docs/usage/BOLFI.rst

jupyter nbconvert --to rst ../notebooks/parallelization.ipynb --output-dir docs/usage
sed -i '' 's|\(parallelization_files/parallelization.*\.\)|'${CONTENT_URL}usage/'\1|g' docs/usage/parallelization.rst

jupyter nbconvert --to rst ../notebooks/non_python_operations.ipynb --output-dir docs/usage --output=external
sed -i '' 's|\(external_files/external.*\.\)|'${CONTENT_URL}usage/'\1|g' docs/usage/external.rst

# release: clean ## package and upload a release
# python setup.py sdist upload
Expand All @@ -90,4 +102,4 @@ install: clean ## install the package to the active Python's site-packages
pip install -e .

dev: install ## install the development requirements to the active Python's site-packages
pip install -Ur requirements-dev.txt
pip install -r requirements-dev.txt
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
**Version 0.6 released!** See the CHANGELOG and [notebooks](https://github.com/elfi-dev/notebooks).

ELFI - Engine for Likelihood-Free Inference
===========================================

[![Build Status](https://travis-ci.org/elfi-dev/elfi.svg?branch=master)](https://travis-ci.org/elfi-dev/elfi)
[![Code Health](https://landscape.io/github/elfi-dev/elfi/master/landscape.svg?style=flat)](https://landscape.io/github/elfi-dev/elfi/master)
[![Code Health](https://landscape.io/github/elfi-dev/elfi/dev/landscape.svg?style=flat)](https://landscape.io/github/elfi-dev/elfi/dev)
[![Documentation Status](https://readthedocs.org/projects/elfi/badge/?version=latest)](http://elfi.readthedocs.io/en/latest/?badge=latest)
[![Gitter](https://badges.gitter.im/elfi-dev/elfi.svg)](https://gitter.im/elfi-dev/elfi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

<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-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
available but it is possible to make simulations of the process.

Other names or related approaches to likelihood-free inference include Approximative
Bayesian Computation ([ABC](https://en.wikipedia.org/wiki/Approximate_Bayesian_computation)),
simulator-based inference, approximative Bayesian inference, indirect inference, etc.

**Note:** Versions 0.5+ introduce small but significant changes in syntax. See the [notebooks](https://github.com/elfi-dev/notebooks).
ELFI is a statistical software package written in Python for likelihood-free inference (LFI) such as Approximate
Bayesian Computation ([ABC](https://en.wikipedia.org/wiki/Approximate_Bayesian_computation)).
The term LFI refers to a family of inference methods that replace the use of the likelihood function with a data
generating simulator function. ELFI features an easy to use generative modeling syntax and supports parallelized
inference out of the box.

Currently implemented ABC methods:
Currently implemented LFI methods:
- ABC Rejection sampler
- Sequential Monte Carlo ABC sampler
- [Bayesian Optimization for Likelihood-Free Inference (BOLFI)](http://jmlr.csail.mit.edu/papers/v17/15-017.html)
Expand All @@ -29,12 +25,6 @@ Other notable included algorithms and methods:
- Bayesian Optimization
- [No-U-Turn-Sampler](http://jmlr.org/papers/volume15/hoffman14a/hoffman14a.pdf), a Hamiltonian Monte Carlo MCMC sampler

ELFI includes an easy to use generative modeling syntax, where the generative model is
specified as a directed acyclic graph (DAG). The data generation process can then be
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.

See examples under [notebooks](https://github.com/elfi-dev/notebooks) to get started. Full
documentation can be found at http://elfi.readthedocs.io/. Limited user-support may be
asked from elfi-support.at.hiit.fi, but the
Expand All @@ -45,11 +35,15 @@ is preferable.
Installation
------------

ELFI requires and is tested with Python 3.5.
ELFI requires and is tested with Python 3.5-3.6. You can install ELFI by typing in your terminal:

```
pip install elfi
```
or on some platforms using Python 3 specific syntax:
```
pip3 install elfi
```

Note that in some environments you may need to first install `numpy` with
`pip install numpy`. This is due to our dependency to `GPy` that uses `numpy` in its installation.
Expand All @@ -59,9 +53,8 @@ Note that in some environments you may need to first install `numpy` with
- `graphviz` for drawing graphical models (needs [Graphviz](http://www.graphviz.org)), highly recommended


### Python 3
### Installing Python 3

On some platforms you may have to use `pip3 install elfi`, in order to use Python 3.
If you are new to Python, perhaps the simplest way to install a specific version of Python
is with [Anaconda](https://www.continuum.io/downloads).

Expand All @@ -85,5 +78,5 @@ Resolving these may sometimes go wrong:
- If you receive an error about `yaml.load`, install `pyyaml`.
- On OS X with Anaconda virtual environment say `conda install python.app` and then use
`pythonw` instead of `python`.
- Note that ELFI currently supports Python 3.5 only, although 3.x may work as well,
- Note that ELFI currently supports Python 3.5-3.6 only, although 3.x may work as well,
so try `pip3 install elfi`.
Loading

0 comments on commit f8d88c4

Please sign in to comment.