image-hypermodels
Routes KerasTuner's built-in HyperResNet, HyperXception, HyperEfficientNet, and HyperImageAugment workflows, including shape contracts, search-space overrides, augmentation composition, backend layout, and safe build gating.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- image-hypermodels
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Routes KerasTuner's built-in HyperResNet, HyperXception, HyperEfficientNet, and HyperImageAugment workflows, including shape contracts, search-space overrides, augmentation composition, backend layout, and safe build gating.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md9.1 KB
- 参考文档references/troubleshooting.md6.1 KB
- 参考文档references/workflows.md6.9 KB
- 脚本scripts/smoke_build.py5.5 KB
03 SKILL.md 正文
Image Hypermodels
Use this sub-skill when a task names HyperResNet, HyperXception,
HyperEfficientNet, or HyperImageAugment, or asks for a KerasTuner image
architecture/augmentation search space. Route generic tuner and
HyperParameters questions to the parent skill's generic tuning route.
Route by intent
- ResNet classifier or feature extractor → read
references/api-reference.mdforHyperResNet, then follow the staged architecture workflow inreferences/workflows.md. - Xception classifier or feature extractor → use the same API reference and workflow, checking the Xception-specific hyperparameters before building.
- EfficientNet classifier → read the EfficientNet and composition sections first. Its Keras Applications call uses the default ImageNet weights and may download files; do not build it implicitly or in an offline smoke check.
- Searchable image augmentation → use
HyperImageAugment. Choose fixed sequential mode withaugment_layers=0/None, or RandAugment-like mode with a positive integer or two-integer range. - Augmentation plus EfficientNet → pass a Keras
ModelorHyperModelasaugmentation_model; the latter is built with the sameHyperParametersobject. Use the explicit expensive-build gate described in the workflow.
Before calling build(hp)
- Check
keras_tuner.__version__and the activekeras.backend.image_data_format().input_shapeexcludes the batch axis and must use the active channel layout. - Supply at least one of
input_shapeandinput_tensor. If both are supplied, the implementation usesinput_tensorand obtains its source inputs; do not rely oninput_shapeto override a tensor's shape. - For ResNet/Xception, set
include_top=Trueonly whenclassesis supplied. Withinclude_top=False,classesis not required and the returned model is a feature extractor without the classifier compile step. - For EfficientNet, always supply a truthy
classesvalue. It has noinclude_topargument: the built-in hypermodel always constructs and compiles its classifier head. - Decide whether a build is safe before starting it. ResNet/Xception can be slow, and EfficientNet also resizes to a variant-specific image size and can fetch ImageNet weights.
Progressive disclosure
- Read
references/api-reference.mdfor exact 1.4.8 signatures, validation, model outputs, hyperparameter names/defaults, transform ranges, and backend layout rules. - Read
references/workflows.mdfor safe construction, deterministic hyperparameter overrides, input-tensor composition, augmentation modes, and staged EfficientNet use. - Read
references/troubleshooting.mdfor validation errors, backend shape failures, stale test expectations, slow/OOM builds, and weight-cache/offline recovery. - From the skill root, run
sub-skills/image-hypermodels/scripts/smoke_build.pyfor a flag-gated augmentation-only check. It uses the installed package by default; pass--repo-root <CHECKOUT>to select a source checkout explicitly. Opt into architecture builds explicitly; opt into EfficientNet only when a possible network/weight-cache access is acceptable and an external timeout is set.
Operating guardrails
- Treat the installed signatures and the current implementation's search-space
names as the contract. In particular, current augmentation names are
augment_layersandfactor_<transform>; do not substitute olderrandaug_count/randaug_magnames. - Prefer an existing
HyperParametersobject withFixed,Choice, or compatible values to make a smoke build deterministic. A pre-existing name whose domain conflicts with the hypermodel can fail during build. - Assert the model input(s), output shape, selected
hp.values, and compiled state appropriate toinclude_topbefore starting a search. - Keep heavyweight or weight-fetching builds behind a user-visible flag or a bounded subprocess/time limit. Never put an EfficientNet build in an import check or an automatic default smoke path.
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).