Convert LSTM code to use **kwargs.