Imported from https://github.com/maddy6/LSTM_DEEP