updated lstm.py for unit test