July 2018
Beginner to intermediate
312 pages
8h 31m
English
The decoder network is also created with Gated Recurrent Unit (GRU) cells. The decoding_layer function takes the output of the encoder and the word embeddings of the English text as input. It produces an output projection vector of a size equal to the vocabulary size of the English text:
def decoding_layer(decoding_embed_inp, embeddings, encoding_op, encoding_st, v_size, fr_len, en_len,max_en_len, rnn_cell_size, word2int, dropout_prob, batch_size, n_layers): for l in range(n_layers): with tf.variable_scope('dec_rnn_layer_{}'.format(l)): gru = tf.contrib.rnn.GRUCell(rnn_len) decoding_cell = tf.contrib.rnn.DropoutWrapper(gru,input_keep_prob = dropout_prob) out_l = Dense(v_size, kernel_initializer = tf.truncated_normal_initializer(mean ...Read now
Unlock full access