waxmorph.jax.graph.build_graph#
- waxmorph.jax.graph.build_graph(X, P, R, particle_count=0, c=None, eps_dist=0.01, max_edges=None)[source]#
Build JAX node features, directed edges, edge features, and real-edge count.
cis required despite its compatibility default. Shapes are[N, C],[2, Q],[Q, 2], and scalar, whereQis the real edge count ormax_edgeswhen padded. JAX’s fourth value and optional padding differ from PyTorch’s unpadded three-tuple.Examples
>>> X = jnp.array([[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [3.0, 0.0, 0.0]]) >>> P, R, c = jnp.ones((3, 3)), jnp.array([0.6, 0.6, 0.6]), jnp.ones(3) >>> out = build_graph(X, P, R, 3, c, eps_dist=0.0) >>> print([tuple(a.shape) for a in out[:3]], int(out[3])) [(3, 1), (2, 2), (2, 2)] 2