How to implement lstm with fully connected neural network on both input and outputs using tflearn?

Viewed 392

I need to implement a lstm where both the input and outputs are passed through fully connected neural network? Right now, I am jumping through hoops to implement this. I need to know if this will work and if it can be implemented more efficiently

    inputs = tflearn.input_data(shape=[None, seq_len, ip_dim]) ## (samples, timesteps, ip_dim)
    net = tflearn.reshape (inputs, new_shape = [-1, ip_dim])
    net = tflearn.fully_connected(net, 300, weights_init = tflearn.initializations.xavier())
    net = tflearn.reshape (net, new_shape = (-1, seq_len, 300))

    net = tflearn.gru(net, 400, activation='relu',return_seq = True, dynamic = False, weights_init = tflearn.initializations.xavier())
    net = tf.concat(net, axis = 0)

    net = tflearn.fully_connected(net, self.a_dim, weights_init = tflearn.initializations.xavier())
0 Answers
Related