5184f1fc798a7728dd574ae9a351e16869d9ee7b,tests/contrib/timeseries/test_gp.py,,test_timeseries_models,#Any#Any#Any#Any#,21

Before Change


                                 log_obs_noise_scale_init=torch.randn(obs_dim))
    elif model == "glgssm":
        gp = GenericLGSSM(state_dim=nu_statedim, obs_dim=obs_dim,
                          log_obs_noise_scale_init=torch.randn(obs_dim))
    elif model == "ssmgp":
        state_dim = {0.5: 4, 1.5: 3, 2.5: 2}[nu_statedim]
        gp = GenericLGSSMWithGPNoiseModel(nu=nu_statedim, state_dim=state_dim, obs_dim=obs_dim,
                                          log_obs_noise_scale_init=torch.randn(obs_dim))
    elif model == "dmgp":
        gp = DependentMaternGP(nu=nu_statedim, obs_dim=obs_dim, dt=dt,
                               log_length_scale_init=torch.randn(obs_dim))
    elif model == "lcdgp":
        gp = LinearlyCoupledDependentMaternGP(nu=nu_statedim, obs_dim=obs_dim, dt=dt,
                                              log_length_scale_init=torch.randn(obs_dim))

    targets = torch.randn(T, obs_dim)
    gp_log_prob = gp.log_prob(targets)
    if model == "imgp":
        assert gp_log_prob.shape == (obs_dim,)
    else:
        assert gp_log_prob.dim() == 0

    // compare matern log probs to vanilla GP result via multivariate normal
    if model == "imgp":
        times = dt * torch.arange(T).double()
        for dim in range(obs_dim):
            lengthscale = gp.kernel.log_length_scale.exp()[dim]
            variance = (2.0 * gp.kernel.log_kernel_scale).exp()[dim]
            obs_noise = (2.0 * gp.log_obs_noise_scale).exp()[dim]

            kernel = {0.5: pyro.contrib.gp.kernels.Exponential,
                      1.5: pyro.contrib.gp.kernels.Matern32,

After Change


                                 obs_noise_scale_init=0.5 + torch.rand(obs_dim))
    elif model == "glgssm":
        gp = GenericLGSSM(state_dim=nu_statedim, obs_dim=obs_dim,
                          obs_noise_scale_init=0.5 + torch.rand(obs_dim))
    elif model == "ssmgp":
        state_dim = {0.5: 4, 1.5: 3, 2.5: 2}[nu_statedim]
        gp = GenericLGSSMWithGPNoiseModel(nu=nu_statedim, state_dim=state_dim, obs_dim=obs_dim,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: uber/pyro
Commit Name: 5184f1fc798a7728dd574ae9a351e16869d9ee7b
Time: 2019-11-12
Author: martinjankowiak@users.noreply.github.com
File Name: tests/contrib/timeseries/test_gp.py
Class Name:
Method Name: test_timeseries_models


Project Name: uber/pyro
Commit Name: 5184f1fc798a7728dd574ae9a351e16869d9ee7b
Time: 2019-11-12
Author: martinjankowiak@users.noreply.github.com
File Name: tests/contrib/timeseries/test_lgssm.py
Class Name:
Method Name: test_generic_lgssm_forecast


Project Name: uber/pyro
Commit Name: 5184f1fc798a7728dd574ae9a351e16869d9ee7b
Time: 2019-11-12
Author: martinjankowiak@users.noreply.github.com
File Name: tests/contrib/timeseries/test_gp.py
Class Name:
Method Name: test_dependent_matern_gp