コード例 #1
0
ファイル: test_compound.py プロジェクト: shoyer/algopy
    def test_utpm_logdet_trace_expm(self):
        D, P, N = 3, 5, 4

        x = 0.1 * UTPM(numpy.random.randn(D, P, N, N))
        x = UTPM.dot(x.T, x)
        observed_logdet = UTPM.logdet(expm(x))
        desired_logdet = UTPM.trace(x)
        assert_allclose(observed_logdet.data, desired_logdet.data)
コード例 #2
0
ファイル: test_compound.py プロジェクト: argriffing/algopy
    def test_utpm_logdet_trace_expm(self):
        D, P, N = 3, 5, 4

        x = 0.1 * UTPM(numpy.random.randn(D, P, N, N))
        x = UTPM.dot(x.T, x)
        observed_logdet = UTPM.logdet(expm(x))
        desired_logdet = UTPM.trace(x)
        assert_allclose(observed_logdet.data, desired_logdet.data)
コード例 #3
0
ファイル: test_compound.py プロジェクト: shoyer/algopy
 def f(x):
     x = x.reshape((2, 2))
     return sum(expm(x))
コード例 #4
0
ファイル: test_compound.py プロジェクト: eteq/algopy
 def f(x):
     x = x.reshape((2,2))
     return sum(expm(x))