transfer-learning-library
Use Transfer Learning Library (TLLib) for PyTorch transfer learning, domain adaptation, domain generalization, task adaptation, self-training, model selection, and vision data/model workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- transfer-learning-library
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Transfer Learning Library (TLLib) for PyTorch transfer learning, domain adaptation, domain generalization, task adaptation, self-training, model selection, and vision data/model workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/capability-map.md4.6 KB
- 参考文档references/repo-provenance.md2.5 KB
- 参考文档references/repo-routing-metadata.json379 B
- 参考文档references/troubleshooting.md5.5 KB
- 脚本scripts/check_tllib_install.py5.0 KB
03 SKILL.md 正文
Transfer Learning Library (TLLib)
Use this repo skill when a task names Transfer Learning Library, TLLib, tllib, or asks for PyTorch transfer-learning workflows such as domain adaptation, domain generalization, task adaptation/fine-tuning, self-training, model ranking, or TLLib vision datasets/models.
First checks
-
Confirm the package imports before following any workflow:
python - <<'PY' import tllib, torch, torchvision, numpy print('tllib', tllib.__version__) print('torch', torch.__version__) print('torchvision', torchvision.__version__) print('numpy', numpy.__version__) PY -
For TLLib 0.4, prefer an older compatible stack when model factories or losses fail under modern dependencies: Python 3.8, PyTorch/TorchVision from the 1.8/0.9 era, and
numpy<1.24are known-good inspection choices. -
Run the bundled root smoke check when diagnosing install/import problems:
python scripts/check_tllib_install.py -
Read
references/repo-provenance.mdbefore deciding whether this skill is current for a checkout. Readreferences/troubleshooting.mdfor install/import, dependency, dataset, and backend failures.
Route by task
| User task | Read |
|---|---|
| Unsupervised/partial/open-set/domain-adversarial adaptation; DANN, CDAN, DAN, JAN, MDD, MCD, MCC, AFN, BSP, RegDA, D-adapt, WILDS adaptation | sub-skills/domain-adaptation/SKILL.md |
Dataset roots, ImageList text files, domain names, transforms, vision model factories, re-id/keypoint/segmentation utilities, metrics/loggers |
sub-skills/vision-data-models/SKILL.md |
| Domain generalization or fine-tuning/task adaptation; MixStyle, IBN, StochNorm, GroupDRO, IRM/VREx/MLDG, L2-SP, DELTA, BSS, Co-Tuning, LwF, Bi-Tuning | sub-skills/task-generalization/SKILL.md |
| Semi-supervised learning or self-training; pseudo-labeling, Pi Model, Mean Teacher, UDA, FixMatch/FlexMatch, MCC, Self-Tuning, DST, Noisy Student | sub-skills/self-training/SKILL.md |
| Rank or choose pretrained models by transferability metrics; H-score, regularized H-score, LEEP, NCE, LogME, TransRate | sub-skills/model-selection/SKILL.md |
| CycleGAN/FDA/CyCADA/SPGAN image or domain translation components | sub-skills/translation/SKILL.md |
Use references/capability-map.md when the user names an algorithm and you need to find its TLLib module, owning sub-skill, optional dependencies, or validation route.
Operating boundaries
- This skill teaches the installed
tllibpackage and distilled workflow patterns. It does not require the original repository checkout at runtime. - Original benchmark examples are treated as evidence only. Their reusable behavior is distilled into references and bundled scripts; do not ask future users to open or run source-tree examples.
- CPU smoke checks validate public APIs and tensor/array contracts. Real benchmark training is usually long-running, dataset-dependent, and GPU-recommended.
- Object detection adaptation, WILDS, text/molecule examples, and some DG trainers need optional stacks such as Detectron2, MMCV, WILDS, TensorFlow, Transformers, Torch Geometric, OGB,
timm, orhigher. Install only the optional stack that the user explicitly needs. - Dataset downloads are external and may be broken or license-restricted. Prefer user-provided local datasets and validate layouts with the
vision-data-modelsscripts.
Bundled root assets
scripts/check_tllib_install.pyverifies imports, version compatibility, representative public APIs, and optional backend visibility without downloading data.references/troubleshooting.mdcovers cross-cutting failures before routing to workflow-specific troubleshooting.references/repo-routing-metadata.jsoncontains structured metadata for managed repo-skill routing.
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).