Skip to content

Commit

Permalink
Added reference link
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongyao committed May 17, 2017
1 parent 03de74c commit 7ef5dbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions LSTMtutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
@author: yjiang
Reference: http://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/
http://machinelearningmastery.com/understanding-stateful-lstm-recurrent-neural-networks-python-keras/
http://colah.github.io/posts/2015-08-Understanding-LSTMs/
"""

# LSTM for international airline passengers problem with regression framing
Expand All @@ -25,6 +27,7 @@ def create_dataset(dataset, look_back=1):
dataX.append(a)
dataY.append(dataset[i + look_back, 0])
return numpy.array(dataX), numpy.array(dataY)

# fix random seed for reproducibility
numpy.random.seed(7)
# load the dataset
Expand All @@ -40,6 +43,8 @@ def create_dataset(dataset, look_back=1):
train, test = dataset[0:train_size,:], dataset[train_size:len(dataset),:]
# reshape into X=t and Y=t+1
look_back = 1

# why do we need to transform the dataset using look_back
trainX, trainY = create_dataset(train, look_back)
testX, testY = create_dataset(test, look_back)
# reshape input to be [samples, time steps, features]
Expand Down

0 comments on commit 7ef5dbf

Please sign in to comment.