我知道如何在 TensorFlow 中使用 one_hot 向量创建 rnn:
x = tf.placeholder(tf.int32, [batch_size, num_steps], name='input_placeholder')
y = tf.placeholder(tf.int32, [batch_size, num_steps], name='labels_placeholder')
init_state = tf.zeros([batch_size, state_size])
x_one_hot = tf.one_hot(x, num_classes)
rnn_inputs = tf.unstack(x_one_hot, axis=1)
但是我不确定当我的输入向量有多个 1 时该怎么做,例如。它可能是 11011 作为每次 1 个输入。所以:[[11011],[00111],...]
如果我只提供这个向量,就像我有我的 one-hot 表示一样,会有问题吗?那我应该如何制定上述内容?我觉得我不应该使用 tf.one_hot 函数...不确定如何在没有 one_hot 的情况下创建 rnn_inputs (200 x 5 x 2) 的形状。
(使用 TF 1.0)