Giter VIP home page Giter VIP logo

bayesflow's Introduction

BayesFlow

version 0.1

Installation

  • Ensure that you have obtained the dependencies listed below.
  • Update the configuration file setup.cfg:
    • Specify which libraries you are using for linear algebra (e.g. libraries = cblas, clapack)
    • Specify library directories and header file directories for the listed libraries.
    • If needed, specify additional arguments that should be passed to the compiler (e.g. if you use MKL). NB! If you use MKL, in addition to the usual arguments to the compiler, you also need to pass the argument -DMKL.
  • Go to the main directory (BayesFlow/) and run python setup.py install.

Examples

  • demo_HF.py: Demonstration of how to use BayesFlow for healthyFlowData dataset. The file src/tests/test_pipeline.py also gives examples on how to use BayesFlow, including quality control.

Dependencies

The package has the following dependencies:

  • Python, including packages scipy, numpy, cython, matplotlib, mpi4py, yaml, json, (rpy2), scikit-learn
  • OpenMPI
  • Libraries for linear algebra computations with c interfaces, e.g. CBLAS and CLAPACK or MKL.

The dependence on rpy2 is only needed for computing dip test and loading data from R package healthyFlowData.

How to obtain dependencies

Ubuntu

Python, OpenMPI and the required Python packages can be installed by:

sudo apt-get install python, openmpi  
sudo pip install numpy, cython, matplotlib, mpi4py, pyyaml, json, rpy2

For linear algebra, you can for example use ATLAS, which includes BLAS and the routines from LAPACK that we need. ATLAS can be installed from http://math-atlas.sourceforge.net/.

Then put the libraries you will use in the configuration file setup.cfg along with directories for headers (include_dirs) and for the libraries (library_dirs), for example:

[build_ext]
include_dirs = 	/usr/include:/local/include:/opt/local/include:/usr/include/atlas
library_dirs = 	/opt/local/lib:/usr/lib:/usr/local/lib
libraries = blas, lapack_atlas

If you instead use MKL, your setup.cfg-file might look like this:

[build_ext]
include_dirs =      ${MKLROOT}/include
library_dirs =      ${MKLROOT}/lib/intel64
libraries =         mkl_intel_lp64, mkl_core, mkl_sequential, pthread
extra_compile_args = -m64 -Wl --no-as-needed -DMKL
extra_link_args =   -Wl --no-as-needed

Note that you need to pass the extra argument -DMKL to the compiler.

Mac

Python and OpenMPI can be installed using homebrew. First install homebrew following the instructions at http://brew.sh. Then install Python and OpenMPI:

brew install python, openmpi

Then Python packages can be installed using

pip install numpy, cython, matplotlib, mpi4py, json, pyyaml, rpy2

For linear algebra c libraries, you can use the BLAS and LAPACK distributions provided in the Accelerate veclib framework. To do this, put

[build_ext]
include_dirs = /usr/include:/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/Headers/
libraries = cblas, clapack

in your configuration file setup.cfg.

bayesflow's People

Contributors

kjohnsson avatar jonaswallin avatar olivierverdier avatar disiji avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.