policies-and-customization
Customize Stable-Baselines3 policies, feature extractors, Dict-observation policies, exploration noise, gSDE, and HER replay buffers safely.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- policies-and-customization
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Customize Stable-Baselines3 policies, feature extractors, Dict-observation policies, exploration noise, gSDE, and HER replay buffers safely.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/feature-extractors.md5.8 KB
- 参考文档references/her-and-replay-buffers.md3.8 KB
- 参考文档references/noise-and-exploration.md3.4 KB
- 参考文档references/policy-customization.md5.0 KB
- 参考文档references/troubleshooting.md4.2 KB
- 脚本scripts/inspect_policy.py8.7 KB
03 SKILL.md 正文
Policies and Customization
Use this sub-skill when an SB3 task involves policy_kwargs, policy aliases, custom PyTorch policy modules, BaseFeaturesExtractor, MultiInputPolicy, action noise, generalized State-Dependent Exploration (gSDE), or HerReplayBuffer.
Routes
- For
net_arch,activation_fn, policy aliases, optimizer kwargs, and policy save/load persistence, read policy-customization. - For custom
BaseFeaturesExtractor, image preprocessing,CombinedExtractor,MultiInputPolicy, and Dict observations, read feature-extractors. - For
NormalActionNoise,OrnsteinUhlenbeckActionNoise, vectorized noise, and gSDE constraints, read noise-and-exploration. - For Hindsight Experience Replay setup, goal-env requirements, and the legacy
HER()import error, read her-and-replay-buffers. - For common failures and fast diagnosis checklists, read troubleshooting.
Safe Inspection
Run the bundled script to instantiate a tiny model without learning and print the resolved policy, spaces, device, and architecture summary:
python sub-skills/policies-and-customization/scripts/inspect_policy.py --algorithm PPO --policy MlpPolicy
python sub-skills/policies-and-customization/scripts/inspect_policy.py --algorithm DQN --policy MultiInputPolicy --dict-env
python sub-skills/policies-and-customization/scripts/inspect_policy.py --algorithm SAC --policy MlpPolicy --action-noise normal --use-sde
The script uses safe defaults, supports --help, and trains only when --train-steps is explicitly set above zero.
Boundaries
- Use the environment/vectorization sibling for environment checker, wrappers, vector env, and
Dictspace validation beyond policy choice. - Use the training/algorithms sibling for choosing PPO vs DQN vs SAC/TD3/DDPG and algorithm-specific learning schedules.
- Use the evaluation/persistence sibling for evaluation loops and save/load workflows; this sub-skill only notes policy customization persistence and custom-object pitfalls.
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).