我需要实现一个输入和输出都通过完全连接的神经网络传输的lstm?现在,我正在通过箍来实现这个目标。我需要知道这是否有效以及是否可以更有效地实施
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())