TensorFlow Scan Examples

#artificialintelligence 

We could explicitly unroll the loops ourselves, creating new graph nodes for each loop iteration, but then the number of iterations is fixed instead of dynamic, and graph creation can be extremely slow. Let's go over two examples. First, we'll create a simple cumulative-sum operation using scan. For example, [1, 2, 2, 2] as input will produce [1, 3, 5, 7] as output. Second, we'll build a toy RNN from scratch, and we'll have it learn the cumulative-sum operation from example input, target sequences.