API reference

Everything in hyperiax lives behind a small public surface; the sections below list it module by module. Each entry links to a per-symbol page generated from its docstring.

hyperiax.core

Tree topology, immutable Tree pytree, schema, views, sweep decorators.

hyperiax.Topology(parents, size, depth, ...)

Immutable tree topology with precomputed dispatch layouts.

hyperiax.Tree(topology, schema, data)

A topology + a typed dict of (N, *trailing) arrays.

hyperiax.Schema(fields)

Ordered, hashable collection of named FieldSpecs.

hyperiax.FieldSpec(shape[, dtype])

Per-node trailing shape and dtype of a single Tree field.

hyperiax.SweepFn(direction, fn, reads, ...)

A direction-tagged, pure Tree -> Tree transform.

hyperiax.Node(fields)

Sliced per-node fields for one level (or one selected subset).

hyperiax.Children(fields)

View of the children of all parents at the current up-sweep level.

hyperiax.ChildrenAxis(flat, segments, ...)

Virtual children-axis proxy for unequal-degree trees.

hyperiax.up(*[, reads, reads_children, ...])

Decorator: mark a function as an up-sweep.

hyperiax.down(*[, reads, reads_parent])

Decorator: mark a function as a down-sweep.

hyperiax.symmetric_topology(depth, degree)

A regular tree where every internal node has exactly degree children.

hyperiax.from_parents(parents, *[, names])

Thin re-export of Topology.from_parents().

hyperiax.from_newick(source, *[, schema])

Read a Newick tree (literal or file path) into a hyperiax Tree.

hyperiax.to_newick(tree)

Serialize a Tree back to a Newick string.

hyperiax.HyperiaxError

Base class for all hyperiax-raised exceptions.

hyperiax.MissingField

A sweep or tree access references a name not in the tree's schema.

hyperiax.SchemaMismatch

A value's shape or dtype does not match the field's spec.

hyperiax.prebuilt

Ready-to-use sweeps and helpers for common message-passing tasks.

Phylogenetic weighted mean

hyperiax.prebuilt.phylo_mean()

Return a SweepFn that fills each non-leaf node's estimated_value with the edge-length-weighted average of its children's estimated_value.

BFFG — discrete-edge (linear-Gaussian) sweeps

hyperiax.prebuilt.bffg.discrete_schema(d)

Field layout for a discrete-edge BFFG tree.

hyperiax.prebuilt.bffg.init_discrete_tree(...)

Seed a discrete-edge BFFG tree with leaf observations and initial anchors.

hyperiax.prebuilt.bffg.discrete_bf_sweep(...)

Build the discrete-edge backward-filtering up-sweep (Theorem 14 §6.1).

hyperiax.prebuilt.bffg.discrete_forward_sweep(...)

Build the unconditional forward-sampling down-sweep.

hyperiax.prebuilt.bffg.discrete_fg_sweep(...)

Build the discrete-edge forward-guided down-sweep (Theorem 14 §6.1).

hyperiax.prebuilt.bffg.discrete_refine_anchor()

Build the discrete anchor-refinement down-sweep (Algorithm 3 §7.1).

BFFG — continuous-edge (SDE) sweeps

hyperiax.prebuilt.bffg.continuous_schema(d, ...)

Field layout for a continuous-edge (SDE) BFFG tree.

hyperiax.prebuilt.bffg.init_continuous_tree(...)

Seed a continuous-edge BFFG tree with leaf observations and initial anchors.

hyperiax.prebuilt.bffg.continuous_bf_sweep(...)

Build the continuous-edge backward-filtering up-sweep (Theorem 23 §7.1).

hyperiax.prebuilt.bffg.continuous_forward_sweep(...)

Build the unconditional SDE forward-sampling down-sweep.

hyperiax.prebuilt.bffg.continuous_fg_sweep(...)

Build the continuous-edge forward-guided down-sweep (Theorem 23 §7.1).

hyperiax.prebuilt.bffg.continuous_refine_anchor()

Build the continuous anchor-refinement down-sweep (Algorithm 3 §7.1).

hyperiax.prebuilt.bffg.propagate_linearization(tree)

Propagate continuous BFFG linearisation anchors top-down.

For MCMC over BFFG-guided latents and hyperparameters, hyperiax composes with NumPyro — see Gaussian MCMC — BFFG with a hand-rolled kernel and Gaussian NUTS — and what its existence proves for worked examples.