Skip to content

Commit c118306

Browse files
committed
Improve keops test
1 parent d98ceab commit c118306

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/examples/test_keops_gp_regression.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
# Simple training data: let's try to learn a sine function
19-
train_x = torch.randn(1000, 2)
19+
train_x = torch.randn(300, 2)
2020
train_y = torch.sin(train_x[..., 0] * (2 * pi) + train_x[..., 1])
2121
train_y = train_y + torch.randn_like(train_y).mul(0.001)
2222

@@ -52,11 +52,11 @@ def test_keops_gp_mean_abs_error(self):
5252
# Optimize the model
5353
gp_model.train()
5454
likelihood.train()
55-
optimizer = optim.Adam(list(gp_model.parameters()), lr=0.01)
55+
optimizer = optim.Adam(list(gp_model.parameters()), lr=0.1)
5656
optimizer.n_iter = 0
5757

5858
with gpytorch.settings.max_cholesky_size(0): # Ensure that we're using KeOps
59-
for i in range(300):
59+
for i in range(25):
6060
optimizer.zero_grad()
6161
output = gp_model(train_x)
6262
loss = -mll(output, train_y)

0 commit comments

Comments
 (0)