Common settings for Keras sequential (sequential) models

Source: Internet
Author: User
Tags keras
  • 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.

    1. Loss (objective function) aspect

    Loss= ' mean_squared_error ' (mean square error), or loss= ' Mae ' (absolute difference) whichever is either.

    1. Optimizer (Optimizer)

    Common usage of optimizer= ' Adam '. Metrics often set to ' accuracy '

    1. 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

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.