Loading...
Loading...
Adds or modifies a Physical AI Studio policy under library/src/physicalai/policies. Use when creating a new policy family with the config/model/policy split, registering it in the get_policy factory and package exports, or keeping a policy compatible with Lightning training and export. Covers Pi0.5, Pi0, ACT, GR00T, SmolVLA, and LeRobot-wrapped policies.
npx skill4agent add open-edge-platform/physical-ai-studio physicalai-train-adding-a-policylibrary/src/physicalai/policies/<name>/Policytorch.nn.ModuleModelpolicies/base/Policypolicy.pyModelmodel.pyConfigFromConfigphysicalai.configuse-from-configconfigurationpolicies/pi05/config.pyPi05Config(Config)model.pyPi05Model(Model)policy.pyPi05(ExportablePolicyMixin, Policy)preprocessor.pypi_gemma.pypolicies/act/policies/<name>/config.py<Name>Config(Config)model.py<Name>Model(Model)torch.nn.Modulepolicy.py<Name>(Policy)ExportablePolicyMixinfrom physicalai.policies.<name> import <Name>, <Name>Config, <Name>ModelPolicyforward(...)training_steppredict_action_chunk(...)select_action(...)policies/__init__.py__all__<Name><Name>Config<Name>Modelget_physicalai_policy_class(...)get_policy(...)policies/__init__.pyfrom physicalai.policies import <Name>, get_policyget_policy("<name>")--model physicalai.policies.<Name>from physicalai.policies import get_policy
policy = get_policy("<name>")forward(...)predict_action_chunk(...)library/configs/physicalai/<name>.yamlmodel.class_pathdata.class_pathphysicalai.data.lerobot.LeRobotDataModuletrainer.*configs/physicalai/pi05.yamlphysicalai fit --config configs/physicalai/<name>.yaml --trainer.fast_dev_run=trueExportablePolicyMixinphysicalai-train-exporting-and-validatinglibrary/tests/unit/policies/uv run pytest tests/unit/policies -k <name>library/docs/explanation/policy/data/observation.pyFeatureFeatureTypeget_policy(...)physicalai fitclass_pathinit_argslibrary/pyproject.tomlpi05pi0grootsmolvlalibrary/uv run pytest tests/unit/policies -k <name>
physicalai fit --config configs/physicalai/<name>.yaml --trainer.fast_dev_run=true
prek run --all-files library/references/base-classes.mdPolicyModel