学习TensorFlow之tf.contrib.rnn.BasicRNNCell()

TensorFlow版本号:1.1.0

tf.contrib.rnn.BasicRNNCell()

__init__(
    num_units,
    input_size=None,
    state_is_tuple=True
)

num_numits指代了有多少个隐藏层单元;

activation默认为tanh激活函数。

__call__(
    inputs,
    state,
    scope=None
)

call函数中,inputs指代隐藏层输入,state指代上一个时间的隐藏层状态,所以

output = new_state = activation(W * input + U * state + B)

关于BasicRNNCell,在博客https://saicoco.github.io/tensorflow2/中有详细的介绍。

猜你喜欢

转载自my.oschina.net/u/3625378/blog/1569292