geno_lewm.training.sampling¶
sampling
¶
RFC-0005 edit-balanced and rollout-length samplers.
EditTypeWeight
dataclass
¶
One RFC-0005 edit-type sampling weight.
RolloutStepWeight
dataclass
¶
One rollout-step-count sampling weight.
sample_edit_type
¶
sample_edit_type(rng: Random, *, weights: Sequence[EditTypeWeight] = DEFAULT_EDIT_TYPE_WEIGHTS) -> EditType
Sample one edit type from the RFC-0005 edit-balanced distribution.
Source code in geno_lewm/training/sampling.py
draw_edit_type_counts
¶
draw_edit_type_counts(n: int, *, rng: Random, weights: Sequence[EditTypeWeight] = DEFAULT_EDIT_TYPE_WEIGHTS) -> dict[EditType, int]
Draw n edit types and return counts by :class:EditType.
Source code in geno_lewm/training/sampling.py
sample_rollout_steps
¶
sample_rollout_steps(rng: Random, *, mix: Sequence[RolloutStepWeight] = DEFAULT_ROLLOUT_STEP_MIX) -> int
Sample a rollout length K from the Phase-1 RFC-0005 mix.
Source code in geno_lewm/training/sampling.py
draw_rollout_step_counts
¶
draw_rollout_step_counts(n: int, *, rng: Random, mix: Sequence[RolloutStepWeight] = DEFAULT_ROLLOUT_STEP_MIX) -> dict[int, int]
Draw n rollout lengths and return counts by step count.