pairwise-registration
Construct and smoke-test VoxelMorph VxmPairwise registration models with current PyTorch APIs, Neurite losses, checkpoint patterns, and legacy-script caveats.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- pairwise-registration
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Construct and smoke-test VoxelMorph VxmPairwise registration models with current PyTorch APIs, Neurite losses, checkpoint patterns, and legacy-script caveats.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md8.3 KB
- 参考文档references/troubleshooting.md5.8 KB
- 参考文档references/workflows.md6.2 KB
- 脚本scripts/tiny_pairwise_training_smoke.py8.7 KB
03 SKILL.md 正文
Pairwise Registration
Use this sub-skill when the task is to build, call, smoke-train, checkpoint, or troubleshoot the current PyTorch voxelmorph.nn.models.VxmPairwise pairwise registration model.
Route here for
- Constructing
VxmPairwisewith dimensionality, image channels, UNet features, integration steps, and Neurite-backed modules. - Understanding
forward()return options: displacement/velocity fields, warped source images, warped target images, and their shapes. - Writing short synthetic training loops that use Neurite losses and avoid dataset, download, or institutional-path dependencies.
- Saving/loading model checkpoints using a config plus
state_dictpattern. - Migrating or rejecting legacy registration examples that refer to APIs not exposed by the current package.
Route elsewhere
- Dense transform math, coordinate conventions, composition, affine-to-displacement conversion, and standalone spatial warping: use
transform-ops. - Volume files,
.npz/NIfTI schema preparation, image lists, real-data generators, segmentation labels, and validation of file layouts: usedata-generators. - Long real training jobs, benchmark-quality registration, model downloads, or clinical validation: out of scope for this operating sub-skill unless a separate task supplies data, runtime, and acceptance criteria.
Current operating contract
- Public model entry point:
voxelmorph.nn.models.VxmPairwise. - Tensor convention: images are PyTorch tensors shaped
(B, C, *spatial), and predicted fields are shaped(B, ndim, *spatial). - Losses should come from
neurite.nn.modules;voxelmorph.nn.lossesclasses are compatibility stubs that raise deprecation errors. - The bundled smoke script uses deterministic synthetic 2D tensors on CPU by default and performs a tiny optimizer loop only.
- Do not present old TensorFlow script paths,
vxm.networks.VxmDense, or the legacy registration CLI as runnable guidance for this PyTorch package.
Bundled references
references/api-reference.md— verified constructor/forward signatures, return-shape matrix, Neurite loss choices, and error cases.references/workflows.md— model construction, tiny training loop, checkpoint round-trip, and current inference/legacy-script caveats.references/troubleshooting.md— failures around integration flags,unet_kwargs, Neurite imports/losses, shape divisibility, checkpoint mismatches, and stale scripts.scripts/tiny_pairwise_training_smoke.py— safe synthetic CPU smoke for model construction, Neurite losses, one or more optimizer steps, and optional checkpoint round-trip.
Quick safe check
From this sub-skill directory, run:
python scripts/tiny_pairwise_training_smoke.py --help
python scripts/tiny_pairwise_training_smoke.py --steps 1 --spatial-size 16 --features 4 4 4
The check should finish quickly without downloading data or writing files unless --checkpoint-out is explicitly provided.
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).