What you're looking for is covered in the keras LSTM examples:
from keras.layers import LSTM, Dense
import numpy as np
data_dim = 16
timesteps = 8
num_classes = 10
# expected input data shape: (batch_size, timesteps, data_dim)
model = Sequential()
model.add(LSTM(32, return_sequences=True,
input_shape=(timesteps, data_dim))) # returns a sequence of vectors of dimension 32
model.add(LSTM(32, return_sequences=True)) # returns a sequence of vectors of dimension 32
model.add(LSTM(32)) # return a single vector of dimension 32
model.add(Dense(10, activation='softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='rmsprop',
metrics=['accuracy'])
# Generate dummy training data
x_train = np.random.random((1000, timesteps, data_dim))
y_train = np.random.random((1000, num_classes))
# Generate dummy validation data
x_val = np.random.random((100, timesteps, data_dim))
y_val = np.random.random((100, num_classes))
model.fit(x_train, y_train,
batch_size=64, epochs=5,
validation_data=(x_val, y_val))
Source: https://keras.io/getting-started/sequential-model-guide/#examples
In your case, timesteps = 200, data_dim = 2.
It sounds like you have a continuous outcome and don't have classes, so you probably want to switch out the last layer to a Dense(1)
with a linear
activation or something, and switch out your loss and metrics appropriately (probably mean_squared_error
and mae
or something).
Also please note the architecture is purely an example, you may not need stacked LSTMs (or even LSTMs) for your example, you may want dropouts, you may want more dense layers, etc. This is just an example to get you started,