AGENT SKILL

learning-deeplearn

Use ANTsPy statistical learning and deep-learning helper utilities for decompositions, patches, augmentation, one-hot labels, and bounded array/image preparation without training neural networks.

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

01 前言 Front Matter

name
learning-deeplearn
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use ANTsPy statistical learning and deep-learning helper utilities for decompositions, patches, augmentation, one-hot labels, and bounded array/image preparation without training neural networks.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

ANTsPy Learning and Deeplearn Helpers

Use this sub-skill when a task asks for ANTsPy helper utilities around statistical learning, sparse decomposition, eigenanatomy initialization, patch extraction/reconstruction, random augmentation, one-hot segmentation arrays, simulated bias fields, histogram intensity warping, regression intensity matching, or crop/pad sizing for learning pipelines.

Start Here

  1. Import the public package as import ants; the package distribution is antspyx.
  2. Keep the scope clear: ANTsPy supplies helper functions for image/array preparation and statistical decomposition, not full neural-network model training.
  3. Check verified public signatures, return keys, and shape contracts in API reference.
  4. Use workflows for patch extraction/reconstruction, paired augmentation, one-hot conversion, intensity simulation, regression matching, and decomposition recipes.
  5. Use troubleshooting when dimensions, channel order, paired image lists, randomness, optional dependencies, or patch counts fail.
  6. Run scripts/antspy_deeplearn_smoke.py for a tiny bounded in-memory helper check in an environment with antspyx installed.

Core Contracts

  • ants.deeplearn helpers are data-preparation utilities: they produce images, arrays, transforms, and labels that can feed external ML code; they do not define, compile, fit, or evaluate neural-network models.
  • input_image_list for augmentation is a list of subject lists, where each inner list holds co-registered modalities for one subject: [[subject0_mod0, subject0_mod1], [subject1_mod0, subject1_mod1]].
  • Patch utilities support 2-D and 3-D scalar or component images. Array patches are shaped as (n_patches, *patch_size) for scalar images and (n_patches, *patch_size, components) for component images.
  • One-hot conversion uses channel-last by default ((*image_shape, n_labels)) and channel-first only when channel_first_ordering=True ((n_labels, *image_shape)).
  • Random augmentation and simulation helpers use NumPy and Python randomness internally; set seeds around calls when repeatability matters, and verify returned transform metadata before pairing outputs with labels or points.
  • ants.sparse_decom2 expects two matrices with the same row count; it does not scale matrices internally, so center/scale decisions belong to the caller.

Route Elsewhere

  • Create, read, write, inspect, clone, compare, and repair ANTsImage metadata: image-core.
  • Generic preprocessing, masks, smoothing, denoising, thresholding, morphology, core cropping/padding, resampling, and histogram matching: image-ops-math.
  • Registration mechanics, transform files, transform application, displacement fields, and point transform semantics outside augmentation helpers: registration-transforms.
  • Segmentation algorithms, label statistics, overlap, centroids, label geometry, and label matrices: segmentation-labels.
  • Full model training, ANTsPyNet architectures, loss functions, pretrained networks, and deep learning inference workflows: use ANTsPyNet or another ML framework outside this ANTsPy repo skill.

Boundary Notes

  • The module name ants.deeplearn is historical and helper-oriented. Do not promise model-training support from ANTsPy itself.
  • crop_image_from_center_point exists in source helper code but was not exported as a public ants function in the verified antspyx 0.6.3 inspection; prefer exported crop/pad helpers unless runtime introspection proves availability.
  • data_augmentation and randomly_transform_image_data internally use transform and preprocessing functions. Use this sub-skill for their learning-helper contract; use registration or image-ops sub-skills to debug low-level transform/preprocessing behavior.

References

  • API reference: verified signatures, return keys, shape/axis contracts, dependencies, and public-export caveats.
  • Workflows: practical helper recipes for patches, augmentation, one-hot arrays, intensity perturbation, regression matching, crop/pad sizing, and decomposition.
  • Troubleshooting: shape/axis mismatch, paired transform tracking, randomness, memory/patch count, optional dependency, and helper-vs-training boundaries.

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