mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-07-05 16:02:13 +02:00
Merge pull request #246 from SheffieldML/travis2
Dapid's travis changes
This commit is contained in:
commit
2123079596
5 changed files with 54 additions and 46 deletions
54
.travis.yml
54
.travis.yml
|
|
@ -1,27 +1,41 @@
|
||||||
language: python
|
sudo: false
|
||||||
python:
|
|
||||||
- "2.7"
|
os:
|
||||||
|
- linux
|
||||||
|
# - osx
|
||||||
|
|
||||||
|
language: python
|
||||||
|
|
||||||
|
#addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - gfortran
|
||||||
|
# - libatlas-dev
|
||||||
|
# - libatlas-base-dev
|
||||||
|
# - liblapack-dev
|
||||||
|
|
||||||
|
python:
|
||||||
|
- 2.7
|
||||||
|
- 3.3
|
||||||
|
- 3.4
|
||||||
|
|
||||||
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
|
|
||||||
before_install:
|
before_install:
|
||||||
#Install a mini version of anaconda such that we can easily install our dependencies
|
|
||||||
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
|
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
|
||||||
- chmod +x miniconda.sh
|
- chmod +x miniconda.sh
|
||||||
- ./miniconda.sh -b
|
- ./miniconda.sh -b
|
||||||
- export PATH=/home/travis/miniconda/bin:$PATH
|
- export PATH=/home/travis/miniconda/bin:$PATH
|
||||||
- conda update --yes conda
|
# - conda update --yes conda
|
||||||
# Workaround for a permissions issue with Travis virtual machine images
|
|
||||||
# that breaks Python's multiprocessing:
|
|
||||||
# https://github.com/travis-ci/travis-cookbooks/issues/155
|
|
||||||
- sudo rm -rf /dev/shm
|
|
||||||
- sudo ln -s /run/shm /dev/shm
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- conda install --yes python=$TRAVIS_PYTHON_VERSION atlas numpy=1.9 scipy=0.16 matplotlib nose sphinx pip nose
|
- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy=1.9 scipy=0.16 nose pip six
|
||||||
#- pip install .
|
- pip install .
|
||||||
- python setup.py build_ext --inplace
|
|
||||||
#--use-mirrors
|
script:
|
||||||
#
|
- cd $HOME
|
||||||
# command to run tests, e.g. python setup.py test
|
- mkdir empty
|
||||||
script:
|
- cd empty
|
||||||
- nosetests GPy/testing
|
- nosetests GPy.testing
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.cache/pip
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@
|
||||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
import matplotlib
|
||||||
from . import matplot_dep
|
from . import matplot_dep
|
||||||
except (ImportError, NameError):
|
except (ImportError, NameError):
|
||||||
# Matplotlib not available
|
# Matplotlib not available
|
||||||
import warnings
|
import warnings
|
||||||
warnings.warn(ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting"))
|
warnings.warn(ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting"))
|
||||||
#sys.modules['matplotlib'] =
|
#sys.modules['matplotlib'] =
|
||||||
#sys.modules[__name__+'.matplot_dep'] = ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting")
|
#sys.modules[__name__+'.matplot_dep'] = ImportWarning("Matplotlib not available, install newest version of Matplotlib for plotting")
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
# Copyright (c) 2014, GPy authors (see AUTHORS.txt).
|
# Copyright (c) 2014, GPy authors (see AUTHORS.txt).
|
||||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
|
||||||
import base_plots
|
from . import base_plots
|
||||||
import models_plots
|
from . import models_plots
|
||||||
import priors_plots
|
from . import priors_plots
|
||||||
import variational_plots
|
from . import variational_plots
|
||||||
import kernel_plots
|
from . import kernel_plots
|
||||||
import dim_reduction_plots
|
from . import dim_reduction_plots
|
||||||
import mapping_plots
|
from . import mapping_plots
|
||||||
import Tango
|
from . import Tango
|
||||||
import visualize
|
from . import visualize
|
||||||
import latent_space_visualizations
|
from . import latent_space_visualizations
|
||||||
import netpbmfile
|
from . import netpbmfile
|
||||||
import inference_plots
|
from . import inference_plots
|
||||||
import maps
|
from . import maps
|
||||||
import img_plots
|
from . import img_plots
|
||||||
from ssgplvm import SSGPLVM_plot
|
from .ssgplvm import SSGPLVM_plot
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
# #Copyright (c) 2012, GPy authors (see AUTHORS.txt).
|
# #Copyright (c) 2012, GPy authors (see AUTHORS.txt).
|
||||||
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
# Licensed under the BSD 3-clause license (see LICENSE.txt)
|
||||||
|
from matplotlib import pyplot as pb
|
||||||
|
|
||||||
try:
|
|
||||||
#import Tango
|
|
||||||
from matplotlib import pyplot as pb
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
def ax_default(fignum, ax):
|
def ax_default(fignum, ax):
|
||||||
if ax is None:
|
if ax is None:
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class RVTransformationTestCase(unittest.TestCase):
|
||||||
# The PDF of the transformed variables
|
# The PDF of the transformed variables
|
||||||
p_phi = lambda phi : np.exp(-m._objective_grads(phi)[0])
|
p_phi = lambda phi : np.exp(-m._objective_grads(phi)[0])
|
||||||
# To the empirical PDF of:
|
# To the empirical PDF of:
|
||||||
theta_s = prior.rvs(100000)
|
theta_s = prior.rvs(1e6)
|
||||||
phi_s = trans.finv(theta_s)
|
phi_s = trans.finv(theta_s)
|
||||||
# which is essentially a kernel density estimation
|
# which is essentially a kernel density estimation
|
||||||
kde = st.gaussian_kde(phi_s)
|
kde = st.gaussian_kde(phi_s)
|
||||||
|
|
@ -56,7 +56,7 @@ class RVTransformationTestCase(unittest.TestCase):
|
||||||
# The following test cannot be very accurate
|
# The following test cannot be very accurate
|
||||||
self.assertTrue(np.linalg.norm(pdf_phi - kde(phi)) / np.linalg.norm(kde(phi)) <= 1e-1)
|
self.assertTrue(np.linalg.norm(pdf_phi - kde(phi)) / np.linalg.norm(kde(phi)) <= 1e-1)
|
||||||
# Check the gradients at a few random points
|
# Check the gradients at a few random points
|
||||||
for i in range(10):
|
for i in range(5):
|
||||||
m.theta = theta_s[i]
|
m.theta = theta_s[i]
|
||||||
self.assertTrue(m.checkgrad(verbose=True))
|
self.assertTrue(m.checkgrad(verbose=True))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue