Skip to content

Commit

Permalink
Merge pull request #55 from eth-cscs/release-0.5.5
Browse files Browse the repository at this point in the history
Release 0.5.5
  • Loading branch information
statrita2004 authored Jan 25, 2019
2 parents a1486b9 + 570fea5 commit 5360498
Show file tree
Hide file tree
Showing 25 changed files with 1,357 additions and 344 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ unittest:
unittest_mpi:
echo "Running MPI backend unit tests.."
mpirun -np 2 python3 -m unittest discover -s tests -v -p "backend_tests_mpi.py" || (echo "Error in MPI unit tests."; exit 1)
mpirun -np 3 python3 -m unittest discover -s tests -v -p "backend_tests_mpi_model_mpi.py" || (echo "Error in MPI unit tests."; exit 1)

exampletest: $(MAKEDIRS)
echo "Testing standard examples.."
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ scientists by providing
# Documentation
For more information, check out the

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


Further, we provide a
[collection of models](https://github.com/eth-cscs/abcpy-models) for which ABCpy
Expand All @@ -54,31 +55,31 @@ finally CSCS (Swiss National Super Computing Center) for their generous support.

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.4/doc/literature/DuttaS-ABCpy-PASC-2017.bib)
[this](https://github.com/eth-cscs/abcpy/blob/v0.5.5/doc/literature/DuttaS-ABCpy-PASC-2017.bib)

BibTex reference.


## Other Refernces

Publications in which ABCpy was applied:

* R. Dutta, M. Schoengens, A. Ummadisingu, J. P. Onnela, A. Mira, "ABCpy: A
High-Performance Computing Perspective to Approximate Bayesian Computation",
2017, arXiv:1711.04694

* R. Dutta, J. P. Onnela, A. Mira, "Bayesian Inference of Spreading Processes
on Networks", 2017, arXiv:1709.08862
on Networks", 2018, Proc. R. Soc. A, 474(2215), 20180129.

* R. Dutta, Z. Faidon Brotzakis and A. Mira, "Bayesian Calibration of
Force-fields from Experimental Data: TIP4P Water", 2018, Journal of Chemical Physics 149, 154110.

* R. Dutta, B. Chopard, J. Lätt, F. Dubois, K. Zouaoui Boudjeltia and A. Mira,
"Parameter Estimation of Platelets Deposition: Approximate Bayesian
Computation with High Performance Computing", 2017, arXiv:1710.01054
Computation with High Performance Computing", 2018, Frontiers in physiology, 9.

* A. Ebert, R. Dutta, P. Wu, K. Mengersen and A. Mira, "Likelihood-Free
Parameter Estimation for Dynamic Queueing Networks", 2018, arXiv:1804.02526

* R. Dutta, Z. Faidon Brotzakis and A. Mira, "Bayesian Calibration of
Force-fields from Experimental Data: TIP4P Water", 2018, arXiv:1804.02742

* R. Dutta, M. Schoengens, A. Ummadisingu, N. Widerman, J. P. Onnela, A. Mira, "ABCpy: A
High-Performance Computing Perspective to Approximate Bayesian Computation",
2017, arXiv:1711.04694

## License
ABCpy is published under the BSD 3-clause license, see [here](LICENSE).
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.4
0.5.5
7 changes: 3 additions & 4 deletions abcpy/approx_lhd.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def __init__(self, statistics_calc):
def likelihood(self, y_obs, y_sim):
# print("DEBUG: SynLiklihood.likelihood().")
if not isinstance(y_obs, list):
# print("type(y_obs) : ", type(y_obs), " , type(y_sim) : ", type(y_sim))
# print("y_obs : ", y_obs)
raise TypeError('Observed data is not of allowed types')

if not isinstance(y_sim, list):
Expand All @@ -81,14 +83,11 @@ def likelihood(self, y_obs, y_sim):

# Extract summary statistics from the simulated data
stat_sim = self.statistics_calc.statistics(y_sim)

# Compute the mean, robust precision matrix and determinant of precision matrix
# print("DEBUG: meansim computation.")
mean_sim = np.mean(stat_sim,0)
# print("DEBUG: robust_precision_sim computation.")
lw_cov_, _ = ledoit_wolf(stat_sim)
robust_precision_sim = np.linalg.inv(lw_cov_)
# print("DEBUG: robust_precision_sim_det computation..")
robust_precision_sim_det = np.linalg.det(robust_precision_sim)
# print("DEBUG: combining.")
tmp1 = robust_precision_sim * np.array(self.stat_obs.reshape(-1,1) - mean_sim.reshape(-1,1)).T
Expand Down
14 changes: 13 additions & 1 deletion abcpy/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,25 @@


def BackendMPI(*args,**kwargs):
# import and setup module mpimanager
import abcpy.backends.mpimanager
master_node_ranks = [0]
process_per_model = 1
if 'master_node_ranks' in kwargs:
master_node_ranks = kwargs['master_node_ranks']
if 'process_per_model' in kwargs:
process_per_model = kwargs['process_per_model']
abcpy.backends.mpimanager.create_mpi_manager(master_node_ranks, process_per_model)

# import BackendMPI and return and instance
from abcpy.backends.mpi import BackendMPI
return BackendMPI(*args,**kwargs)


def BackendMPITestHelper(*args,**kwargs):
from abcpy.backends.mpi import BackendMPITestHelper
return BackendMPITestHelper(*args,**kwargs)

def BackendSpark(*args,**kwargs):
from abcpy.backends.spark import BackendSpark
return BackendSpark(*args,**kwargs)
return BackendSpark(*args,**kwargs)
9 changes: 9 additions & 0 deletions abcpy/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,12 @@ def __init__(self, object):
def value(self):
return self.object


class NestedParallelizationController():
@abstractmethod
def nested_execution(self):
raise NotImplementedError

@abstractmethod
def run_nested(self, func, *args, **kwargs):
raise NotImplementedError
Loading

0 comments on commit 5360498

Please sign in to comment.