-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24fbde8
commit acf7d2f
Showing
21 changed files
with
177 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ def parse_requirements_file(filename): | |
|
||
setup( | ||
name="GPJax", | ||
version="0.3.0", | ||
version="0.3.1", | ||
author="Thomas Pinder", | ||
author_email="[email protected]", | ||
packages=find_packages(".", exclude=["tests"]), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
from gpjax.parameters.base import initialise, _initialise_hyperparams, complete | ||
import jax.numpy as jnp | ||
import pytest | ||
|
||
from gpjax import Prior | ||
from gpjax.kernels import RBF | ||
from gpjax.likelihoods import Bernoulli, Gaussian | ||
from gpjax.mean_functions import Zero | ||
from gpjax.likelihoods import Gaussian, Bernoulli | ||
import jax.numpy as jnp | ||
import pytest | ||
from gpjax.parameters.base import _initialise_hyperparams, complete, initialise | ||
|
||
|
||
def test_complete(): | ||
posterior = Prior(kernel = RBF()) * Gaussian() | ||
partial_params = {'lengthscale': jnp.array(1.0)} | ||
posterior = Prior(kernel=RBF()) * Gaussian() | ||
partial_params = {"lengthscale": jnp.array(1.0)} | ||
full_params = complete(partial_params, posterior) | ||
assert list(full_params.keys()) == ['lengthscale', 'variance', 'obs_noise'] | ||
assert list(full_params.keys()) == ["lengthscale", "variance", "obs_noise"] | ||
|
||
|
||
def test_initialise(): | ||
posterior = Prior(kernel = RBF()) * Gaussian() | ||
posterior = Prior(kernel=RBF()) * Gaussian() | ||
params = initialise(posterior) | ||
assert list(params.keys()) == ['lengthscale', 'variance', 'obs_noise'] | ||
assert list(params.keys()) == ["lengthscale", "variance", "obs_noise"] | ||
|
||
|
||
@pytest.mark.parametrize('n', [1, 10]) | ||
@pytest.mark.parametrize("n", [1, 10]) | ||
def test_non_conjugate_initialise(n): | ||
posterior = Prior(kernel=RBF()) * Bernoulli() | ||
params = initialise(posterior, n) | ||
assert list(params.keys()) == ['lengthscale', 'variance', 'latent'] | ||
assert params['latent'].shape == (n, 1) | ||
assert list(params.keys()) == ["lengthscale", "variance", "latent"] | ||
assert params["latent"].shape == (n, 1) | ||
|
||
|
||
def test_hyperparametr_initialise(): | ||
params = _initialise_hyperparams(RBF(), Zero()) | ||
assert list(params.keys()) == ['lengthscale', 'variance'] | ||
assert list(params.keys()) == ["lengthscale", "variance"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.