界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

graph-models

graph-models

【效率与协作】Build Graph Nets blocks and high-level Sonnet model architectures.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: graph-models description: "Build Graph Nets blocks and high-level Sonnet model architectures." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

Graph Models

Use this sub-skill when the task is to assemble, adapt, or debug Graph Nets neural-network modules: low-level broadcasters/aggregators, EdgeBlock / NodeBlock / GlobalBlock, high-level graph_nets.modules architectures, or Sonnet model factories for Graph Nets demos.

Route here for

  • Choosing and wiring graph_nets.blocks broadcasters, aggregators, reducers, or update blocks.
  • Building GraphIndependent, GraphNetwork, InteractionNetwork, RelationNetwork, DeepSets, CommNet, or SelfAttention modules.
  • Writing Sonnet 1 or Sonnet 2 *_model_fn factories for edge, node, global, encoder, core, decoder, or output transforms.
  • Adapting the bundled demo architectures in scripts/demo_models_tf1.py or scripts/demo_models_tf2.py.
  • Running a tiny installed-package model smoke with scripts/graph_model_smoke.py.

Route elsewhere

  • Raw GraphsTuple construction, dictionary batching, and NetworkX conversion belong in ../graph-data/SKILL.md.
  • TensorFlow utilities, placeholders, padding, masks, utils_tf.concat, tf.function signatures, and session/feed details belong in ../tensorflow-ops/SKILL.md.
  • Full training-loop or notebook reproduction work should use the root Graph Nets recipe guidance first, then return here only for the model/module layer.

Required reading for model work

  1. references/api-reference.md for constructor contracts, field requirements, reducer defaults, and Sonnet version differences.
  2. references/workflows.md for practical recipes: independent encoders/decoders, generic message passing, relation/set/communication modules, self-attention, and encode-process-decode.
  3. references/troubleshooting.md when a graph field is None, senders/receivers are absent, reducers are missing, concatenation shapes fail, or TF/Sonnet major versions mismatch.

Operating checklist

  • Confirm the installed stack before choosing code style: Sonnet 1 uses snt.AbstractModule and TF1 sessions/placeholders; Sonnet 2 uses snt.Module, eager tensors, and optional tf.function wrapping.
  • Decide which graph fields the module is allowed to read. Match every use_* flag to non-None input fields and to required reducers.
  • Keep model factories as zero-argument callables that return a Sonnet module or callable. Do not instantiate a fresh submodule inside every call of an already-built model.
  • Validate all concatenated features share the same rank and all non-last axes after broadcasting/aggregation; only the last feature axis should differ.
  • Preserve sub-skill boundaries: fix invalid graph data before model assembly and delegate padding/session mechanics to the TensorFlow ops sub-skill.
我的收藏