torch-geometric
PyTorch Geometricでグラフニューラルネットワークを構築する
こちらからも入手できます: davila7
グラフニューラルネットワークは、薬物発見、ソーシャルネットワーク分析、レコメンデーションシステムなどの現代的なアプリケーションを支える技術です。このスキルは、PyTorch Geometricを使用したGNNの実装向けに、そのまま使用できるテンプレートとドキュメントを提供します。
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「torch-geometric」を使用しています。 Create a GCN model for the Cora citation network
期待される結果:
- GCNConv layers with hidden channels
- Training loop with loss calculation
- Evaluation on train/val/test masks
- Model saved to checkpoint file
「torch-geometric」を使用しています。 Load the TUDataset for graph classification
期待される結果:
- TUDataset with ENZYMES loaded to /tmp
- DataLoader with batch_size=32
- Global mean pooling layer
- Training across 100 epochs
「torch-geometric」を使用しています。 Use attention mechanisms in my GNN
期待される結果:
- GATConv with 8 attention heads
- Dropout applied to attention coefficients
- ELU activation function
- Multi-head output concatenated then averaged
セキュリティ監査
安全All 777 static findings are false positives. The detected 'eval()' calls are legitimate PyTorch model.eval() methods for evaluation mode, not dynamic code execution. The 'external_commands' findings are markdown code blocks using backtick formatting. The 'weak cryptographic algorithm' flags are triggered by documentation mentioning algorithm names. The 'certificate/key files' flags misidentify error messages referencing TEMPLATES.keys(). No actual security threats identified in this legitimate PyTorch Geometric ML skill.
リスク要因
⚙️ 外部コマンド (4)
📁 ファイルシステムへのアクセス (2)
⚡ スクリプトを含む (3)
🌐 ネットワークアクセス (1)
品質スコア
作れるもの
分子特性予測モデルの構築
分子グラフでGNNをトレーニングし、薬物発見のための薬物特性、毒性、結合親和性を予測する。
引用ネットワーク分類器の作成
CoraやPubMedなどの引用ネットワークでノード分類を実装し、論文のカテゴリ化とレコメンデーションを行う。
ソーシャルネットワークの分析
グラフアテンションとサンプリング技術を大規模なソーシャルネットワークに適用し、コミュニティ検出と影響分析を行う。
これらのプロンプトを試す
Build a Graph Convolutional Network for node classification on the Cora dataset using PyTorch Geometric. Include training loop and evaluation.
Create a GraphSAGE model for graph classification on the ENZYMES dataset using global mean pooling and DataLoader.
Implement a Graph Attention Network (GAT) with multi-head attention for citation network classification.
Show how to use NeighborLoader for training GNNs on large-scale graphs with mini-batch processing and neighbor sampling.
ベストプラクティス
- 推論時にはmodel.eval()とtorch.no_grad()を使用して、勾配を無効化し、決定論的な動作を確保する。
- 大規模なグラフで効率的なミニバッチトレーニングを可能にするために、適切なnum_neighborsでNeighborLoaderを使用する。
- 効率的なチェックポイントと再現性のために、torch.save()でstate_dictを使用してモデルを保存する。
回避
- 大規模なネットワークでサンプリングせずにフルグラフでトレーニングするとメモリ不足になるため避ける。
- トレーニングフェーズでmodel.train()を、評価時にmodel.eval()を設定することを忘れないようにする。
- データセットパスをハードコーディングせず、一時ディレクトリでrootパラメータを使用してデータセットのキャッシュを行う。
よくある質問
PyTorch Geometricとは何ですか?
どのようなGNNアーキテクチャがサポートされていますか?
どのようなデータセットをロードできますか?
大規模なグラフをどのように処理すればよいですか?
分子特性予測を行えますか?
どのようなトランスフォームが利用可能ですか?
開発者の詳細
作成者
K-Dense-AIライセンス
MIT license
リポジトリ
https://github.com/K-Dense-AI/claude-scientific-skills/tree/main/scientific-skills/torch_geometric参照
main