bce6052bd84a421a44bc590b1eda23923f63b951,test/examples/simple_gp_classification_test.py,,test_kissgp_classification_error_cuda,#,68

Before Change


        optimizer.n_iter = 0
        for i in range(50):
            optimizer.zero_grad()
            output = model.forward(train_x)
            loss = -model.marginal_log_likelihood(output, train_y)
            loss.backward()
            optimizer.n_iter += 1
            optimizer.step()

After Change



        // Set back to eval mode
        model.eval()
        test_preds = likelihood(model(train_x)).mean().ge(0.5).float().mul(2).sub(1).squeeze()
        mean_abs_error = torch.mean(torch.abs(train_y - test_preds) / 2)
        assert(mean_abs_error.data.squeeze()[0] < 1e-5)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: bce6052bd84a421a44bc590b1eda23923f63b951
Time: 2018-01-24
Author: gpleiss@gmail.com
File Name: test/examples/simple_gp_classification_test.py
Class Name:
Method Name: test_kissgp_classification_error_cuda


Project Name: cornellius-gp/gpytorch
Commit Name: bce6052bd84a421a44bc590b1eda23923f63b951
Time: 2018-01-24
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: bce6052bd84a421a44bc590b1eda23923f63b951
Time: 2018-01-24
Author: gpleiss@gmail.com
File Name: test/examples/kissgp_gp_classification_test.py
Class Name:
Method Name: test_kissgp_classification_error