Skip to content

Commit

Permalink
Merge pull request #48 from eth-cscs/release-0.5.3
Browse files Browse the repository at this point in the history
Release 0.5.3
  • Loading branch information
statrita2004 authored Oct 25, 2018
2 parents ad12808 + 22afd83 commit 6d406cd
Show file tree
Hide file tree
Showing 19 changed files with 317 additions and 185 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,7 @@ ENV/

# Rope project settings
.ropeproject

# vim backup files
#
**/.*.sw?
61 changes: 23 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ABCpy [![Documentation Status](https://readthedocs.org/projects/abcpy/badge/?version=latest)](http://abcpy.readthedocs.io/en/latest/?badge=latest) [![Build Status](https://travis-ci.org/eth-cscs/abcpy.svg?branch=master)](https://travis-ci.org/eth-cscs/abcpy)

ABCpy is a scientific library written in Python for Bayesian uncertainty quantification in
absence of likelihood function, which parallelizes existing approaximate Bayesian computation (ABC)
absence of likelihood function, which parallelizes existing approximate Bayesian computation (ABC)
algorithms and other likelihood-free inference schemes. It presently includes:

* RejectionABC
Expand All @@ -26,52 +26,37 @@ scientists by providing
# Documentation
For more information, check out the

* [Documentation](http://abcpy.readthedocs.io/en/v0.5.2)
* [Examples](https://github.com/eth-cscs/abcpy/tree/v0.5.2/examples) directory and
* [Reference](http://abcpy.readthedocs.io/en/v0.5.2/abcpy.html)
* [Documentation](http://abcpy.readthedocs.io/en/v0.5.3)
* [Examples](https://github.com/eth-cscs/abcpy/tree/v0.5.3/examples) directory and
* [Reference](http://abcpy.readthedocs.io/en/v0.5.3/abcpy.html)

Further, we provide a
[collection of models](https://github.com/eth-cscs/abcpy-models) for which ABCpy
has been applied successfully. This is a good place to look at more complicated inference setups.

# Author
ABCpy was written by [Ritabrata Dutta, Università della svizzera italiana](https://search.usi.ch/en/people/c4342228614d041dca7e2f67cbb996c9/dutta-ritabrata)
and [Marcel Schoengens, CSCS, ETH Zurich]([email protected]), and we're actively developing it. Please feel free
to submit any bugs or feature requests. We'd also love to hear about your experiences with ABCpy in general. Drop us an email!

We want to thank
[Prof. Antonietta Mira, Università della svizzera italiana](https://search.usi.ch/en/people/f8960de6d60dd08a79b6c1eb20b7442b/Mira-Antonietta),
and
[Prof. Jukka-Pekka Onnela, Harvard University](https://www.hsph.harvard.edu/onnela-lab/)
for helpful contributions and advice; Avinash Ummadisinghu and Nicole Widmern
respectively for developing dynamic-MPI backend and making ABCpy suitbale for
hierarchical models; and finally CSCS (Swiss National Super Computing Center)
for their generous support.
ABCpy was written by [Ritabrata Dutta, Warwick
University](https://warwick.ac.uk/fac/sci/statistics/staff/academic-research/dutta/)
and [Marcel Schoengens]([email protected]), CSCS, ETH Zurich, and we're
actively developing it. Please feel free to submit any bugs or feature requests.
We'd also love to hear about your experiences with ABCpy in general. Drop us an
email!

We want to thank [Prof. Antonietta Mira, Università della svizzera
italiana](https://search.usi.ch/en/people/f8960de6d60dd08a79b6c1eb20b7442b/Mira-Antonietta),
and [Prof. Jukka-Pekka Onnela, Harvard
University](https://www.hsph.harvard.edu/onnela-lab/) for helpful contributions
and advice; Avinash Ummadisinghu and Nicole Widmern respectively for developing
dynamic-MPI backend and making ABCpy suitable for hierarchical models; and
finally CSCS (Swiss National Super Computing Center) for their generous support.

## Citation

There is a paper in the proceedings of the 2017 PASC conference. We would appreciate a citation.

```
@inproceedings{Dutta:2017:AUE:3093172.3093233,
author = {Dutta, Ritabrata and Schoengens, Marcel and Onnela, Jukka-Pekka and Mira, Antonietta},
title = {ABCpy: A User-Friendly, Extensible, and Parallel Library for Approximate Bayesian Computation},
booktitle = {Proceedings of the Platform for Advanced Scientific Computing Conference},
series = {PASC '17},
year = {2017},
isbn = {978-1-4503-5062-4},
location = {Lugano, Switzerland},
pages = {8:1--8:9},
articleno = {8},
numpages = {9},
url = {http://doi.acm.org/10.1145/3093172.3093233},
doi = {10.1145/3093172.3093233},
acmid = {3093233},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {ABC, Library, Parallel, Spark},
}
```
There is a paper in the proceedings of the 2017 PASC conference. In case you use
ABCpy for your publication, we would appreciate a citation. You can use
[this](https://github.com/eth-cscs/abcpy/blob/v0.5.3/doc/literature/DuttaS-ABCpy-PASC-2017.bib)
BibTex reference.


## Other Refernces

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.2
0.5.3
24 changes: 16 additions & 8 deletions abcpy/backends/mpi.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import numpy as np
import cloudpickle
import time
import pickle
import time

import cloudpickle
import numpy as np
from mpi4py import MPI
from abcpy.backends import Backend, PDS, BDS

from abcpy.backends import BDS, PDS, Backend


class BackendMPIMaster(Backend):
"""Defines the behavior of the master process
Expand Down Expand Up @@ -268,9 +270,11 @@ def collect(self, pds):
all_data_indices,all_data_items = [],[]

for node_data in all_data:
for item in node_data:
all_data_indices+=[item[0]]
all_data_items+=[item[1]]
for index, item in node_data:
if isinstance(item, Exception):
raise item
all_data_indices.append(index)
all_data_items.append(item)

#Sort the accumulated data according to the indices we tagged
#them with when distributing
Expand Down Expand Up @@ -490,7 +494,11 @@ def map(self, func):
#Accumulate the indicess and *processed* chunks
for chunk in data_chunks:
data_index,data_item = chunk
rdd+=[(data_index,func(data_item))]
try:
result = func(data_item)
except Exception as e:
result = e
rdd.append((data_index, result))

pds_res = PDSMPI(rdd, pds_id_new, self)

Expand Down
Loading

0 comments on commit 6d406cd

Please sign in to comment.