protomotions.agents.peft.actor module#
Discrete-prior PEFT actor built around a pretrained discrete latent prior.
This module owns observation routing, FSQ encode/decode helpers, and actor
rollout outputs. Token-level adapter generation lives in prior_with_peft;
the pretrained prior model itself lives in the Supervised latent-prior package.
- class protomotions.agents.peft.actor.DiscretePriorPEFTActor(
- config,
- pretrained_prior_model,
- mimic_target_poses_dim=0,
Bases:
<Mock object at 0x7fd694b1b9d0>[]Actor that wraps DiscretePriorWithPEFT and the frozen decoder for action generation.
The actor owns the public observation contract. Task observations flow through
config.peft.modelintoconfig.peft.condition_key; frozen prior context keys are discovered from the pretrained prior and appended toin_keysinternally. The target encoder is optional and is used only for SFT batches that includemimic_target_poses.- optional_full_checkpoint_state_prefixes()[source]#
Frozen target encoder state is present only for SFT/checkpointing flows.
- load_adapter_state_dict(
- state_dict,
- strict=True,
Load adapter-only state, ignoring frozen-prior and critic entries.
- perturb_tokens(tokens, *, rate, mode)[source]#
Apply SFT token-noise augmentation to GPC prior tokens.
Teacher forcing on perturbed target tokens reduces exact-sequence memorization and makes the adapter less brittle when RLFT samples drift off the expert trajectory.