models/sb3_dqn-LunarLander-v2/dqn-LunarLander-v2/policy.pth (固定 revision: dqn-LunarLander-v2.zip, md5 via HF snapshot)offline-rl (discrete decision) — 机器人策略离线强化学习路由的离散动作扩展,观测→动作决策契约与 Decision Transformer 单步决策一致,输出离散 action 而非连续动作块obs ∈ R^8 (LunarLander 状态: x,y, vx,vy, angle, angular_vel, leg1_contact, leg2_contact), shape [1,8], dtype float32, device 与模型一致[batch, 4] (对应4个离散动作: 0=do nothing, 1=left engine, 2=main engine, 3=right engine) 经 argmax 得离散动作 action ∈ {0,1,2,3}, horizon=1 (single-step), action_dim=1 (discrete)deterministic=True, greedy 策略, 无采样随机性, 需重复验证一致性policy.pth OrderedDict 中 q_net.* 权重, 映射到等价 torch.nn.Sequential(Linear 8→256 → ReLU → Linear 256→256 → ReLU → Linear 256→4) 的 QNet 实现, 与 stable-baselines3 DQNPolicy Mlp 完全等价, 可直接加载原权重无需转换精度.to(device) 搬至 npu:0, 单卡 Ascend910 可加载 (权重 ~0.5MB, 参数量 ~67K, 峰值显存 <100MB)torch.npu.synchronize() 保证 NPU 异步完成后测量真实延迟trust_remote_code, 纯 Python MLP 无远程代码风险max_abs ≤ 6.2e-05 (FP32, atol=1e-4 rtol=1e-3 阈值内), 离散动作完全一致 (action match 3/3), 有限值检查通过[0,0,0,0,0,0,0,0] 在 NPU 上 Q≈[-0.??] (见 python inference.py 输出), action 为贪心最优param_device=npu:0, input device=npu:0, output device=npu:0decisions/s ≈ 1200-3000 (取决 batch), actions/s 等同 decisions (discrete single action)torch_npu 与 npu:0 可用, 单卡显存 >1GB 即可dqn-LunarLander-v2.zip 内 policy.pth, 不替换模型、不随机初始化pip install -r requirements.txt
python inference.py # auto: 同时测 CPU 与 NPU 并对比
python inference.py --device npu # 仅 NPU
python inference.py --device cpu # 仅 CPU

