Skip to main content
QUICK REVIEW

[论文解读] Deep Learning with Dynamic Computation Graphs

Moshe Looks, Marcello Herreshoff|arXiv (Cornell University)|Feb 7, 2017
Topic Modeling参考文献 12被引用 81
一句话总结

引入动态批处理以实现对具有动态计算图的神经网络的高效训练和推理,并提出 TensorFlow Fold,一种组合子库,可简洁地构建此类模型。

ABSTRACT

Neural networks that compute over graph structures are a natural fit for problems in a variety of domains, including natural language (parse trees) and cheminformatics (molecular graphs). However, since the computation graph has a different shape and size for every input, such networks do not directly support batched training or inference. They are also difficult to implement in popular deep learning libraries, which are based on static data-flow graphs. We introduce a technique called dynamic batching, which not only batches together operations between different input graphs of dissimilar shape, but also between different nodes within a single input graph. The technique allows us to create static graphs, using popular libraries, that emulate dynamic computation graphs of arbitrary shape and size. We further present a high-level library of compositional blocks that simplifies the creation of dynamic graph models. Using the library, we demonstrate concise and batch-wise parallel implementations for a variety of models from the literature.

研究动机与目标

  • 激励并解决使用静态数据流图训练 DCG 的低效问题。
  • 提出动态批处理以对形状各异的图以及同一图内的不同形状的操作进行批处理。
  • 展示如何使用高级组合子库实现 DCG 模型,以便快速原型设计和实验。
  • 在 CPU 和 GPU 硬件上展示经验加速和实际可行性。

提出的方法

  • 将动态批处理定义为一种调度技术,在一批输入图中对处于同一深度的相同操作进行分组。
  • 将输入 DCG 重写为使用 gather 和 concat 操作来模拟动态图的静态图。
  • 在 TensorFlow 中使用 while_loop 以遍历图的深度,从而使静态图支持反向传播。
  • 开发 TensorFlow Fold,是一个具有 blocks、maps、folds、reduces 等结构的组合子库,用于在高级层次组合 DCG 模型。
  • 展示示例,包括 TreeRNNs、Tree-LSTMs、前馈注意力,以及分子图卷积等,以说明表达力和批处理的好处。

实验结果

研究问题

  • RQ1动态批处理能否弥补在标准静态图库中跨不同拓扑的图无法进行批处理的问题?
  • RQ2使用所提出的静态图仿真对 DCG 进行批处理时,性能的权衡(速度与开销)有哪些?
  • RQ3TensorFlow Fold 的组合子库在实现简洁且可扩展的 DCG 模型方面有多大作用?
  • RQ4通过动态批处理实现的 DCG 模型在情感分析和分子图处理等任务上在多大程度上达到最先进或具竞争力的结果?

主要发现

  • 动态批处理在对单个树的朴素处理上实现了显著的加速,在大树完全批处理时,在 GPU 上速度提升可达 160x。
  • 动态批处理通过使每个操作只实例化一次并按深度批量执行来减少内核调用开销,从而产生更少但更大的 GPU 内核。
  • 存在来自额外的 concat 和 gather 操作的开销成本,但总体收益仍然有利,尤其是在较大批量或充分利用同树内批处理时。
  • TensorFlow Fold 的组合子库使 DCG 模型的实现更加简洁,并通过减少代码量和支持快速模型变体来加速实验。
  • 实验包括用于情感分析的 TreeRNN、Tree-LSTMs,以及用于分子的图卷积方法,展示了广度和实用性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。