edb217e131d292dda89c989ce20b9e9f705a7ada,test/examples/simple_gp_regression_test.py,,test_posterior_latent_gp_and_likelihood_with_optimization,#,79

Before Change


    prior_gp_model.likelihood.initialize(log_noise=1)

    // Compute posterior distribution
    infer = Inference(prior_gp_model)
    posterior_gp_model = infer.run(train_x, train_y)

    // Find optimal model hyperparameters
    posterior_gp_model.train()
    optimizer = optim.Adam(posterior_gp_model.parameters(), lr=0.1)
    optimizer.n_iter = 0
    for i in range(50):
        optimizer.zero_grad()
        output = posterior_gp_model(train_x)
        loss = -posterior_gp_model.marginal_log_likelihood(output, train_y)
        loss.backward()
        optimizer.n_iter += 1
        optimizer.step()

    // Test the model

After Change


        optimizer.step()

    // Compute posterior distribution
    gp_model.condition(train_x, train_y)

    // Test the model
    gp_model.eval()
    test_function_predictions = gp_model(test_x)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 7

Non-data size: 10

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/simple_gp_regression_test.py
Class Name:
Method Name: test_posterior_latent_gp_and_likelihood_with_optimization


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/kissgp_gp_regression_test.py
Class Name:
Method Name: test_kissgp_gp_mean_abs_error


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/kissgp_kronecker_product_regression_test.py
Class Name:
Method Name: test_kissgp_gp_mean_abs_error


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/spectral_mixture_gp_regression_test.py
Class Name:
Method Name: test_spectral_mixture_gp_mean_abs_error


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/simple_gp_classification_test.py
Class Name:
Method Name: test_kissgp_classification_error


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/kissgp_gp_classification_test.py
Class Name:
Method Name: test_kissgp_classification_error


Project Name: cornellius-gp/gpytorch
Commit Name: edb217e131d292dda89c989ce20b9e9f705a7ada
Time: 2017-09-09
Author: gpleiss@gmail.com
File Name: test/examples/kissgp_kronecker_product_classification_test.py
Class Name:
Method Name: test_kissgp_classification_error