Skip to content

Commit

Permalink
fix test, use local compose coords in ker eval test
Browse files Browse the repository at this point in the history
  • Loading branch information
dehann authored May 1, 2024
1 parent 6c6a735 commit 5a4d4fd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/manellic/testManellicTree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -325,25 +325,27 @@ pdf(MvNormal(cov(ker)), [0,0,0])
AMP.evaluate(M, ker, p)


# think this direct coordinate diff test should work
delta_c = AMP.distanceMalahanobisCoordinates(M, ker, q)
delta_t = [10, 20, 0.1] - [10, 22, -0.1]
X = log(M, ϵ, Manifolds.compose(M, inv(M, p), q))
Xc_e = vee(M, ϵ, X)
malad_t = Xc_e'*inv(kercov)*Xc_e
# delta_t = [10, 20, 0.1] - [10, 22, -0.1]
@test isapprox(
delta_t'*inv(kercov)*delta_t,
malad_t,
delta_c'*delta_c;
atol=1e-10
)

malad2 = AMP.distanceMalahanobisSq(M,ker,q)
@test isapprox(
delta_t'*inv(kercov)*delta_t,
malad_t,
malad2;
atol=1e-10
)

rbfd = AMP.ker(M, ker, q, 0.5, AMP.distanceMalahanobisSq)
@test isapprox(
exp(-0.5*delta_t'*inv(kercov)*delta_t),
exp(-0.5*malad_t),
rbfd;
atol=1e-10
)
Expand Down

0 comments on commit 5a4d4fd

Please sign in to comment.