April 2017
Intermediate to advanced
320 pages
7h 46m
English
We listed the source code for the example previously described:
import tensorflow as tffrom tensorflow.contrib import rnn from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) learning_rate = 0.001 training_iters = 100000 batch_size = 128 display_step = 10 n_input = 28 n_steps = 28 n_hidden = 128 n_classes = 10 x = tf.placeholder("float", [None, n_steps, n_input]) y = tf.placeholder("float", [None, n_classes]) weights = { 'out': tf.Variable(tf.random_normal([n_hidden, n_classes])) } biases = { 'out': tf.Variable(tf.random_normal([n_classes])) } def RNN(x, weights, biases): x = tf.transpose(x, [1, 0, 2]) x = tf.reshape(x, [-1, n_input]) ...Read now
Unlock full access