@@ -192,8 +192,8 @@ def conditional(self, name, Xnew, given={}, **kwargs):
192
192
constructor.
193
193
"""
194
194
195
- X , f , cov_total , mean_total = self ._get_given_vals (given )
196
- mu , cov = self ._build_conditional (Xnew , X , f , cov_total , mean_total )
195
+ givens = self ._get_given_vals (given )
196
+ mu , cov = self ._build_conditional (Xnew , * givens )
197
197
chol = cholesky (stabilize (cov ))
198
198
shape = infer_shape (Xnew , kwargs .pop ("shape" , None ))
199
199
return pm .MvNormal (name , mu = mu , chol = chol , shape = shape , ** kwargs )
@@ -423,8 +423,8 @@ def _get_given_vals(self, given):
423
423
X , y , noise = self .X , self .y , self .noise
424
424
return X , y , noise , cov_total , mean_total
425
425
426
- def _build_conditional (self , Xnew , X , y , noise , cov_total , mean_total ,
427
- pred_noise , diag = False ):
426
+ def _build_conditional (self , Xnew , pred_noise , diag , X , y , noise ,
427
+ cov_total , mean_total ):
428
428
Kxx = cov_total (X )
429
429
Kxs = self .cov_func (X , Xnew )
430
430
Knx = noise (X )
@@ -478,9 +478,8 @@ def conditional(self, name, Xnew, pred_noise=False, given={}, **kwargs):
478
478
constructor.
479
479
"""
480
480
481
- X , y , noise , cov_total , mean_total = self ._get_given_vals (given )
482
- mu , cov = self ._build_conditional (Xnew , X , y , noise , cov_total , mean_total ,
483
- pred_noise , diag = False )
481
+ givens = self ._get_given_vals (given )
482
+ mu , cov = self ._build_conditional (Xnew , pred_noise , False , * givens )
484
483
chol = cholesky (cov )
485
484
shape = infer_shape (Xnew , kwargs .pop ("shape" , None ))
486
485
return pm .MvNormal (name , mu = mu , chol = chol , shape = shape , ** kwargs )
@@ -531,9 +530,8 @@ def predictt(self, Xnew, diag=False, pred_noise=False, given={}):
531
530
Same as `conditional` method.
532
531
"""
533
532
534
- X , y , noise , cov_total , mean_total = self ._get_given_vals (given )
535
- mu , cov = self ._build_conditional (Xnew , X , y , noise , cov_total ,
536
- mean_total , pred_noise , diag )
533
+ givens = self ._get_given_vals (given )
534
+ mu , cov = self ._build_conditional (Xnew , pred_noise , diag , * givens )
537
535
return mu , cov
538
536
539
537
@@ -680,8 +678,7 @@ def marginal_likelihood(self, name, X, Xu, y, sigma, is_observed=True, **kwargs)
680
678
shape = infer_shape (X , kwargs .pop ("shape" , None ))
681
679
return pm .DensityDist (name , logp , shape = shape , ** kwargs )
682
680
683
- def _build_conditional (self , Xnew , X , Xu , y , sigma , cov_total , mean_total ,
684
- pred_noise , diag = False ):
681
+ def _build_conditional (self , Xnew , pred_noise , diag , X , Xu , y , sigma , cov_total , mean_total ):
685
682
sigma2 = tt .square (sigma )
686
683
Kuu = cov_total (Xu )
687
684
Kuf = cov_total (Xu , X )
@@ -752,10 +749,8 @@ def conditional(self, name, Xnew, pred_noise=False, given={}, **kwargs):
752
749
constructor.
753
750
"""
754
751
755
- X , Xu , y , sigma , cov_total , mean_total = self ._get_given_vals (given )
756
- mu , cov = self ._build_conditional (Xnew , X , Xu , y , sigma , cov_total ,
757
- mean_total , pred_noise , diag = False )
752
+ givens = self ._get_given_vals (given )
753
+ mu , cov = self ._build_conditional (Xnew , pred_noise , False , * givens )
758
754
chol = cholesky (cov )
759
755
shape = infer_shape (Xnew , kwargs .pop ("shape" , None ))
760
756
return pm .MvNormal (name , mu = mu , chol = chol , shape = shape , ** kwargs )
761
-
0 commit comments