mnist-generators
Use, inspect, adapt, and troubleshoot Keras-GAN standalone MNIST-style generator scripts that do not require paired image-domain directories.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mnist-generators
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use, inspect, adapt, and troubleshoot Keras-GAN standalone MNIST-style generator scripts that do not require paired image-domain directories.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/model-api-reference.md12.8 KB
- 参考文档references/troubleshooting.md6.3 KB
- 参考文档references/workflows.md7.0 KB
- 脚本scripts/dry_run_model.py5.0 KB
- 脚本scripts/model_inventory.py11.5 KB
03 SKILL.md 正文
MNIST Generators
Use this sub-skill for Keras-GAN's standalone educational scripts that load Keras MNIST-like arrays directly instead of requiring paired image-domain folders. It covers GAN, DCGAN, CGAN, ACGAN, SGAN, InfoGAN, LSGAN, BGAN, BiGAN, Adversarial Autoencoder, CoGAN, DualGAN, WGAN, and WGAN-GP.
Do not start a full training run from a script's if __name__ == "__main__" defaults unless the user explicitly accepts long CPU/GPU training, dataset download/cache behavior, and generated file writes.
Route elsewhere
- CycleGAN, DiscoGAN, and Pix2Pix need image-domain or paired-image datasets: use the image-translation sub-skill.
- CCGAN, context encoder, PixelDA, and SRGAN need inpainting, domain-adaptation, restoration, super-resolution, or image-directory handling: use the domain-and-restoration sub-skill.
- Cross-cutting installation issues belong in the root Keras-GAN compatibility and troubleshooting references; this sub-skill records only the MNIST-generator-specific symptoms.
Fast workflow
-
Choose the script/class from references/model-api-reference.md. Check the train signature, default
__main__epoch count, output path, and special loss methods before adapting. -
From this generated skill's root directory, run static inspection without importing Keras:
python sub-skills/mnist-generators/scripts/model_inventory.py --repo-root /path/to/a/Keras-GAN-checkout python sub-skills/mnist-generators/scripts/model_inventory.py --repo-root /path/to/a/Keras-GAN-checkout --json -
For dependency or constructor smoke checks, default to import-only and add
--constructonly after confirming a legacy Keras/TensorFlow runtime:python sub-skills/mnist-generators/scripts/dry_run_model.py --repo-root /path/to/a/Keras-GAN-checkout --model gan python sub-skills/mnist-generators/scripts/dry_run_model.py --repo-root /path/to/a/Keras-GAN-checkout --model dcgan --construct python sub-skills/mnist-generators/scripts/dry_run_model.py --repo-root /path/to/a/Keras-GAN-checkout --model wgan-gp -
Follow references/workflows.md for safe adaptation, short smoke runs, output-directory handling, and model comparison.
-
Use references/troubleshooting.md when imports fail, WGAN-GP cannot find
_Merge,images/orsaved_model/is missing, Keras dataset downloads are blocked, or a run is taking too long.
Safety rules
- The bundled inventory script is static and safe: no Keras import, no network, no training, and no writes except optional shell redirection by the caller.
- The bundled dry-run script imports a selected source file and constructs a model only when
--constructis supplied; it never callstrain(...). - The original scripts hard-code
images/...and sometimessaved_model/...relative to the current working directory. Create those directories in a temporary run directory before any training smoke. - WGAN-GP's
RandomWeightedAverageuses a legacy private Keras_MergeAPI and a fixed batch dimension of 32; treat modern-Keras failures as compatibility diagnostics, not model-quality failures.
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).