def test_similarity_jacobian_2d(): params = np.ones(4) t = DifferentiableSimilarity.init_identity(2).from_vector(params) explicit_pixel_locations = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2]]) dW_dp = t.d_dp(explicit_pixel_locations) assert_equal(dW_dp, sim_jac_solution2d)
def test_similarity_jacobian_2d(): params = np.ones(4) t = DifferentiableSimilarity.identity(2).from_vector(params) explicit_pixel_locations = np.array( [[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2]]) dW_dp = t.d_dp(explicit_pixel_locations) assert_equal(dW_dp, sim_jac_solution2d)
def test_similarity_jacobian_2d_raises_dimensionalityerror(): params = np.ones(4) t = DifferentiableSimilarity.init_identity(2).from_vector(params) t.d_dp(np.ones([2, 3]))
def test_similarity_jacobian_3d_raises_dimensionalityerror(): t = DifferentiableSimilarity(np.eye(4)) t.d_dp(np.ones([2, 3]))