deepctr.models.din module

Weichen Shen,
[1] Zhou G, Zhu X, Song C, et al. Deep interest network for click-through rate prediction[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2018: 1059-1068. (
deepctr.models.din.DIN(feature_dim_dict, seq_feature_list, embedding_size=8, hist_len_max=16, use_din=True, use_bn=False, hidden_size=(200, 80), activation='relu', att_hidden_size=(80, 40), att_activation=<class 'deepctr.activations.Dice'>, att_weight_normalization=False, l2_reg_deep=0, l2_reg_embedding=1e-05, final_activation='sigmoid', keep_prob=1, init_std=0.0001, seed=1024)[source]

Instantiates the Deep Interest Network architecture.

  • feature_dim_dict – dict,to indicate sparse field (now only support sparse feature)like {‘sparse’:{‘field_1’:4,’field_2’:3,’field_3’:2},’dense’:[]}
  • seq_feature_list – list,to indicate sequence sparse field (now only support sparse feature),must be a subset of feature_dim_dict["sparse"]
  • embedding_size – positive integer,sparse feature embedding_size.
  • hist_len_max – positive int, to indicate the max length of seq input
  • use_din – bool, whether use din pooling or not.If set to False,use sum pooling
  • use_bn – bool. Whether use BatchNormalization before activation or not in deep net
  • hidden_size – list,list of positive integer or empty list, the layer number and units in each layer of deep net
  • activation – Activation function to use in deep net
  • att_hidden_size – list,list of positive integer , the layer number and units in each layer of attention net
  • att_activation – Activation function to use in attention net
  • att_weight_normalization – bool.Whether normalize the attention score of local activation unit.
  • l2_reg_deep – float. L2 regularizer strength applied to deep net
  • l2_reg_embedding – float. L2 regularizer strength applied to embedding vector
  • final_activation – str,output activation,usually 'sigmoid' or 'linear'
  • keep_prob – float in (0,1]. keep_prob used in deep net
  • init_std – float,to use as the initialize std of embedding vector
  • seed – integer ,to use as random seed.

A Keras model instance.