protomotions.agents.common.pretrained module#

Utilities for loading frozen pretrained modules.

protomotions.agents.common.pretrained.freeze_module(module)[source]#

Freeze a module in eval mode.

protomotions.agents.common.pretrained.get_path(root, path)[source]#

Resolve a dotted attribute/key path.

Module paths may use public names such as actor even when the model stores the module as _actor. An empty path returns root unchanged, which lets callers request the whole loaded model.

protomotions.agents.common.pretrained.load_pretrained_model_module(
config,
device,
checkpoint_path_overrides=None,
)[source]#

Instantiate a checkpoint-backed or embedded frozen module.

A checkpoint_path is opened for the module’s config and weights: this is the training path, where the teacher’s trained weights are required. An embedded module_config is the fallback used once checkpoint_path is 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_path wins when both are set, so training never skips the teacher weights.