Cyclic computational graphs with Tensorflow or Theano

孤街浪徒 提交于 2019-12-29 09:14:18

问题


Both TensorFlow and Theano do not seem to support cyclic computational graphs, cyclic elements are implemented as recurrent cells with buffer and unrolling (RNN / LSTM cells), but this limitation is mostly related with the computation of back-propagation. I don't have a particular need for computing back-propagation but just the forward propagations.

Is there a way to ignore this limitation, or perhaps just to break down arbitrary computational graphs in acyclic components?


回答1:


TensorFlow does support cyclic computation graphs. The tf.while_loop() function allows you to specify a while loop with arbitrary subgraphs for the condition and the body of the loop, and the runtime will execute the loop in parallel. The tf.scan() function is a higher-level API that is similar to Theano's theano.scan() function. Both allow you to loop over tensors of dynamic size.



来源:https://stackoverflow.com/questions/37551389/cyclic-computational-graphs-with-tensorflow-or-theano

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!