https://github.com/GPflow/GPflow
Revision 4a132712259277f3a312ebe81359cc687aeab6fd authored by st-- on 30 April 2018, 16:35:23 UTC, committed by Mark van der Wilk on 30 April 2018, 16:35:23 UTC
* Support exponential distribution as prior.

The exponential distribution here is parametrized using the rate
parameter lambda and always has its mode at 0.

* Reuse exponential density for prior distribution

Add transformation to test of exponential prior
This ensures that it is only evaluated on the positive domain

* Add sample method

* fix test

* fix test again

* more fixes

* add pragma: no cover to make codecov happy

* add sample tests

* sample test

* revert change to densities.exponential()

* fix

* pr comments

* fix test

* removing commented code
1 parent e59ff2f
Raw File
Tip revision: 4a132712259277f3a312ebe81359cc687aeab6fd authored by st-- on 30 April 2018, 16:35:23 UTC
Add Exponential distribution as prior (#717)
Tip revision: 4a13271
run_tests.sh
#!/bin/bash

# Script for running GPflow tests in sequential and parallel modes.
# Running tensorflow based tests in distinct processes prevents
# bad memory accumulations which can lead to crashes or slow runs
# on resource limited hardware.
# Written by Artem Artemev, 06/08/2017

set -e

mode=${1:-"--sequential"}

case "$mode" in
    -p|--parallel)
    numproc=$([[ $(uname) == 'Darwin' ]] && sysctl -n hw.physicalcpu_max || nproc)
    echo ">>> Parallel mode. Number of processes = $numproc"
    echo testing/test_*.py | xargs -n 1 -P "$numproc" bash -c 'nosetests -v --nologcapture $0 || exit 255'
    ;;
    -s|--sequential)
    for test_file in testing/test_*.py; do
      echo ">>> Run $test_file"
      nosetests -v --nologcapture "$test_file"
      rc=$?
      if [ "$rc" != "0" ]; then
        echo ">>> $test_file failed"
        exit $rc
      fi
    done
    ;;
    *)
    ;;
esac
back to top