test_integration_plda.py 文件源码

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

项目:plda 作者: RaviSoji 项目源码 文件源码
def test_optimized_A_and_?_w_make_eye(cls):
        """ I = (V^T)(?_w)(V), where A = inv(V^T)
        NOTES:
        (1) There are two ways to compute ?_w:
            ?_w = (A)(A^T)
            ?_w = n / (n-1) * S_w
        (2) *** COMPUTE PHI WITH S_w: ?_w = n/(n-1) * S_w. ***
        (3) Do NOT use ?_w = (A)(A^T) because that is trivially true:
             (V^T)(?_w)(V), where V = inv(A^T), which gives
             (inv(A))(A)(A^T)(inv(A^T)) = (I)(I) = I.
        """
        tolerance = 1e-13  # Should be smaller than n / (n - 1).

        S_w = cls.model.S_w
        n = cls.model.n_avg
        V = inv(cls.model.A.T)
        cls.assertTrue(tolerance < (n / (n - 1)))

        ?_w = n / (n - 1) * S_w
        result = np.matmul(np.matmul(V.T, ?_w), V)
        cls.assert_same(result, np.eye(cls.dims), tolerance=tolerance)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号