test_units_plda.py 文件源码

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

项目:plda 作者: RaviSoji 项目源码 文件源码
def test_calc_A(self):
        tolerance = 1e-100
        dims = self.dims

        ?_w = np.diag(np.ones(dims))
        W = np.random.randint(0, 9, self.dims ** 2).reshape(dims, dims) + \
            np.eye(dims)
        n_avg = 9

        A_truth = ?_w * n_avg / (n_avg - 1)
        A_truth = np.sqrt(A_truth)
        A_truth = np.matmul(np.linalg.inv(W).T, A_truth)

        A_model = self.model.calc_A(n_avg, ?_w, W)

        self.assert_same(A_model, A_truth, tolerance=tolerance)
        self.assert_invertible(self.model.W)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号