August 2017
Intermediate to advanced
288 pages
8h 6m
English
The RNN models in TensorFlow can easily be extended to Deep RNN models by using MultiRNNCell. The previous rnn function can be replaced with the stacked_rnnfunction to achieve a deep RNN architecture:
num_layers <- 3
stacked_rnn<-function(x, weight, bias){ # Unstack input into step_size x = tf$unstack(x, step_size, 1) # Define a most basic RNN network = tf$contrib$rnn$GRUCell(n.hidden) # Then, assign stacked RNN cells network = tf$contrib$rnn$MultiRNNCell(lapply(1:num_layers,function(k,network){network},network)) # create a Recurrent Neural Network cell_output = tf$contrib$rnn$static_rnn(network, ...Read now
Unlock full access