Model Name: Tunamelon/ppo-LunarLander-v2
Revision: f0b8ee438f823e7bbadf44d71821cd5c7257a4c1 (ppo-LunarLander-v2.zip 105KB, policy.pth 92KB)
Model Weight URL: https://huggingface.co/Tunamelon/ppo-LunarLander-v2
Model Type: Reinforcement Learning (PPO, ActorCriticPolicy)
Task Type: reinforcement-learning / offline-rl (vector observation → discrete action)
Architecture Family: MLP Policy (Tanh 64×2 + discrete action head)
Pipeline Tag: reinforcement-learning
Weights: ppo-LunarLander-v2.zip (105 KB zip: data, policy.pth 92KB, pytorch_variables, policy.optimizer) + ppo-LunarLander-v2/policy.pth (92KB) – upstream repo contains PPO_70/75/84/89/90 variants
License: Unknown (check upstream README)
PPO agent trained on Gymnasium LunarLander-v2 (Box(8) obs, Discrete(4) action) with Stable-Baselines3 2.0.0a5, 5M timesteps, Tanh MLP 64×2, gamma 0.999, gae_lambda 0.98, lr 3e-4. Input is 8-dim lunar state (x, y, vx, vy, angle, angular_vel, leg1_contact, leg2_contact) but checkpoint's pi_features_extractor expects 9 dims (legacy SB3 architecture with separate pi/vf extractors, weight shape [64,9]). This adaptation auto-detects has_pi and handles both 9-dim legacy and 8-dim modern checkpoints. Output is discrete logits [B,4] → softmax probs → argmax action 0: do nothing, 1: fire left engine, 2: fire main engine, 3: fire right engine.
| Field | Value |
|---|---|
| Input Format | obs [batch, obs_dim] float32, vector observation |
| Axis Order | [B, OBS_DIM] – MLP input |
| Observation Dim | 9 (legacy checkpoint, [64,9] weight) detected; also supports 8 for PPO_70 variant |
| Observation Bounds | x ∈ [-1.5,1.5], y ∈ [0,1.5], vx/vy ∈ [-1,1], angle ∈ [-π,π], angular_vel ∈ [-2,2], contacts ∈ {0,1} – synthetic uses N(0,0.5)+0.1*b clipped |
| Action Dim | 4 discrete (logits [B,4], probs softmax, action argmax) |
| Horizon / Chunk | 1 (single-step policy; no action chunk, no diffusion) |
| Hidden Layers | Legacy: pi_features 9→64→64 Tanh, then policy_net 64→64→64 Tanh; modern: policy_net 8→64→64 Tanh |
| Action Head | Linear(64→4) logits, no log_std (discrete) |
| Dtype | float32 (weights fp32, compute fp32) |
| Batch (demo) | 4 (tested also 1 and 16) |
| Preprocessing | None (raw obs directly to Linear, Tanh); synthetic deterministic N(0,0.5)+0.1*b seed 42, contacts binarized |
| Data Source | Synthetic deterministic (no Gym env required for forward), reproducible seed 42; also validated against _last_obs shape (8,8) from training |
| Output | logits [B,4] float32 + action [B] int64 discrete 0-3 – both finite, shape verified |
No Gym environment needed for forward; policy quality _last_obs shown but not used for reward.
torch.npu.is_available()==True, device Ascend910_9362, device_count 2, target npu:0npu-smi info and scripts/check_npu.pypip install -r requirements.txtModel weights: auto-loaded from /opt/atomgit/adapt-npu-agent/working/models/Tunamelon-ppo-LunarLander-v2 if present, else from https://huggingface.co/Tunamelon/ppo-LunarLander-v2 via hf_hub_download (requires HF_ENDPOINT mirror if needed). Needs ppo-LunarLander-v2.zip (105KB) or ppo-LunarLander-v2/policy.pth (92KB).
Default command (runs synthetic demo with NPU):
python inference.pyExpected output includes:
model_name, revision, PPO LunarLander-v2, route offline-rl, arch MLP Tanh 64x2config: num_timesteps 5013504 n_steps 2048 gamma 0.999obs shape [4,9], sample values, statslogits shape [4,4], sample, finite, probsfirst_param device: npu:0, input device: npu:0, NPU logits shape: [4,4] device: npu:0first run (compile) time with torch.npu.synchronize() and second run timemax_abs, allclose, discrete action matchFinal state: SUCCESSSupports different batch sizes (1, 16 validated).
Run: python inference.py (batch=4, obs_dim=9, act_dim=4 discrete, float32, npu:0)
Input:
obs [4,9], sample [0.9634,0.7436,0.4503,-1.0527] contacts [0.0,0.0], mean 0.1472 std 0.5170Output:
logits [4,4], sample [-0.00389,-0.00692,0.00400,0.00610] probs [0.2490,0.2483,0.2510,0.2515] actions [3,0,2,2]logits [4,4], sample [-0.00389,-0.00692,0.00400,0.00610] (max_abs 5.58e-09) actions [3,0,2,2] exact matchfinite True, probs sum 1.0Timing (npu:0, synchronized):
No CPU fallback; all tensors on npu:0, model buffers on npu:0.
Saved CPU/NPU logits to .npy + .json and compared:
python .opencode/skills/npu_adapt_robotics/scripts/validate_policy_outputs.py --cpu /tmp/cpu_tunamelon.json --npu /tmp/npu_tunamelon.json --atol 1e-4 --rtol 1e-3Result: count 16 passed True finite True max_abs 5.58e-09 mean_abs 1.58e-09 tolerance 0.000109 (fp32 atol=1e-4). Shape [4,4] verified, bounds not exceeded, allclose True, discrete actions identical. Differences due to NPU fused ops but well within tolerance.
Benchmark also via benchmark_policy.py with latencies list: avg 0.19 ms p50 0.19 p90 0.20.
Warmup 3, test 10, synchronized:
LunarActor.forward onlyAdditional: batch 1 latency 0.53 ms shape [1,4]; batch 16 latency 0.49 ms shape [16,4] correct.
Three PNGs generated by xterm.js from real logs (render_xterm_evidence.mjs --style raw):
assets/agent_workflow.png – workflow (inspect, download, NPU check, inference, compare, benchmark, validation)assets/npu_device_call.png – npu-smi + torch.npu availability + model param device + input/output deviceassets/model_result.png – full python inference.py outputImages are rendered from actual terminal logs, not screenshots, prompt atomgit@pod-a94f8701860f4700b161b00e290de466:~$ is display label only.

ppo-LunarLander-v2.zip demonstrated, other variants (PPO_70 etc) share similar arch and expected similar NPU behavior but not all tested.