From 7824ccd4cb18b784545d35e724fa10c4700c9e7d Mon Sep 17 00:00:00 2001
From: Steve Schmerler <git@elcorto.com>
Date: Sun, 18 May 2025 10:27:20 +0200
Subject: [PATCH] 03_one_dim_SVI: switch on Z learning, use other batch size

---
 BLcourse2.3/03_one_dim_SVI.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/BLcourse2.3/03_one_dim_SVI.py b/BLcourse2.3/03_one_dim_SVI.py
index e03f19c..00e5d40 100644
--- a/BLcourse2.3/03_one_dim_SVI.py
+++ b/BLcourse2.3/03_one_dim_SVI.py
@@ -138,7 +138,7 @@ class ApproxGPModel(gpytorch.models.ApproximateGP):
             self,
             Z,
             variational_distribution,
-            learn_inducing_locations=False,
+            learn_inducing_locations=True,
         )
         super().__init__(variational_strategy)
         self.mean_module = gpytorch.means.ConstantMean()
@@ -223,7 +223,9 @@ loss_func = gpytorch.mlls.VariationalELBO(
     likelihood, model, num_data=X_train.shape[0]
 )
 
-train_dl = DataLoader(TensorDataset(X_train, y_train), batch_size=len(X_train)//2, shuffle=True)
+train_dl = DataLoader(
+    TensorDataset(X_train, y_train), batch_size=128, shuffle=True
+)
 
 n_iter = 200
 history = defaultdict(list)
-- 
GitLab