0

私は自分のRNNを証言するアプリケーションを望んでいます。最もシンプルなアプリケーションでもっともシンプルなRNNですか?

私は最も簡単なRNNを書いています。テンソルフローなし。

したがって、実装が正しいことを確認するためにRNNの簡単なアプリケーションが必要です。よりシンプルな方が良いでしょう。

たとえば、私は自分のCNNを証言するためにMNISTを使うことができます。

ありがとうございます。

+0

私はdownvotesを理解していません。 –

答えて

0

はあなたがhttps://github.com/nlintz/TensorFlow-Tutorials/からのより多くの例を見つけることができるシンプルなRNNモデル

def model(X, W, B, lstm_size): 
    # X, input shape: (batch_size, time_step_size, input_vec_size) 
    XT = tf.transpose(X, [1, 0, 2]) # permute time_step_size and batch_size 
    # XT shape: (time_step_size, batch_size, input_vec_size) 
    XR = tf.reshape(XT, [-1, lstm_size]) # each row has input for each lstm cell (lstm_size=input_vec_size) 
    # XR shape: (time_step_size * batch_size, input_vec_size) 
    X_split = tf.split(0, time_step_size, XR) # split them to time_step_size (28 arrays) 
    # Each array shape: (batch_size, input_vec_size) 

    # Make lstm with lstm_size (each input vector size) 
    lstm = tf.nn.rnn_cell.BasicLSTMCell(lstm_size, forget_bias=1.0, state_is_tuple=True) 

    # Get lstm cell output, time_step_size (28) arrays with lstm_size output: (batch_size, lstm_size) 
    outputs, _states = tf.nn.rnn(lstm, X_split, dtype=tf.float32) 

    # Linear activation 
    # Get the last output 
    return tf.matmul(outputs[-1], W) + B, lstm.state_size # State size to initialize the stat 

を参照してください。

関連する問題