Merge branch 'devel' of github.com:SheffieldML/GPy into devel

This commit is contained in:
mzwiessele 2016-10-13 12:22:57 +01:00
commit 2d9f0f7b78
8 changed files with 89 additions and 87 deletions

View file

@ -74,7 +74,6 @@ ignore_regexps = [
## titles are the label, and a commit is classified under this section if any
## of the regexps associated is matching.
##
section_regexps = [
('New', [
r'^[nN]ew\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n]*)$',
]),
@ -178,6 +177,7 @@ unreleased_version_label = "Unreleased"
## Examples:
## - makotemplate("restructuredtext")
##
>>>>>>> 287584f0cdac51a674996ff6d7092cc876b25ce6
#output_engine = rest_py
#output_engine = mustache("restructuredtext")
output_engine = mustache("markdown")

View file

@ -1,13 +1,64 @@
# Changelog
## v1.5.3 (2016-09-06)
## v1.5.5 (2016-10-03)
### Other
* Bump version: 1.5.4 → 1.5.5. [Max Zwiessele]
## v1.5.4 (2016-10-03)
### New
* Added deployment pull request instructions for developers. [mzwiessele]
* Using gitchangelog to keep track of changes and log new features. [mzwiessele]
### Changes
* Version update on paramz. [Max Zwiessele]
* Fixed naming in variational priors : [Max Zwiessele]
* Changelog update. [mzwiessele]
### Fix
* Bug in dataset (in fn download_url) which wrongly interprets the Content-Length meta data, and just takes first character. [Michael T Smith]
* What's new update fix #425 in changelog. [mzwiessele]
### Other
* Bump version: 1.5.3 → 1.5.4. [Max Zwiessele]
* Merge pull request #443 from SheffieldML/dataset_download_url_bugfix. [Max Zwiessele]
fix: Bug in datasets.py
* Merge branch 'kurtCutajar-devel' into devel. [mzwiessele]
* Bump version: 1.5.2 → 1.5.3. [mzwiessele]
* Merge branch 'devel' into kurtCutajar-devel. [mzwiessele]
* Bump version: 1.5.1 → 1.5.2. [mzwiessele]
* Minor readme changes. [mzwiessele]
* Bump version: 1.5.0 → 1.5.1. [mzwiessele]
* Bump version: 1.4.3 → 1.5.0. [mzwiessele]
* Bump version: 1.4.2 → 1.4.3. [mzwiessele]
* Bump version: 1.4.1 → 1.4.2. [mzwiessele]
* Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [mzwiessele]
* [kern] fix #440. [mzwiessele]
* [doc] cleanup. [mzwiessele]
* [merge] into new devel. [Max Zwiessele]
@ -41,63 +92,6 @@
* Added core code for GpSSM and GpGrid. [kcutajar]
## v1.5.2 (2016-09-06)
### New
* Added deployment pull request instructions for developers. [mzwiessele]
### Other
* Bump version: 1.5.1 → 1.5.2. [mzwiessele]
* Minor readme changes. [mzwiessele]
## v1.5.1 (2016-09-06)
### Fix
* What's new update fix #425 in changelog. [mzwiessele]
### Other
* Bump version: 1.5.0 → 1.5.1. [mzwiessele]
## v1.5.0 (2016-09-06)
### New
* Using gitchangelog to keep track of changes and log new features. [mzwiessele]
### Other
* Bump version: 1.4.3 → 1.5.0. [mzwiessele]
## v1.4.3 (2016-09-06)
### Changes
* Changelog update. [mzwiessele]
### Other
* Bump version: 1.4.2 → 1.4.3. [mzwiessele]
## v1.4.2 (2016-09-06)
### Other
* Bump version: 1.4.1 → 1.4.2. [mzwiessele]
* Merge branch 'devel' of github.com:SheffieldML/GPy into devel. [mzwiessele]
* [kern] fix #440. [mzwiessele]
## v1.4.1 (2016-09-06)
### Other
@ -718,6 +712,11 @@
* [coverage] some more restrictions. [Max Zwiessele]
## v1.0.5 (2016-04-08)
### Other
* Merge pull request #365 from SheffieldML/devel. [Max Zwiessele]
patch 1.0.5

View file

@ -1 +1 @@
__version__ = "1.5.3"
__version__ = "1.5.5"

View file

@ -10,7 +10,7 @@ from .param import Param
from paramz.transformations import Logexp, Logistic,__fixed__
class VariationalPrior(Parameterized):
def __init__(self, name='latent space', **kw):
def __init__(self, name='latent prior', **kw):
super(VariationalPrior, self).__init__(name=name, **kw)
def KL_divergence(self, variational_posterior):
@ -23,6 +23,9 @@ class VariationalPrior(Parameterized):
raise NotImplementedError("override this for variational inference of latent space")
class NormalPrior(VariationalPrior):
def __init__(self, name='normal_prior', **kw):
super(VariationalPrior, self).__init__(name=name, **kw)
def KL_divergence(self, variational_posterior):
var_mean = np.square(variational_posterior.mean).sum()
var_S = (variational_posterior.variance - np.log(variational_posterior.variance)).sum()
@ -58,7 +61,7 @@ class SpikeAndSlabPrior(VariationalPrior):
pi = self.pi[idx]
else:
pi = self.pi
var_mean = np.square(mu)/self.variance
var_S = (S/self.variance - np.log(S))
var_gamma = (gamma*np.log(gamma/pi)).sum()+((1-gamma)*np.log((1-gamma)/(1-pi))).sum()
@ -163,12 +166,12 @@ class NormalPosterior(VariationalPosterior):
"""Compute the KL divergence to another NormalPosterior Object. This only holds, if the two NormalPosterior objects have the same shape, as we do computational tricks for the multivariate normal KL divergence.
"""
return .5*(
np.sum(self.variance/other.variance)
+ ((other.mean-self.mean)**2/other.variance).sum()
np.sum(self.variance/other.variance)
+ ((other.mean-self.mean)**2/other.variance).sum()
- self.num_data * self.input_dim
+ np.sum(np.log(other.variance)) - np.sum(np.log(self.variance))
)
class SpikeAndSlabPosterior(VariationalPosterior):
'''
The SpikeAndSlab distribution for variational approximations.
@ -190,11 +193,11 @@ class SpikeAndSlabPosterior(VariationalPosterior):
else:
self.gamma = Param("binary_prob",binary_prob,Logistic(1e-10,1.-1e-10))
self.link_parameter(self.gamma)
def propogate_val(self):
if self.group_spike:
self.gamma.values[:] = self.gamma_group.values
def collate_gradient(self):
if self.group_spike:
self.gamma_group.gradient = self.gamma.gradient.reshape(self.gamma.shape).sum(axis=0)

View file

@ -13,9 +13,9 @@ The Gaussian processes framework in Python.
## What's new:
From now on we keep track of changes in the CHANGELOG.md.
From now on we keep track of changes in the CHANGELOG.md.
If you want your changes to show up there follow the [guidelines](#gl).
In particular tag your commits by the [gitchangelog](https://github.com/vaab/gitchangelog) commit message format.
In particular tag your commits by the [gitchangelog](https://github.com/vaab/gitchangelog) commit message format.
## Contributing to GPy
@ -33,7 +33,7 @@ For an in depth description of pull requests, please visit https://help.github.c
6. The tests will be running on your pull request. In the comments section we will be able to discuss the changes and help you with any problems. Let us know if there are any in the comments, so we can help.
7. The pull request gets accepted and your awsome new feature will be in the next GPy release :)
For any further questions/suggestions head over to the issues section in GPy.
For any further questions/suggestions head over to the issues section in GPy.
<a name=gl></a>
### Pull Request Guidelines
@ -126,14 +126,14 @@ If you're having trouble installing GPy via `pip install GPy` here is a probable
# Saving models in a consistent way across versions:
As pickle is inconsistent across python versions and heavily dependent on class structure, it behaves inconsistent across versions.
As pickle is inconsistent across python versions and heavily dependent on class structure, it behaves inconsistent across versions.
Pickling as meant to serialize models within the same environment, and not to store models on disk to be used later on.
To save a model it is best to save the m.param_array of it to disk (using numpys np.save).
Additionally, you save the script, which creates the model.
In this script you can create the model using initialize=False as a keyword argument and with the data loaded as normal.
You then set the model parameters by setting m.param_array[:] = loaded_params as the previously saved parameters.
Then you initialize the model by m.initialize_parameter(), which will make the model usable.
Additionally, you save the script, which creates the model.
In this script you can create the model using initialize=False as a keyword argument and with the data loaded as normal.
You then set the model parameters by setting m.param_array[:] = loaded_params as the previously saved parameters.
Then you initialize the model by m.initialize_parameter(), which will make the model usable.
Be aware that up to this point the model is in an inconsistent state and cannot be used to produce any results.
```python
@ -161,15 +161,15 @@ New way of running tests is using coverage:
Ensure nose and coverage is installed:
pip install nose coverage
Run nosetests from root directory of repository:
coverage run travis_tests.py
Create coverage report in htmlcov/
coverage html
The coverage report is located in htmlcov/index.html
##### Legacy: using nosetests
@ -223,7 +223,7 @@ If you want to merge a branch into devel make sure the following steps are met:
- Check that tests are there and are checking code where applicable.
- [optional] Make changes if necessary and commit and push to run tests.
- [optional] Repeat the above until tests pass.
- [optional] bump up the version of GPy using bumpversion. The configuration is done, so all you need is bumpversion [major|minor|patch].
- [optional] bump up the version of GPy using bumpversion. The configuration is done, so all you need is bumpversion [major|minor|patch].
- Update the changelog using gitchangelog: `gitchangelog > CHANGELOG.md`
- Commit the changes of the changelog as silent update: `git commit -m "chg: pkg: CHANGELOG update" CHANGELOG.md
- Push the changes into devel.
@ -246,16 +246,16 @@ Then we are ready to make the last changes for the changelog and versioning:
Now we can merge the pull request into devel:
$ git checkout devel
$ git merge --no-ff kurtCutajar-devel
$ git merge --no-ff <pull-origin>-devel
$ git push origin devel
This will update the devel branch of GPy.
### Deploying GPy
We have set up all deployment automatic.
Thus, all you need to do is create a pull request from devel to deploy.
Wait for the tests to finish (successfully!) and merge the pull request.
We have set up all deployment automatic.
Thus, all you need to do is create a pull request from devel to deploy.
Wait for the tests to finish (successfully!) and merge the pull request.
This will update the package on pypi for all platforms fully automatically.
## Funding Acknowledgements

View file

@ -3,7 +3,7 @@ environment:
secure: 8/ZjXFwtd1S7ixd7PJOpptupKKEDhm2da/q3unabJ00=
COVERALLS_REPO_TOKEN:
secure: d3Luic/ESkGaWnZrvWZTKrzO+xaVwJWaRCEP0F+K/9DQGPSRZsJ/Du5g3s4XF+tS
gpy_version: 1.5.3
gpy_version: 1.5.5
matrix:
- PYTHON_VERSION: 2.7
MINICONDA: C:\Miniconda-x64

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.5.3
current_version = 1.5.5
tag = True
commit = True

View file

@ -148,7 +148,7 @@ setup(name = 'GPy',
include_package_data = True,
py_modules = ['GPy.__init__'],
test_suite = 'GPy.testing',
install_requires = ['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz>=0.6.8'],
install_requires = ['numpy>=1.7', 'scipy>=0.16', 'six', 'paramz>=0.6.9'],
extras_require = {'docs':['sphinx'],
'optional':['mpi4py',
'ipython>=4.0.0',