Что вводить в функцию сборки в tf.contrib.rnn.BasicLSTMCell в тензорном потоке - PullRequest
0 голосов
/ 09 июня 2018

Я пытаюсь инициализировать параметры ячейки RNN.Для этого, я думаю, мне нужно сначала создать слой.Затем я попытался построить слой, используя метод build в BasicLSTMCell, но он выдал ошибку int object has no attribute value.Пожалуйста, помогите мне или дайте мне другой способ инициализации весов и смещений.

1 Ответ

0 голосов
/ 12 июня 2018
import tensorflow as tf   
my_cell = tf.contrib.rnn.BasicLSTMCell(num_units = 128) # 128 is the hidden dimension which is a hyperparameter to be choosen by you
# Note you have just declared the LSTM cell till now, they haven't been initialized.
# Do something with the LSTM
with tf.Session as sess:
    sess.run(tf.global_variables_initializer()) # This line is necessary for the LSTM's parameters (The Matrices and Bias vectors) to be initialized
...