gensbi.recipes.id_strategies#
Structured id-builder strategies for the recipe pipelines.
Two DIFFERENT vocabularies share the word “rope” — they collided once (2026-07-19 handoff) and are deliberately kept distinct:
Model-side strategy strings (e.g.
Flux1Params.id_embedding_strategy):"rope"means apply RoPE to whatever ids arrive at the forward pass.Pipeline-side builder strategies (
ConditionalPipeline’sid_embedding_strategy): strings like"rope1d"/"rope2d"— and the objects in this module — build the id arrays themselves.
A HealpixRope pipeline strategy pairs with model-side
("absolute", "rope") plus a 3-entry even axes_dim summing to the
per-head dim (e.g. (22, 22, 20) for 64).
Classes#
Spherical RoPE ids for tokens on a HEALPix grid (name: "healpix-rope"). |
|
Structural interface for pipeline id-builder strategy objects. |
Module Contents#
- class gensbi.recipes.id_strategies.HealpixRope[source]#
Spherical RoPE ids for tokens on a HEALPix grid (name: “healpix-rope”).
Wraps
gensbi.recipes.utils.init_ids_healpix()(see there for the method and its rationale) with the geometry needed to build the ids — which the string-enum API cannot carry, since the pipeline only passes a token count.- Parameters:
nside (int) – HEALPix resolution of the token grid (power of 2).
base_pixels (sequence of int, optional) – Base pixels (0..11) covered by the grid;
None= full sky.
- class gensbi.recipes.id_strategies.IdStrategy[source]#
Bases:
ProtocolStructural interface for pipeline id-builder strategy objects.
Any object with a
nameand abuild(dim) -> (ids, resolved_dim)method can be passed in anid_embedding_strategytuple slot; the pipeline callsbuildwith the correspondingdim_obs/dim_cond. Strategies own their full geometry — unlike the string strategies they receive nosemantic_id/size.