def model_architecture(self, num_features, num_actions, max_history_len):
    'Build a keras model and return a compiled model.\n\n        :param max_history_len: The maximum number of historical\n                                turns used to decide on next action\n        '
    from keras.layers import LSTM, Activation, Masking, Dense
    from keras.models import Sequential
    n_hidden = 32
    batch_shape = (None, max_history_len, num_features)
    model = Sequential()
    model.add(Masking((- 1), batch_input_shape=batch_shape))
    model.add(LSTM(n_hidden, batch_input_shape=batch_shape, dropout=0.2))
    model.add(Dense(input_dim=n_hidden, units=num_actions))
    model.add(Activation('softmax'))
    model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
    logger.debug(model.summary())
    return model
Build a keras model and return a compiled model.

:param max_history_len: The maximum number of historical
                        turns used to decide on next action
def model_architecture(self, num_features, num_actions, max_history_len):
    'Build a keras model and return a compiled model.\n\n        :param max_history_len: The maximum number of historical\n                                turns used to decide on next action\n        '
    from keras.layers import LSTM, Activation, Masking, Dense
    from keras.models import Sequential
    n_hidden = 32
    batch_shape = (None, max_history_len, num_features)
    model = Sequential()
    model.add(Masking((- 1), batch_input_shape=batch_shape))
    model.add(LSTM(n_hidden, batch_input_shape=batch_shape, dropout=0.2))
    model.add(Dense(input_dim=n_hidden, units=num_actions))
    model.add(Activation('softmax'))
    model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
    logger.debug(model.summary())
    return model