技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
graph-nets【数据与研究】Use DeepMind Graph Nets for GraphsTuple data, TensorFlow graph utilities, and Sonnet graph-network modules.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task uses DeepMind Graph Nets (graph_nets) to build graph neural networks in TensorFlow/Sonnet, manipulate GraphsTuple graph batches, convert NetworkX or NumPy graph data, or debug Graph Nets module and utility errors.
graph_nets runtime.Graph Nets does not declare TensorFlow as a package requirement, so choose a TensorFlow/Sonnet pair explicitly:
# TF2/Sonnet2-style workflows verified for this skill.
python -m pip install "graph_nets" "tensorflow>=2.2,<2.3" "dm-sonnet>=2,<3" "networkx<3" "protobuf<3.20" "numpy<1.20"
# Legacy TF1/Sonnet1-style workflows verified for this skill.
python -m pip install "graph_nets" "tensorflow>=1.15,<2" "dm-sonnet<2" "tensorflow_probability<0.9" "networkx<2.7" "protobuf<3.20" "numpy<1.20"
Then check:
python - <<'PY'
import graph_nets as gn
from graph_nets import graphs, utils_np, utils_tf, blocks, modules
print("graph_nets import ok")
PY
Use the bundled diagnostic when a user reports a version or import problem:
python path/to/graph-nets/scripts/check_graph_nets_install.py --pretty
| Task signal | Read |
|---|---|
Create, validate, batch, slice, or round-trip GraphsTuple data from dictionaries, NumPy arrays, or NetworkX graphs | graph-data |
Use utils_tf for tensor GraphsTuples, placeholders/feed dicts, concat, repeat, fully-connected graphs, padding/masks, tf.function signatures, or TF1/TF2 execution choices | tensorflow-ops |
Build or debug EdgeBlock, NodeBlock, GlobalBlock, GraphNetwork, GraphIndependent, InteractionNetwork, RelationNetwork, DeepSets, CommNet, SelfAttention, or demo model factories | graph-models |
tf.Session and top-level tf.placeholder; the verified TF2 stack uses eager tensors and tf.function signatures and does not expose those top-level TF1 symbols.GraphsTuple field invariants, data dictionary key consistency, and NetworkX feature conventions.tf.function input signatures.use_* flags, reducers, Sonnet factories, or high-level message-passing architecture.GraphsTuple/TensorFlow/Sonnet APIs.