I just started playing with TensorFlow, and I'm trying to implement a very simple RNN. RNN has x as input, y as output and consists of only one level that accepts x , and the previous output as input. Here is a picture of what I mean:

The problem is that I donβt see any way to use the TensorFlow API to plot a graph with a loop in it. Whenever I define a tensor, I have to indicate what it is, which means that I should already have defined its inputs. So, there is a problem with the chicken and the egg.
I donβt even know if it makes sense to define a graph with a cycle (what is calculated first? Should I determine the initial value of softmax node?). I played with the idea of ββusing a variable to represent the previous output, and then manually accepting the y value and storing it in the variable every time after submitting through the training sample. But it would be very slow if there was no way to present this procedure in the graph itself (?).
I know that TensorFlow tutorials show examples of RNN implementations, but they trick and pull the LSTM module out of a library that already has a loop. In general, the tutorials are good for helping you create certain things, but they could better explain how this beast really works.
So, TensorFlow experts, is there any way to build this thing? How can I do it?
source share