I'm trying to create an LSTM network in Tensorflow and I'm lost in terminology/basics. I have n time series examples so X=xn, where xi=[[x11x12,x13],...,[xm1xm2,xm3]] and where xii is a float. First of all I want to train a model that given the start of a sequence ([x11x12,x13]) I can predict the rest of the sequence. Then later I hope to include a classifier to predict which binary class each xi belongs to.
So my problem is what do I feed in to the start and pull out the end of my model? So far I have something that looks like the below
class ETLSTM(object):
"""docstring for ETLSTM"""
def __init__(self, isTraining, config):
super(ETLSTM, self).__init__()
# This needs to be tidied
self.batchSize = batchSize = config.batchSize
self.numSteps = numSteps = config.numSteps
self.numInputs = numInputs = config.numInputs
self.numLayers = numLayers = config.numLayers
lstmSize = config.lstm_size
DORate = config.keep_prob
self.input_data = tf.placeholder(tf.float32, [batchSize, numSteps,
numInputs])
self.targets = tf.placeholder(tf.float32, [batchSize, numSteps,
numInputs])
lstmCell = rnn_cell.BasicLSTMCell(lstmSize, forgetbias=0.0)
if(isTraining and DORate < 1):
lstmCell = tf.nn.rnn_cell.DropoutWrapper(lstmCell,
output_keep_prob=DORate)
cell = tf.nn.rnn_cell.MultiRNNCell([lstmCell]*numLayers)
self._initial_state = cell.zero_state(batchSize, tf.float32)
# This won't work with my data, need to find what goes in...
with tf.device("/cpu:0"):
embedding = tf.get_variable("embedding", [vocab_size, size])
inputs = tf.nn.embedding_lookup(embedding, self._input_data)
if(isTraining and DORate < 1):
inputs = tf.nn.dropout(inputs, DORate)
EDIT:
Specifically, how to I finish the __init__ function so that it is compatible with my data?