discrete-control
Build, configure, troubleshoot, and lightly verify discrete-action keras-rl DQN, Double/Dueling DQN, SARSA, CEM, memories, policies, and Atari-style processor concepts.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- discrete-control
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Build, configure, troubleshoot, and lightly verify discrete-action keras-rl DQN, Double/Dueling DQN, SARSA, CEM, memories, policies, and Atari-style processor concepts.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md7.6 KB
- 参考文档references/atari-and-processors.md4.3 KB
- 参考文档references/troubleshooting.md7.5 KB
- 参考文档references/workflows.md7.0 KB
- 脚本scripts/build_discrete_agents_smoke.py13.7 KB
03 SKILL.md 正文
discrete-control
Read when
Use this sub-skill for keras-rl workflows with discrete action spaces and language such as DQN, Double DQN, dueling DQN, SARSA, CEM, CartPole, Atari processor, SequentialMemory, EpisodeParameterMemory, EpsGreedyQPolicy, or BoltzmannQPolicy.
What this sub-skill owns
- Building and compiling
DQNAgent, includingenable_double_dqn=Trueandenable_dueling_network=Truewithdueling_typeavg,max, ornaive. - Building and compiling
SARSAAgentwithout replay memory. - Building and compiling
CEMAgentwithEpisodeParameterMemoryandcompile()without an optimizer. - Choosing
SequentialMemory,EpisodeParameterMemory, and common discrete exploration policies. - Discrete-agent compile/build smoke checks with the bundled helper script.
- Atari DQN preprocessing concepts as reference-only guidance; this sub-skill does not provide a full Atari runner.
Route elsewhere
- Shared
Agent.fit/Agent.testlifecycle details, callback wiring,Processorbase-class implementation depth,FileLogger,WandbLogger, and log visualization belong to thecore-extension-and-loggingsub-skill. - DDPG, NAF, actor/critic models, random processes, MuJoCo, Pendulum, and continuous action spaces belong to the
continuous-controlsub-skill.
Backend stance
keras-rl is legacy Keras 2.x code. Prefer a Keras-2-compatible backend stack and run a compile-only smoke check before spending time on training. Some TensorFlow-backed legacy stacks fail when keras-rl inspects symbolic model outputs; if that happens, switch to a compatible legacy backend or patch the compatibility issue before using DQN-style agents.
Quick operating route
- Determine
nb_actionsfrom the environment's discrete action space. - Build a Keras model whose final output has exactly
nb_actionsunits. For replay-memory agents, include the memory window in the model input shape. - Pick the agent family:
- DQN / Double DQN / Dueling DQN:
DQNAgent+SequentialMemory. - SARSA:
SARSAAgentwith no replay memory argument. - CEM:
CEMAgent+EpisodeParameterMemory.
- DQN / Double DQN / Dueling DQN:
- Compile before any
fit,test,load_weights/target-network usage, or smoke action checks. - Run the bundled compile/build helper with
--agent allor the specific agent before training.
Runtime references and helpers
- API reference: constructors, compile signatures, memory/policy parameters, and gotchas.
- Workflows: build/compile recipes for DQN, Double DQN, Dueling DQN, SARSA, and CEM.
- Atari and processors: reference-only Atari preprocessing and processor concepts.
- Troubleshooting: shape, compile, backend, memory, Atari, callbacks, and Gym compatibility failures.
- Build discrete agents smoke helper: safe compile/build-only helper with optional tiny training disabled by default.
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).