July 2019
Intermediate to advanced
512 pages
19h 39m
English
Define the network parameters as shown:
batch_size = 7window_size = 7hidden_layer = 256learning_rate = 0.001
Define placeholders for our input and output:
input = tf.placeholder(tf.float32, [batch_size, window_size, 1])target = tf.placeholder(tf.float32, [batch_size, 1])
Let's now define all the weights we will use in our LSTM cell.
The weights of the input gate are defined as follows:
U_i = tf.Variable(tf.truncated_normal([1, hidden_layer], stddev=0.05))W_i = tf.Variable(tf.truncated_normal([hidden_layer, hidden_layer], stddev=0.05))b_i = tf.Variable(tf.zeros([hidden_layer]))
The weights of the forget gate are defined as follows:
U_f = tf.Variable(tf.truncated_normal([1, hidden_layer], stddev=0.05))W_f = tf.Variable(tf.truncated_normal([hidden_layer, ...
Read now
Unlock full access