@@ -632,25 +632,7 @@ def get_hn_params(self):
632
632
"hn_kappas" :self .hn_kappas ,
633
633
"hn_nus" :self .hn_nus ,
634
634
"hn_w_mats" :self .hn_w_mats }
635
-
636
- def reset_hn_params (self ):
637
- """Reset the hyperparameters of the posterior distribution to their initial values.
638
635
639
- They are reset to `self.h0_alpha_vec`, `self.h0_m_vecs`, `self.h0_kappas`, `self.h0_nus` and `self.h0_w_mats`.
640
- Note that the parameters of the predictive distribution are also calculated from them.
641
- """
642
- self .hn_alpha_vec [:] = self .h0_alpha_vec
643
- self .hn_m_vecs [:] = self .h0_m_vecs
644
- self .hn_kappas [:] = self .h0_kappas
645
- self .hn_nus [:] = self .h0_nus
646
- self .hn_w_mats [:] = self .h0_w_mats
647
- self .hn_w_mats_inv = np .linalg .inv (self .hn_w_mats )
648
-
649
- self ._calc_q_pi_char ()
650
- self ._calc_q_lambda_char ()
651
-
652
- self .calc_pred_dist ()
653
-
654
636
def calc_prior_char (self ):
655
637
self ._ln_c_h0_alpha = gammaln (self .h0_alpha_vec .sum ()) - gammaln (self .h0_alpha_vec ).sum ()
656
638
self ._ln_b_h0_w_nus = (
@@ -661,22 +643,6 @@ def calc_prior_char(self):
661
643
axis = 1 ) * 2.0
662
644
) / 2.0
663
645
664
- def overwrite_h0_params (self ):
665
- """Overwrite the initial values of the hyperparameters of the posterior distribution by the learned values.
666
-
667
- They are overwitten by `self.hn_alpha_vec`, `self.hn_m_vecs`, `self.hn_kappas`, `self.hn_nus` and `self.hn_w_mats`.
668
- Note that the parameters of the predictive distribution are also calculated from them.
669
- """
670
- self .h0_alpha_vec [:] = self .hn_alpha_vec
671
- self .h0_m_vecs [:] = self .hn_m_vecs
672
- self .h0_kappas [:] = self .hn_kappas
673
- self .h0_nus [:] = self .hn_nus
674
- self .h0_w_mats [:] = self .hn_w_mats
675
- self .h0_w_mats_inv = np .linalg .inv (self .h0_w_mats )
676
-
677
- self .calc_prior_char ()
678
- self .reset_hn_params ()
679
-
680
646
def calc_vl (self ):
681
647
# E[ln p(X|Z,mu,Lambda)]
682
648
self ._vl_p_x = np .sum (
0 commit comments