embodichain.learning.rl.policy_evaluation#
External Policy Profiles for embodichain eval-policy.
Classes:
DexSim Policy Spec and report metadata built by one provider. |
|
Checkpoint, configs, and runtime choices supplied to a provider. |
Functions:
|
Build one profile with its registered provider. |
|
Register a Motion Profile provider under its CLI name. |
- class embodichain.learning.rl.policy_evaluation.MotionProfile[source]#
Bases:
objectDexSim Policy Spec and report metadata built by one provider.
Methods:
__init__(profile_id, policy_spec[, ...])Attributes:
- __init__(profile_id, policy_spec, provider_version=1, provenance=<factory>, warnings=())#
-
policy_spec:
Mapping[str,Any]#
-
profile_id:
str#
-
provenance:
Mapping[str,Any]#
-
provider_version:
int= 1#
-
warnings:
tuple[str,...] = ()#
- class embodichain.learning.rl.policy_evaluation.MotionProfileRequest[source]#
Bases:
objectCheckpoint, configs, and runtime choices supplied to a provider.
Methods:
__init__(checkpoint, device[, configs, ...])Attributes:
- __init__(checkpoint, device, configs=<factory>, resource_root=None, renderer='hybrid')#
-
checkpoint:
Path#
-
configs:
Mapping[str,Path]#
-
device:
device#
-
renderer:
str= 'hybrid'#
-
resource_root:
Path|None= None#
- embodichain.learning.rl.policy_evaluation.build_motion_profile(name, request)[source]#
Build one profile with its registered provider.
- Parameters:
name (
str) – Registered profile name.request (
MotionProfileRequest) – Checkpoint, configs, and runtime choices.
- Return type:
- Returns:
Provider-built Motion Profile.
- embodichain.learning.rl.policy_evaluation.register_motion_profile(name, provider)[source]#
Register a Motion Profile provider under its CLI name.
- Parameters:
name (
str) – Stable profile name.provider (
Callable[[MotionProfileRequest],MotionProfile]) – Callable that builds oneMotionProfile.
- Return type:
None
External Motion Profiles#
External Policy Profile registration and construction.
Classes:
DexSim Policy Spec and report metadata built by one provider. |
|
Checkpoint, configs, and runtime choices supplied to a provider. |
Functions:
|
Build one profile with its registered provider. |
|
Register a Motion Profile provider under its CLI name. |
- class embodichain.learning.rl.policy_evaluation.profile.MotionProfile[source]#
Bases:
objectDexSim Policy Spec and report metadata built by one provider.
Methods:
__init__(profile_id, policy_spec[, ...])Attributes:
- __init__(profile_id, policy_spec, provider_version=1, provenance=<factory>, warnings=())#
-
policy_spec:
Mapping[str,Any]#
-
profile_id:
str#
-
provenance:
Mapping[str,Any]#
-
provider_version:
int= 1#
-
warnings:
tuple[str,...] = ()#
- class embodichain.learning.rl.policy_evaluation.profile.MotionProfileRequest[source]#
Bases:
objectCheckpoint, configs, and runtime choices supplied to a provider.
Methods:
__init__(checkpoint, device[, configs, ...])Attributes:
- __init__(checkpoint, device, configs=<factory>, resource_root=None, renderer='hybrid')#
-
checkpoint:
Path#
-
configs:
Mapping[str,Path]#
-
device:
device#
-
renderer:
str= 'hybrid'#
-
resource_root:
Path|None= None#
- embodichain.learning.rl.policy_evaluation.profile.build_motion_profile(name, request)[source]#
Build one profile with its registered provider.
- Parameters:
name (
str) – Registered profile name.request (
MotionProfileRequest) – Checkpoint, configs, and runtime choices.
- Return type:
- Returns:
Provider-built Motion Profile.
- embodichain.learning.rl.policy_evaluation.profile.register_motion_profile(name, provider)[source]#
Register a Motion Profile provider under its CLI name.
- Parameters:
name (
str) – Stable profile name.provider (
Callable[[MotionProfileRequest],MotionProfile]) – Callable that builds oneMotionProfile.
- Return type:
None
Run an external Policy Profile through DexSim Motion Policy Kit.
Classes:
Normalized inputs and per-episode motion evaluation results. |
Functions:
|
Resolve one Motion Profile and run its visual evaluation. |
- class embodichain.learning.rl.policy_evaluation.bridge.MotionEvaluationResult[source]#
Bases:
objectNormalized inputs and per-episode motion evaluation results.
Methods:
__init__(profile, policy_spec, scene_config, ...)Attributes:
- __init__(profile, policy_spec, scene_config, episodes, summary, viewer)#
-
episodes:
tuple[Mapping[str,Any],...]#
-
policy_spec:
Mapping[str,Any]#
-
profile:
MotionProfile#
-
scene_config:
Mapping[str,Any]#
-
summary:
Mapping[str,Any]#
-
viewer:
bool#
- embodichain.learning.rl.policy_evaluation.bridge.evaluate_motion_profile(profile, *, episodes=1, viewer=False, control_steps=None, duration=None, command=None, keymap='wasd', scene_config='standard', physics_backend=None, simulation_device='cpu', renderer='hybrid', gpu_id=0, termination_behavior=None, cache_dir=None, offline=False)[source]#
Resolve one Motion Profile and run its visual evaluation.
- Parameters:
profile (
MotionProfile) – Provider-built profile containing the DexSim Policy Spec.episodes (
int) – Number of independent runs.viewer (
bool) – Open the DexSim Viewer.control_steps (
int|None) – Exact number of applied policy commands per run.duration (
float|None) – Convenience duration converted by DexSim to policy steps.command (
tuple[float,...] |None) – Optional task command override.keymap (
str) – Viewer command keys, eitherwasdorarrows.scene_config (
str|Path) – Built-in scene style or custom YAML path.physics_backend (
str|None) – Optional DexSim physics backend override.simulation_device (
str) –cpuorgpu.renderer (
str) – DexSim renderer.gpu_id (
int) – Selected GPU index.termination_behavior (
str|None) – Policy termination handling override.cache_dir (
str|Path|None) – Motion Policy Kit resource cache.offline (
bool) – Use resources already available in the cache.
- Return type:
- Returns:
Normalized inputs, episode results, and aggregate metrics.
EmbodiChain Viewer Bridge#
Connect an EmbodiChain task Viewer to Motion Policy Evaluator.
Classes:
Expose one original EmbodiChain RL Environment to the Evaluator. |
|
Run an EmbodiChain Policy from the task observation in each frame. |
|
Result of visualizing one Policy in its EmbodiChain task. |
Functions:
|
Visualize an EmbodiChain Policy in the task used for training. |
- class embodichain.learning.rl.policy_evaluation.viewer.EmbodiChainTaskEnvironment[source]#
Bases:
objectExpose one original EmbodiChain RL Environment to the Evaluator.
Methods:
__init__(env, *, seed[, command, keymap])close()Close the original task Environment.
metrics()Return task metrics and completed episode aggregates.
open_viewer(title)Apply the evaluation title to the task Viewer.
poll()Report when the native Viewer is closed or Escape is pressed.
reset()Run the task's original reset and return its observation.
step(action)Apply one raw Policy action through the task's original action path.
Keep a paused Viewer responsive until it is closed.
Attributes:
Return the latest observation and task state.
Return completed episode summaries.
Return the backend selected by the original task Environment.
Return the timing used by the original task Environment.
Return whether the original task Viewer remains open.
- property current_frame: EvaluationFrame#
Return the latest observation and task state.
- property episodes: tuple[Mapping[str, float | int | bool | str], ...]#
Return completed episode summaries.
- metrics()[source]#
Return task metrics and completed episode aggregates.
- Return type:
dict[str,float]
- property physics_backend: str#
Return the backend selected by the original task Environment.
- property policy_context: PolicyContext#
Return the timing used by the original task Environment.
- poll()[source]#
Report when the native Viewer is closed or Escape is pressed.
- Return type:
str|None
- reset()[source]#
Run the task’s original reset and return its observation.
- Return type:
EvaluationFrame
- step(action)[source]#
Apply one raw Policy action through the task’s original action path.
- Return type:
EnvironmentStep
- property viewer_is_open: bool#
Return whether the original task Viewer remains open.
- class embodichain.learning.rl.policy_evaluation.viewer.EmbodiChainTaskPolicyAdapter[source]#
Bases:
objectRun an EmbodiChain Policy from the task observation in each frame.
Methods:
__init__(policy, device)close()Restore the Policy mode used before evaluation.
infer(frame)Run the same observation and deterministic Policy path as RL evaluation.
metrics()Return Policy-side metrics.
reset(frame)Validate that the Environment supplied the next observation.
setup(context)Select deterministic inference for this evaluation.
- infer(frame)[source]#
Run the same observation and deterministic Policy path as RL evaluation.
- Return type:
PolicyOutput
- class embodichain.learning.rl.policy_evaluation.viewer.NativeViewerResult[source]#
Bases:
objectResult of visualizing one Policy in its EmbodiChain task.
Methods:
__init__(task_id, reason, simulation_time, ...)Attributes:
- __init__(task_id, reason, simulation_time, simulation_steps, control_steps, effective_duration, requested_duration, episodes, metrics)#
-
control_steps:
int#
-
effective_duration:
float#
-
episodes:
tuple[Mapping[str,float|int|bool|str],...]#
-
metrics:
Mapping[str,float]#
-
reason:
str#
-
requested_duration:
float|None#
-
simulation_steps:
int#
-
simulation_time:
float#
-
task_id:
str#
Run Discovery and Reports#
Index a training run for standalone policy evaluation.
Classes:
Resolved paths from one EmbodiChain training run. |
Functions:
|
Snapshot training configs and write the minimal run manifest. |
- class embodichain.learning.rl.policy_evaluation.manifest.RunManifest[source]#
Bases:
objectResolved paths from one EmbodiChain training run.
Methods:
__init__(root, configs, checkpoints)load(run)Load
run-manifest.jsonand resolve its referenced files.select_checkpoint([requested])Select
bestorlatestand return its resolved path.Attributes:
- __init__(root, configs, checkpoints)#
-
checkpoints:
Mapping[str,Path|None]#
-
configs:
Mapping[str,Path]#
- classmethod load(run)[source]#
Load
run-manifest.jsonand resolve its referenced files.- Parameters:
run (
str|Path) – EmbodiChain training run directory.- Return type:
- Returns:
Resolved manifest.
-
root:
Path#
- embodichain.learning.rl.policy_evaluation.manifest.write_run_manifest(run, *, train_config, latest_checkpoint, best_checkpoint=None, gym_config=None)[source]#
Snapshot training configs and write the minimal run manifest.
- Parameters:
run (
str|Path) – Training run directory containing the checkpoints.train_config (
str|Path) – Training config used for the run.latest_checkpoint (
str|Path) – Final saved checkpoint.best_checkpoint (
str|Path|None) – Best checkpoint when evaluation selected one.gym_config (
str|Path|None) – Referenced task config when the trainer uses one.
- Return type:
Path- Returns:
Written manifest path.
Write timestamped policy evaluation reports.
Functions:
|
Write |
- embodichain.learning.rl.policy_evaluation.report.write_evaluation_report(parent, payload)[source]#
Write
evaluation.jsonunder a new timestamped directory.- Parameters:
parent (
str|Path) – Output parent directory.payload (
Mapping[str,Any]) – Evaluation inputs and results.
- Return type:
Path- Returns:
Written report path.
Command Line#
Unified policy evaluation for EmbodiChain training runs.
Functions:
|
Run policy evaluation from the unified EmbodiChain CLI. |
|
Parse |
|
Run Headless or Viewer evaluation and write |
- embodichain.learning.rl.policy_evaluation.cli.cli(argv=None)[source]#
Run policy evaluation from the unified EmbodiChain CLI.
- Return type:
None