RNN implementation

Following program processes, a sequence of numbers and the goal is to predict the next value, with the previous values provided. The input to the RNN network at every time step is the current value and a state vector that represents or stores what the neural network has seen at timesteps before. This state-vector is the encoded memory of the RNN, initially set to zero.

Training data is basically a random binary vector. The output is shifted to the right.

from __future__ import print_function, divisionimport tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt"""define all the constants"""numEpochs = 10seriesLength = 50000backpropagationLength = 15stateSize = 4numClasses = 2echoStep = 3batchSize = 5num_batches ...

Get Neural Network Programming with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.