Policies¶
ndm_gym.policies.tracking_policy
¶
Motion-tracking policy: motion encoder + shared decoder (paper Table A.4).
TrackingPolicy
¶
TrackingPolicy(
obs_dim: int,
goal_dim: int,
hist: int = 10,
z_dim: int = 32,
)
Bases: Module
a = dec(enc(g), o_{t-9:t}); deterministic, latent z in R^32 bounded by tanh.
forward
¶
forward(obs_hist: Tensor, goal: Tensor) -> torch.Tensor
obs_hist: (B, hist, obs_dim) noisy observations, newest last.
encode
¶
encode(goal: Tensor) -> torch.Tensor
The latent z of forward's goal (its first half; SuperTrack's --pi_encode_once).
decode
¶
decode(z: Tensor, obs_hist: Tensor) -> torch.Tensor
forward's action from the goal's latent z (its second half).
ndm_gym.policies.critic
¶
State-value critic (paper Table A.4).
ndm_gym.policies.hoi_policy
¶
Policy for HDMI's human-object interaction tasks: the LAFAN1 tracking policy's structure and sizes (TrackingPolicy)
on HDMI's observation groups (ndm_gym.tasks.hdmi): the command group (future reference) through the goal encoder, the
proprioceptive and object groups into the decoder. Its output is HDMI's residual over the reference: the action is
(q_ref - q0) / scale of the current frame plus this output (the teacher's residual, §3.1). With priv_dim
(train_hoi --priv_obs), the decoder also reads HDMI's privileged group, encoded as HDMI's PPO teacher encodes it
(an MLP of the privileged and object groups to 256 features; ndm_gym.algos.ppo_hoi).
HOIPolicy
¶
HOIPolicy(
command_dim: int,
policy_dim: int,
object_dim: int,
z_dim: int = 32,
priv_dim: int = 0,
)
Bases: Module
a = dec(tanh enc(command), policy, object[, penc(priv, object)]): deterministic, latent z in R^32.
ndm_gym.policies.muscle_policy
¶
Policy for tracking with MuscleVAE's muscle-actuated character (docs/musclevae_design.md §4): the LAFAN1 tracking policy's structure and sizes (TrackingPolicy: a motion encoder of the goal and a decoder, 2048-1024-512-256 each, a 32-value latent through tanh) on MuscleVAE's inputs (ndm_gym.policies.musclevae_pretrained): the observation of the state (371 values) and the muscle state (15) into the decoder, the tracked reference frame's observation (371) through the encoder; 284 muscle targets out. MuscleVAE's policy sees no history and one target frame, and neither does this one.
MusclePolicy
¶
MusclePolicy(z_dim: int = 32)
Bases: Module
a = dec(tanh enc(goal), obs): deterministic, latent z in R^32.
policy_observation
¶
policy_observation(S, F: Tensor) -> torch.Tensor
MuscleVAE's policy input (..., 386) of a state (tasks.muscle_tracking): the observation (MU:204-234) with their backward-difference angular velocity, then the muscle state.
goal_table
¶
goal_table(
ref: MuscleReference, chunk: int = 4096
) -> torch.Tensor
The observation (F, 371) of every reference frame: the goal of a step that tracks it, as their policy's target.
ndm_gym.policies.hand_policy
¶
Policy for hand-object tracking: an MLP from the observation and the goal (tasks.hand_tracking) to one action per joint in [-1, 1], an offset of the position target about the reference pose.
ndm_gym.policies.quadrotor_policy
¶
Policy for quadrotor tracking: an MLP from the observation and the goal (tasks.quadrotor_tracking) to the action in [-1, 1], offsets of the thrust and the body rates about the reference's.
ndm_gym.policies.quadruped_policy
¶
Policy for quadruped motion tracking: an MLP from the observation and the goal (tasks.quadruped_tracking) to one action per joint in [-1, 1], an offset of the position target about the reference pose.