技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
torchdrug【数据与研究】Route TorchDrug graph learning, drug discovery, molecular ML, protein, knowledge graph, data, model, and training engine workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task involves TorchDrug, TorchProtein, graph neural networks for drug discovery, molecular property prediction, molecular generation, retrosynthesis, protein workflows, knowledge graph completion, or TorchDrug's core.Engine training stack.
mps, and package-version pitfalls.python scripts/check_torchdrug_env.py in the user's TorchDrug environment for a no-download import and capability check.TorchDrug 0.2.1 supports Python >=3.7,<3.11 and PyTorch >=1.8.0. Prefer a fresh environment with Python 3.10 or earlier:
python -m pip install torchdrug
python - <<'PY'
import torchdrug
from torchdrug import data
print(torchdrug.__version__)
graph = data.Graph([[0, 1], [1, 0]], num_node=2)
print(graph.num_node, graph.num_edge)
PY
When installing from pip, install PyTorch first, then choose torch-scatter and torch-cluster wheels that match the PyTorch and CUDA/CPU build. Conda users can prefer the documented conda channels because they solve PyTorch, PyG, RDKit, and compiled packages together.
| User task | Read |
|---|---|
| Graph, molecule, protein, dataset, SMILES, sequence, packing, masking, splitting, collator, or data validation tasks | sub-skills/graph-data/SKILL.md |
Choosing or customizing graph layers, representation models, readouts, samplers, variadic tensor utilities, or MessagePassingBase subclasses | sub-skills/layers-and-extensions/SKILL.md |
Building core.Engine loops, checkpointing, config serialization, logging, CPU/GPU settings, task contracts, or training harnesses | sub-skills/training-engine/SKILL.md |
| Molecular property prediction, molecular pretraining, generation with GCPN/GraphAF, or USPTO50k retrosynthesis | sub-skills/molecular-workflows/SKILL.md |
| Knowledge graph triples, FB15k/WN18/YAGO/Hetionet, TransE/RotatE/NeuralLP/KBGAT, negative sampling, or filtered ranking | sub-skills/knowledge-graphs/SKILL.md |
| Protein sequences/structures, contact prediction, GearNet, ESM, protein property/function, or protein-protein interaction workflows | sub-skills/protein-workflows/SKILL.md |
graph-data and run its scripts/smoke_graph_data.py helper.graph-data for the molecule dataset, molecular-workflows for task/model choices, and training-engine for core.Engine save/load.layers-and-extensions first, then return to training-engine to wire the module into a task.protein-workflows for data/model/task choices and layers-and-extensions only for graph construction internals.knowledge-graphs for model/task/dataset decisions and training-engine for optimizer, evaluation, and checkpoint details.gpus=[0] is valid. Use gpus=None for CPU-only work and check torch.cuda.is_available() before GPU examples.mps; TorchDrug documentation says Apple silicon can run on CPU but mps is unsupported.This skill covers public TorchDrug package usage and repo-derived workflows: source APIs under torchdrug/, install metadata, Sphinx docs, tutorials, benchmarks, and representative tests. It intentionally does not cover maintainer release automation, full benchmark reproduction, or external dataset/model-weight acquisition beyond documented prerequisites.