gail-imitation
Prepare expert demonstrations and reason about GAIL imitation learning in pytorch-a2c-ppo-acktr-gail.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- gail-imitation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Prepare expert demonstrations and reason about GAIL imitation learning in pytorch-a2c-ppo-acktr-gail.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/gail-data-format.md3.1 KB
- 参考文档references/gail-workflow.md4.5 KB
- 参考文档references/troubleshooting.md4.1 KB
- 脚本scripts/convert_gail_h5_to_pt.py6.2 KB
03 SKILL.md 正文
gail-imitation
Use this sub-skill when the task is about Generative Adversarial Imitation Learning (GAIL) in this repo: preparing expert demonstrations, converting expert HDF5 trajectories to the .pt format consumed by the code, checking ExpertDataset behavior, or explaining how --gail changes the training loop.
Route first
- Expert data schema or conversion: read
references/gail-data-format.md, then usescripts/convert_gail_h5_to_pt.pyfor a safe local conversion helper. - End-to-end GAIL flow: read
references/gail-workflow.mdfor howmain.py --gaillocates expert files, createsExpertDataset, updatesDiscriminator, and replaces rewards. - Failures and environment issues: read
references/troubleshooting.mdbefore changing code. - Generic PPO/MuJoCo command construction, tuning, checkpoint playback, or evaluation belongs in
../training-workflows/. - Policy, rollout storage, action distribution, or optimizer internals belong in
../model-components/.
Operating constraints
- Do not download expert demonstrations or install simulators unless the user explicitly asks; upstream expert data is external and not bundled.
- Do not launch long MuJoCo, PyBullet, Atari, or CUDA training as a smoke check. Prefer converter help, tiny synthetic HDF5 fixtures, and optional
ExpertDatasetloading. --gailis valid only for vector observations in the current training loop; image/Atari observations trip thelen(envs.observation_space.shape) == 1assertion.setup.pydoes not declareh5py; ensure it is installed from the environment or requirements evidence before using HDF5 conversion.
Bundled helper
python sub-skills/gail-imitation/scripts/convert_gail_h5_to_pt.py \
--h5-file gail_experts/trajs_halfcheetah.h5 \
--pt-file gail_experts/trajs_halfcheetah.pt
The helper performs local validation only and writes a PyTorch dictionary with states, actions, rewards, and lengths tensors.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).