active_inference_basic.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:actinf 作者: x75 项目源码 文件源码
def rh_e2p_fit(self):
        """Initial fit of e2p map with a batch of data"""

        # 2. now we learn e2p mapping (conditional joint density model for dealing with ambiguity)
        # ## prepare data
        if not self.attr_check(["logs", "e2p"]):
            return

        # print self.logs["EP"].shape, self.logs["X_"].shape
        # pl.ioff()
        # pl.plot(self.logs["X_"])
        # pl.show()

        # print "self.logs['X_']", self.logs["X_"]

        print("%s.rh_e2p_fit batch fitting of e2p (%s)" % (self.__class__.__name__, self.mm.__class__.__name__))
        self.mm.fit(np.asarray(self.e2p.X_)[10:], np.asarray(self.e2p.y_)[10:])

        # # fit gmm
        # self.cen_lst, self.cov_lst, self.p_k, self.logL = gmm.em_gm(self.logs["EP"], K = 10, max_iter = 1000,\
        #     verbose = False, iter_call = None)
        # print "rh_e2p_fit gmm: Log likelihood (how well the data fits the model) = ", self.logL
        # # print "rh_e2p_fit gmm:", np.array(self.cen_lst).shape, np.array(self.cov_lst).shape, self.p_k.shape
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号