deepctr.models.xdeepfm module

Weichen Shen,
[1] Lian J, Zhou X, Zhang F, et al. xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems[J]. arXiv preprint arXiv:1803.05170, 2018.(
deepctr.models.xdeepfm.xDeepFM(feature_dim_dict, embedding_size=8, hidden_size=(256, 256), cin_layer_size=(128, 128), cin_split_half=True, cin_activation='relu', l2_reg_linear=1e-05, l2_reg_embedding=1e-05, l2_reg_deep=0, init_std=0.0001, seed=1024, keep_prob=1, activation='relu', final_activation='sigmoid', use_bn=False)[source]

Instantiates the xDeepFM architecture.

  • feature_dim_dict – dict,to indicate sparse field and dense field like {‘sparse’:{‘field_1’:4,’field_2’:3,’field_3’:2},’dense’:[‘field_4’,’field_5’]}
  • embedding_size – positive integer,sparse feature embedding_size
  • hidden_size – list,list of positive integer or empty list, the layer number and units in each layer of deep net
  • cin_layer_size – list,list of positive integer or empty list, the feature maps in each hidden layer of Compressed Interaction Network
  • cin_split_half – bool.if set to True, half of the feature maps in each hidden will connect to output unit
  • cin_activation – activation function used on feature maps
  • l2_reg_linear – float. L2 regularizer strength applied to linear part
  • l2_reg_embedding – L2 regularizer strength applied to embedding vector
  • l2_reg_deep – L2 regularizer strength applied to deep net
  • init_std – float,to use as the initialize std of embedding vector
  • seed – integer ,to use as random seed.
  • keep_prob – float in (0,1]. keep_prob used in deep net
  • activation – Activation function to use in deep net
  • final_activation – str,output activation,usually 'sigmoid' or 'linear'
  • use_bn – bool. Whether use BatchNormalization before activation or deep net

A Keras model instance.