File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ def forward(
153
153
class FixedGaussianNoise (Module ):
154
154
def __init__ (self , noise : Tensor ) -> None :
155
155
super ().__init__ ()
156
- self .register_buffer ( " noise" , noise )
156
+ self .noise = noise
157
157
158
158
def forward (
159
159
self ,
@@ -172,3 +172,7 @@ def forward(
172
172
return DiagLazyTensor (self .noise )
173
173
else :
174
174
return ZeroLazyTensor ()
175
+
176
+ def _apply (self , fn ):
177
+ self .noise = fn (self .noise )
178
+ return super (FixedGaussianNoise , self )._apply (fn )
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ def test_kissgp_gp_fast_pred_var(self):
131
131
132
132
# Now bump up the likelihood to something huge
133
133
# This will make it easy to calculate the variance
134
- likelihood .initialize ( noise = 3. )
134
+ likelihood .noise = torch . ones ( 100 ) * 3.0
135
135
test_function_predictions = likelihood (gp_model (train_x ))
136
136
137
137
noise = likelihood .noise
You can’t perform that action at this time.
0 commit comments