rlmesh.adapters.resolve

functionfrom rlmesh.adapters import resolve[source]

Derive an Adapter for an env/model pair.

resolve(
    env_tags: EnvTags,
    observation_space: object,
    action_space: object,
    model_spec: ModelSpec,
    *,
    trust_entrypoints: bool = False,
    check_inverse: bool = True,
) -> Adapter

Parameters

NameTypeDescription
env_tagsEnvTagsThe environment's observation/action tags.
observation_spaceobjectThe environment's gymnasium observation space (or any space object RLMesh can parse, e.g. an rlmesh.spaces space or a native SpaceSpec).
action_spaceobjectThe environment's gymnasium action space.
model_specModelSpecThe model's declared input/output format.
trust_entrypointsboolAllow module:callable strings in custom inputs to be imported. Leave False for specs from untrusted sources; in-process callables are always allowed. (Custom-encoding entrypoint arms are never run -- a custom encoding executes only where its in-process callable was defined.)
check_inverseboolRound-trip each two-armed CustomEncoding on a probe at resolve time to catch a mispaired encode/decode. Set False for an intentionally non-invertible encoding.

Returns

TypeDescription
AdapterAdapter applying observation preprocessing and action postprocessing.

Raises

TypeDescription
AdapterResolutionErrorIf a model input or action component has no usable counterpart in the env tags and spaces.