百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

graph_nets

> DevOps
开源

在 TensorFlow 中构建 Graph Nets

5.4K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

在 TensorFlow 中构建 Graph Nets

Graph Nets 库

在 Tensorflow 和 Sonnet 中构建图网络。

如有意见和问题,请联系 [email protected]。

什么是图网络?

图网络以图作为输入,并输出一个图作为结果。输入的图具有边(E)、节点(V)和全局(u)级别的属性。输出的图具有相同的结构,但属性会被更新。图网络是更广泛的“图神经网络”家族的一部分(Scarselli et al., 2009)。

要了解更多关于图网络的信息,请参阅我们的 arXiv 论文:Relational inductive biases, 深度学习, and graph networks。

安装

Graph Nets 库可以通过 pip 安装。

此安装版本兼容 Linux/Mac OS X 以及 Python 2.7 和 3.4+。

该库可同时兼容 CPU 和 GPU 版本的 TensorFlow,但为了实现这一点,它并未将 Tensorflow 列为依赖项,因此如果您尚未安装 Tensorflow,则需要单独安装。

要安装 Graph Nets 库并与 TensorFlow 1 和 Sonnet 1 一起使用,请运行:

(CPU)

bash
$ pip install graph_nets "tensorflow>=1.15,<2" "dm-sonnet<2" "tensorflow_probability<0.9"

(GPU)

bash
$ pip install graph_nets "tensorflow_gpu>=1.15,<2" "dm-sonnet<2" "tensorflow_probability<0.9"

要安装 Graph Nets 库并与 TensorFlow 2 和 Sonnet 2 一起使用,请运行:

(CPU)

bash
$ pip install graph_nets "tensorflow>=2.1.0-rc1" "dm-sonnet>=2.0.0b0" tensorflow_probability

(GPU)

bash
$ pip install graph_nets "tensorflow_gpu>=2.1.0-rc1" "dm-sonnet>=2.0.0b0" tensorflow_probability

该库的最新版本要求 TensorFlow >=1.15。如需兼容早期版本的 TensorFlow,请安装 v1.0.4 版本的 Graph Nets 库。

使用示例

以下代码构建了一个简单的图网络模块,并将其连接到数据。

python
import graph_nets as gn
import sonnet as snt

# 提供你自己的函数来生成图结构数据。
input_graphs = get_graphs()

# 创建图网络。
graph_net_module = gn.modules.GraphNetwork(
    edge

[Graph Nets](https://github.com/deepmind/graph_nets) is DeepMind's library for

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonartificial-intelligencedeep-learninggraph-networksgraphs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理