def debug_joint_feature():
    g = NodeTypeEdgeFeatureGraphCRF(2, [2, 3], [3, 4], np.array([[1, 2], [2, 3]]))
    l_node_f = [np.array([[1, 1, 1], [2, 2, 2]]), np.array([[0.11, 0.12, 0.13, 0.14], [0.21, 0.22, 0.23, 0.24], [0.31, 0.32, 0.33, 0.34]])]
    l_edges = [np.array([[0, 1]]), np.array([[0, 1]]), None, None]
    l_edge_f = [np.array([[0.111]]), np.array([[0.221, 0.222]]), None, None]
    x = (l_node_f, l_edges, l_edge_f)
    y = np.hstack([np.array([0, 1]), np.array([0, 1, 2])])
    g.initialize(x, y)
    jf = g.joint_feature(x, y)
    assert_array_equal(jf, jf)
    assert_array_almost_equal(jf, np.array([1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 0.11, 0.12, 0.13, 0.14, 0.21, 0.22, 0.23, 0.24, 0.31, 0.32, 0.33, 0.34, 0.0, 0.111, 0.0, 0.0, 0.0, 0.221, 0.0, 0.0, 0.0, 0.0, 0.0, 0.222, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
def debug_joint_feature():
    g = NodeTypeEdgeFeatureGraphCRF(2, [2, 3], [3, 4], np.array([[1, 2], [2, 3]]))
    l_node_f = [np.array([[1, 1, 1], [2, 2, 2]]), np.array([[0.11, 0.12, 0.13, 0.14], [0.21, 0.22, 0.23, 0.24], [0.31, 0.32, 0.33, 0.34]])]
    l_edges = [np.array([[0, 1]]), np.array([[0, 1]]), None, None]
    l_edge_f = [np.array([[0.111]]), np.array([[0.221, 0.222]]), None, None]
    x = (l_node_f, l_edges, l_edge_f)
    y = np.hstack([np.array([0, 1]), np.array([0, 1, 2])])
    g.initialize(x, y)
    jf = g.joint_feature(x, y)
    assert_array_equal(jf, jf)
    assert_array_almost_equal(jf, np.array([1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 0.11, 0.12, 0.13, 0.14, 0.21, 0.22, 0.23, 0.24, 0.31, 0.32, 0.33, 0.34, 0.0, 0.111, 0.0, 0.0, 0.0, 0.221, 0.0, 0.0, 0.0, 0.0, 0.0, 0.222, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))