AGENT SKILL

keras-gan

Use Keras-GAN legacy Keras/TensorFlow GAN scripts for image generation, image-to-image translation, inpainting, PixelDA, and SRGAN workflows with safe inspection and troubleshooting.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
keras-gan
license
MIT
metadata
{ "disco-role": "operating" }
description
Use Keras-GAN legacy Keras/TensorFlow GAN scripts for image generation, image-to-image translation, inpainting, PixelDA, and SRGAN workflows with safe inspection and troubleshooting.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

Keras-GAN Repo Skill

Use this repo skill when a task involves the Keras-GAN repository: a stale but useful collection of standalone educational Keras implementations of generative adversarial networks. The repository is not an installable Python package; treat each model directory as a standalone script family and use the bundled helpers here to inspect, validate, or adapt it safely.

Do not launch the original scripts' __main__ defaults as routine checks. Many defaults run thousands of epochs, may download Keras datasets or external archives, and write relative images/ or saved_model/ outputs.

First steps

  1. Read references/compatibility-and-install.md before running any Keras code. The scripts target legacy standalone Keras 2.x with TensorFlow 1.x behavior.

  2. Run the bundled runtime checker when diagnosing an environment:

    python scripts/check_legacy_runtime.py
    python scripts/check_legacy_runtime.py --json
    
  3. Use references/model-catalog.md to choose the right model family.

  4. Route to the smallest focused sub-skill below.

  5. Use references/troubleshooting.md for cross-cutting install/import, stale dependency, output-path, data-download, and long-training failures.

  6. Read references/repo-provenance.md before deciding whether this skill is current for a checkout.

Route by task

User task or signal Use
Vanilla GAN, DCGAN, CGAN, AC-GAN, SGAN, InfoGAN, LSGAN, BGAN, BiGAN, Adversarial Autoencoder, CoGAN, DualGAN, WGAN, or WGAN-GP on MNIST-style arrays sub-skills/mnist-generators/SKILL.md
Compare GAN variants, inspect class APIs, run static inventory, or smoke-test representative model constructors without training sub-skills/mnist-generators/SKILL.md
CycleGAN, DiscoGAN, Pix2Pix, apple2orange, edges2shoes, facades, unpaired A/B domains, paired side-by-side image translation, PatchGAN label shapes sub-skills/image-translation/SKILL.md
Validate image-translation dataset folders before training or adapting code sub-skills/image-translation/scripts/check_dataset_layout.py via the image-translation sub-skill
CCGAN, ContextEncoder, context inpainting, CIFAR cats/dogs missing patches, PixelDA MNIST-to-MNIST-M adaptation, SRGAN 4x super-resolution, CelebA/VGG19 risk sub-skills/domain-and-restoration/SKILL.md
Validate PixelDA cache files, SRGAN image directory, or restoration workflow output directories without importing Keras sub-skills/domain-and-restoration/scripts/check_restoration_layout.py via the domain-and-restoration sub-skill

Operating constraints

  • Use a legacy runtime for faithful execution: Python 3.7-era, TensorFlow 1.15.x, Keras 2.2.x, keras-contrib 2.0.x, NumPy 1.18.x, SciPy 1.2.x, Matplotlib, Pillow, scikit-image, h5py, and protobuf below 3.21 are the verified compatibility family.
  • Modern Keras 3 or TensorFlow 2 errors are usually dependency-staleness issues, not evidence that the original GAN idea is invalid.
  • Treat GPU as optional acceleration. The selected safe verification scope is CPU-compatible; full training can use GPUs only after the user accepts runtime, data, and output side effects.
  • Original dataset download scripts and Keras dataset loaders can perform network access. Ask before running them when network is not already authorized.
  • Keep all generated outputs in caller-controlled run directories. The source scripts write relative paths such as images/, images/<dataset_name>/, and saved_model/.

Safe verification patterns

  • Static source inventory is preferred before Keras imports.
  • Constructor smoke checks are acceptable only in a legacy-compatible runtime and should never call train(...).
  • Dataset layout helpers are safe: they do not import Keras, download data, train models, or mutate datasets.
  • Full native training loops are skip-expensive by default. Use one-epoch wrappers with synthetic or already-cached data only after the user accepts short compute and file writes.

When not to use this skill

  • The user needs a maintained GAN framework, modern tf.keras, PyTorch GAN implementations, or production-grade training infrastructure rather than Keras-GAN's educational scripts.
  • The task is Stable Diffusion, Diffusers, LoRA, ComfyUI, or modern image-generation pipelines unrelated to this repository.
  • The task is repository maintenance unrelated to using/adapting the GAN scripts; use a Python repository-maintenance workflow instead.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351