【发布时间】:2016-03-07 03:59:30
【问题描述】:
我一直在阅读有关扫描的 Theano 文档,发现自己被两个看似矛盾的陈述弄糊涂了。
在http://deeplearning.net/software/theano/tutorial/loop.html#scan上,scan的优势之一列举如下:
Slightly faster than using a for loop in Python with a compiled Theano function.
但是,在http://deeplearning.net/software/theano/library/scan.html#lib-scan,在优化扫描使用的一节中,它说:
Scan makes it possible to define simple and compact graphs that can do
the same work as much larger and more complicated graphs. However, it
comes with a significant overhead. As such, **when performance is the
objective, a good rule of thumb is to perform as much of the computation
as possible outside of Scan**. This may have the effect of increasing
memory usage but can also reduce the overhead introduces by using Scan.
在这里,我对“性能”的解读是速度的同义词。因此,一旦编译完成,我对扫描何时/是否会导致更短的运行时间感到困惑。
【问题讨论】:
标签: theano