技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
graph-layers【数据与研究】Construct and troubleshoot the repository's sparse and dense graph layers, dynamic or dilated KNN blocks, GENConv aggregation, and reversible coupling primitives; use this skill for layer-level API and shape questions, not end-to-end dataset workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill for a layer-level design or debugging task. It is a distilled operating guide, not a source-checkout import recipe. Start with the tensor layout and graph representation, choose a static or dynamic layer, then run the small bundled smoke before moving to a real workload.
Identify layout. Use sparse node features (N, C) with a PyG
edge_index (2, E) and optional batch (N,) for independent graphs;
use dense point-cloud features (B, C, N, 1) with dense indices
(2, B, N, K). Do not pass a dense tensor to sparse layers or flatten a
dense batch without preserving graph membership.
Choose graph construction. Use a supplied edge_index when topology is
fixed. Otherwise use DynConv/DynConv2d, selecting kernel_size K,
dilation d, and (for dense layers) knn='matrix' or the compiled
torch_cluster path. Ensure K*d does not exceed points per graph.
Choose convolution. Sparse GraphConv supports edge, mr, gat,
gcn, and gin in the inspected implementation. sage and rsage are
exposed but are not a supported modern-PyG route; see
troubleshooting. Dense GraphConv2d and
DynConv2d support edge and mr.
Choose composition. Plain blocks transform features, residual blocks
add a same-width scaled skip, and dense blocks concatenate newly produced
channels. Static blocks preserve and return edge_index; sparse dynamic
blocks return (features, batch).
For generalized aggregation, configure GENConv and validate the
aggregator, temperature/power parameters, edge encoding, and message
normalization together. See aggregation and blocks.
For memory-efficient depth, use a channel-divisible group additive coupling with deterministic per-group functions, then wrap it with the reversible wrapper only after a direct forward/inverse round trip passes. See reversible.
Run the safe helper from any working directory:
python /absolute/path/to/graph-layers/scripts/layer_smoke.py --help
python /absolute/path/to/graph-layers/scripts/layer_smoke.py --tiny
Resolve the absolute path in the caller's skill installation; never add a
source checkout to PYTHONPATH for this helper.
The core layer behavior depends on a coherent PyTorch, PyTorch Geometric,
torch-scatter, and torch-cluster installation. The verified inspection
combination was PyTorch 2.11.0+cu128, PyG 2.8.0.post1,
torch-scatter 2.1.2+pt211cu128, and torch-cluster 1.6.3+pt211cu128, with
pip check passing. Treat those versions as evidence, not as a universal pin:
match PyG extension wheels to the installed PyTorch and CUDA/CPU build. A
missing or ABI-incoherent compiled extension is a dependency failure, not a
layer-shape bug. The tiny helper probes these dependencies without importing
repository modules.
Exact benchmark reproduction is intentionally outside this skill. The
repository-era PyG 1.6.3 probe did not import with torch 1.13.1 because of the
removed torch._six.container_abcs; use a coherent historical environment for
old-number reproduction and do not infer benchmark equivalence from the modern
smoke.