AGENT SKILL

data-and-training

Route U-2-Net dataset validation, transform inspection, and safe retraining preparation without starting long training by default.

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

01 前言 Front Matter

name
data-and-training
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Route U-2-Net dataset validation, transform inspection, and safe retraining preparation without starting long training by default.
disable-model-invocation
true

02 资源文件 6

03 SKILL.md 正文

Data and Training

Use this sub-skill when the task is about U-2-Net training data layout, preprocessing transforms, batch/sample fields, the multi-side BCE training loop, or preparing a safe retraining run.

Start here

  1. Confirm the user has a DUTS-style training root or a deliberately adapted equivalent.
  2. Validate image/mask stem pairing with scripts/validate_training_layout.py before discussing a training launch.
  3. Inspect one representative image and optional label with scripts/inspect_data_pipeline.py to confirm RescaleT/ToTensorLab-like output shapes and ranges.
  4. Use training workflow for the exact source training settings and safe adaptation checklist.

Do not start the full training loop by default. The source loop is configured for epoch_num=100000 and data-dependent long execution; require explicit user approval and a bounded run plan first.

Core facts

  • The training dataset is expected under train_data/DUTS/DUTS-TR/DUTS-TR/im_aug/*.jpg with matching masks under train_data/DUTS/DUTS-TR/DUTS-TR/gt_aug/*.png by the same filename stem.
  • SalObjDataset yields sample dictionaries with imidx, image, and label keys; training composes RescaleT(320), RandomCrop(288), and ToTensorLab(flag=0).
  • The source training loop defaults to model_name='u2net', batch_size_train=12, Adam learning rate 0.001, checkpoint save frequency 2000 iterations, and summed BCE losses across seven side outputs.
  • model_name can be changed to u2netp; keep checkpoint paths and model constructor consistent with that choice.

References

  • Data formats: dataset layout, sample dict schema, and transform behavior.
  • Training workflow: training hyperparameters, loss setup, checkpoint behavior, and safe retraining preparation.
  • API reference: distilled dataset/transform APIs and bundled script CLI contracts.
  • Troubleshooting: missing data, mismatched stems, crop size, mask shape, memory, and checkpoint failures.

Routing boundaries

  • Route salient-object or human segmentation inference to salient-object-inference.
  • Route portrait inference, face crops, and portrait compositing to portrait-workflows.
  • Route U2NET/U2NETP architecture internals and checkpoint shape debugging to model-architecture.
  • Keep PaddleHub/Gradio demos out of this sub-skill unless the user is explicitly asking about optional demos rather than retraining.

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