Recently, I have seen some examples, keras in the prediction, sequential common collocation is as follows
Sentiment analysis
Embedding, lstm, dense
Embedding is mainly used for one-hot coding of words, LSTM is mainly used for long-distance memory, dense is full connection.
CTR forecast or sequence forecast
LSTM-Dense is enough, of course, the front can be more than lstm.
- Loss (objective function) aspect
Loss= ' mean_squared_error ' (mean square error), or loss= ' Mae ' (absolute difference) whichever is either.
- Optimizer (Optimizer)
Common usage of optimizer= ' Adam '. Metrics often set to ' accuracy '
- Activation function
There are many, such as Sigmoid, Tanhyperbolic (Tanh), ReLu, Softplus, and Softmax functions. But Relu is often used in practice. You can view this article (60883604).
Generally use Relu when the LSTM layer is large, and use the default Tanh less often
Common settings for Keras sequential (sequential) models