020d3d6dfa1bbcc13f7f7f0a833f57bb2cc8ef9d,test/examples/test_spectral_mixture_gp_regression.py,TestSpectralMixtureGPRegression,test_spectral_mixture_gp_mean_abs_error,#TestSpectralMixtureGPRegression#,51

Before Change


        // Optimize the model
        gp_model.train()
        likelihood.train()
        optimizer = optim.Adam(list(gp_model.parameters()) + list(likelihood.parameters()), lr=0.1)
        optimizer.n_iter = 0

        for _ in range(50):

After Change



    def test_spectral_mixture_gp_mean_abs_error(self):
        likelihood = GaussianLikelihood(
            log_noise_prior=SmoothedBoxPrior(exp(-5), exp(3), sigma=0.1, log_transform=True)
        )
        gp_model = SpectralMixtureGPModel(train_x.data, train_y.data, likelihood)
        mll = gpytorch.mlls.ExactMarginalLogLikelihood(likelihood, gp_model)

        // Optimize the model
        gp_model.train()
        likelihood.train()
        optimizer = optim.Adam(list(gp_model.parameters()), lr=0.1)
        optimizer.n_iter = 0

        with gpytorch.settings.num_trace_samples(100):
            for _ in range(150):
                optimizer.zero_grad()
                output = gp_model(train_x)
                loss = -mll(output, train_y)
                loss.backward()
                optimizer.n_iter += 1
                optimizer.step()

            for param in gp_model.parameters():
                self.assertTrue(param.grad is not None)
                self.assertGreater(param.grad.norm().item(), 0)
            for param in likelihood.parameters():
                self.assertTrue(param.grad is not None)
                self.assertGreater(param.grad.norm().item(), 0)
            optimizer.step()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: 020d3d6dfa1bbcc13f7f7f0a833f57bb2cc8ef9d
Time: 2018-07-03
Author: balandat@fb.com
File Name: test/examples/test_spectral_mixture_gp_regression.py
Class Name: TestSpectralMixtureGPRegression
Method Name: test_spectral_mixture_gp_mean_abs_error


Project Name: jhfjhfj1/autokeras
Commit Name: aa212fc6e72f394396ecde431a86c55e89ae194e
Time: 2018-08-03
Author: jin@tamu.edu
File Name: autokeras/search.py
Class Name: BayesianSearcher
Method Name: maximize_acq