protomotions.agents.common.pretrained module#
Utilities for loading frozen pretrained modules.
- protomotions.agents.common.pretrained.get_path(root, path)[source]#
Resolve a dotted attribute/key path.
Module paths may use public names such as
actoreven when the model stores the module as_actor. An empty path returnsrootunchanged, which lets callers request the whole loaded model.
- protomotions.agents.common.pretrained.load_pretrained_model_module(
- config,
- device,
- checkpoint_path_overrides=None,
Instantiate a checkpoint-backed or embedded frozen module.
A
checkpoint_pathis opened for the module’s config and weights: this is the training path, where the teacher’s trained weights are required. An embeddedmodule_configis the fallback used oncecheckpoint_pathis blank (inference blanks it when a config is embedded), so the owning bundle is self-contained and no teacher bundle is opened; the module’s weights then load with the owning checkpoint.checkpoint_pathwins when both are set, so training never skips the teacher weights.