Skip to content

Fix for gp.sample_gp (redone) #2342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2017
Merged

Conversation

bwengals
Copy link
Contributor

This is a quick patch for gp.sample_gp. It addresses the possible culprit of #2015, and the cause of #2137. The old PR is #2261.

I think some people prefer jitter, others prefer chol_const. Happy to change per suggestions.

@twiecki
Copy link
Member

twiecki commented Jun 22, 2017

I think jitter we already use for a random term, this isn't really jittering but just adding a small constant, so I would prefer the chol_const name.

@bwengals
Copy link
Contributor Author

sounds good, changed it

@twiecki
Copy link
Member

twiecki commented Jun 23, 2017

______________________________ TestGP.test_sample ______________________________
self = <pymc3.tests.test_gp.TestGP object at 0x7f3c9231f250>
    def test_sample(self):
        X = np.linspace(0, 1, 10)[:, None]
        Y = np.random.randn(10)
        with Model() as model:
            M = gp.mean.Zero()
            l = Uniform('l', 0, 5)
            K = gp.cov.Matern32(1, l)
            sigma = Uniform('sigma', 0, 10)
            # make a Gaussian model
            random_test = gp.GP('random_test', mean_func=M, cov_func=K, sigma=sigma, observed={'X':X, 'Y':Y})
            tr = sample(20, init=None, progressbar=False, random_seed=self.random_seed)
    
        # test prediction
        Z = np.linspace(0, 1, 5)[:, None]
        with model:
            out = gp.sample_gp(tr[-3:], gp=random_test, X_values=Z, obs_noise=False,
>                              random_seed=self.random_seed, progressbar=False, jitter=True)
E           TypeError: sample_gp() got an unexpected keyword argument 'jitter'
pymc3/tests/test_gp.py:418: TypeError

@bwengals
Copy link
Contributor Author

ah whoops, fixed

@fonnesbeck fonnesbeck merged commit 5c740d4 into pymc-devs:master Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants