Today, I have succeeded, I hope anyone helping this my example code.
Below code is example to learning for
input: hihell -> output: ihello
gist code start
This code is referenced by this(https://github.com/MareArts/DeepLearningZeroToAll/blob/master/lab-12-1-hello-rnn.py)
gist code end
There are 4 variable for trainable
name rnn/basic_lstm_cell/weights:0, shape (10, 20)
name rnn/basic_lstm_cell/biases:0, shape (20,1)
name fully_connected/weights:0, shape (5, 5)
name fully_connected/biases:0, shape (5,1)
And I have checked the values which are same after "global_variables_initializer"
The result is same and prediction result is also same.
OK, then let's move more complicated RNN design.
This example code for 2 layer LSTM and 2 batch condition.
gist code start
gist code end
Maintain
Reference
- reference code
- print trainable value
- LSTM save & restore comment
- https://github.com/tensorflow/tensorflow/issues/13438
- https://stackoverflow.com/questions/40442098/saving-and-restoring-a-trained-lstm-in-tensor-flow
- RNN initialize
- fully connected weight, bias save
- trainable variable
No comments:
Post a Comment