Skip to content

Latest commit

 

History

History

AFM

tf.version == '2.1.0'

Data format :

说明:

(1第1列user id;
(2第2列user gender id;
(3第3列user age id;
(4第4列user occupation id;
(5第5列user zip id;
(6第6列item id;
(7第7列label

run model

sh master.sh

模型 summary

__________________________________________________________________________________________________
Layer (type)                    Output Shape         Param #     Connected to
==================================================================================================
user_id_input_layer (InputLayer [(None, 1)]          0
__________________________________________________________________________________________________
gender_input_layer (InputLayer) [(None, 1)]          0
__________________________________________________________________________________________________
age_input_layer (InputLayer)    [(None, 1)]          0
__________________________________________________________________________________________________
occupation_input_layer (InputLa [(None, 1)]          0
__________________________________________________________________________________________________
zip_input_layer (InputLayer)    [(None, 1)]          0
__________________________________________________________________________________________________
item_input_layer (InputLayer)   [(None, 1)]          0
__________________________________________________________________________________________________
user_id_embedding_layer (Embedd (None, 1, 64)        386624      user_id_input_layer[0][0]
__________________________________________________________________________________________________
gender_embedding_layer (Embeddi (None, 1, 64)        192         gender_input_layer[0][0]
__________________________________________________________________________________________________
age_embedding_layer (Embedding) (None, 1, 64)        512         age_input_layer[0][0]
__________________________________________________________________________________________________
occupation_embedding_layer (Emb (None, 1, 64)        1408        occupation_input_layer[0][0]
__________________________________________________________________________________________________
zip_embedding_layer (Embedding) (None, 1, 64)        220160      zip_input_layer[0][0]
__________________________________________________________________________________________________
item_id_embedding_layer (Embedd (None, 1, 64)        237248      item_input_layer[0][0]
__________________________________________________________________________________________________
afm_layer (AFMLayer)            (None, 1)            1054        user_id_embedding_layer[0][0]
                                                                 gender_embedding_layer[0][0]
                                                                 age_embedding_layer[0][0]
                                                                 occupation_embedding_layer[0][0]
                                                                 zip_embedding_layer[0][0]
                                                                 item_id_embedding_layer[0][0]
__________________________________________________________________________________________________
tf_op_layer_Sum (TensorFlowOpLa [(None,)]            0           afm_layer[0][0]
__________________________________________________________________________________________________
tf_op_layer_Sigmoid (TensorFlow [(None,)]            0           tf_op_layer_Sum[0][0]
==================================================================================================
Total params: 847,198
Trainable params: 847,198
Non-trainable params: 0
__________________________________________________________________________________________________
None

参考

1. 深度学习推进系统王喆著

2. https://github.com/shenweichen/DeepCTR/blob/master/deepctr/layers/interaction.py