test_Bayesian.py 文件源码

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

项目:F_UNCLE 作者: fraserphysics 项目源码 文件源码
def test_model_pq(self):
        """Test the model PQ matrix generation
        """

        new_model = self.bayes.update(models={
            'simp': self.model.update_dof([4, 2])})

        P, q = new_model._get_model_pq()

        epsilon = np.array([2, 1])
        sigma = inv(np.diag(np.ones(2)))
        P_true = sigma
        q_true = -np.dot(epsilon, sigma)

        npt.assert_array_almost_equal(P, P_true, decimal=8)

        npt.assert_array_almost_equal(q, q_true, decimal=8)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号