计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
model-internals【效率与协作】Explain MUNIT trainer, generator, discriminator, and porting internals for safe architecture modification.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a Researcher is modifying, debugging, or porting the MUNIT/UNIT model code: trainer class contracts, AdaIN generator wiring, UNIT VAE generator behavior, multi-scale discriminator losses, normalization/activation/padding options, checkpoint compatibility, and legacy PyTorch migration issues.
This sub-skill is self-contained operating knowledge distilled from the repository trainer, network, utility, config, tutorial, and CLI evidence. It intentionally avoids depending on the original source checkout for runtime guidance.
Use this sub-skill for:
MUNIT_Trainer(hyperparameters) and UNIT_Trainer(hyperparameters) object graphs, update methods, losses, save/resume state, and CUDA assumptions.AdaINGen(input_dim, params), VAEGen(input_dim, params), MsImageDis(input_dim, params), encoders, decoder, blocks, AdaIN, LayerNorm, or related helpers.gen, dis, input_dim_*, loss, or style-code settings.Reroute instead:
../training/.../inference-and-evaluation/.../environment-and-setup/.../data-and-configuration/.Read references/architecture.md for the model graph and dataflow before editing code.
Read references/api-reference.md for class signatures, expected config keys, method behavior, and return shapes.
For ports or extensions, read references/porting-and-extension.md before touching deprecated PyTorch APIs or checkpoint loading.
For failure diagnosis, use references/troubleshooting.md to map symptoms to causes and safe fixes.
Run the static helper against a target checkout or config when available. It does not import MUNIT modules, allocate CUDA tensors, download weights, or instantiate trainers:
python scripts/inspect_munit_architecture.py --help
python scripts/inspect_munit_architecture.py \
--repo-root /path/to/user/munit-checkout \
--config configs/demo_edges2handbags_folder.yaml \
--trainer MUNIT
a and b entries.MUNIT_Trainer uses AdaIN generators and a sampled style code with shape [batch, gen.style_dim, 1, 1]; UNIT_Trainer uses VAE-style content generators and needs UNIT KL loss weights not present in the MUNIT demo configs..cuda() directly. Treat CPU-only inspection as static verification, not proof that unmodified training or inference will run.vgg_w > 0, the legacy utility may try to create a model directory, download a VGG .t7 file, convert it with load_lua, and save converted weights. Keep that side effect out of static checks.references/api-reference.md - verified class signatures, trainer methods, network constructors, config keys, and selected utility helpers.references/architecture.md - MUNIT/UNIT model graph, AdaIN parameter flow, discriminator scales, and loss/update sequence.references/porting-and-extension.md - safe extension and modernization guidance for style dimensions, devices, PyTorch APIs, YAML, VGG, and state dicts.references/troubleshooting.md - symptom-driven fixes for AdaIN, checkpoints, unsupported options, GAN loss choices, legacy APIs, InstanceNorm conversion, CUDA assumptions, and VGG download side effects.scripts/inspect_munit_architecture.py - self-contained static inspector for source text and config files.