Skip to content

Latest commit

 

History

History

NFM

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

tf.version == '2.1.0'

run model

NFM.ipynb

模型 summary

__________________________________________________________________________________________________
Layer (type)                    Output Shape         Param #     Connected to                     
==================================================================================================
Pclass (InputLayer)             [(None, 1)]          0                                            
__________________________________________________________________________________________________
Sex (InputLayer)                [(None, 1)]          0                                            
__________________________________________________________________________________________________
Cabin (InputLayer)              [(None, 1)]          0                                            
__________________________________________________________________________________________________
Embarked (InputLayer)           [(None, 1)]          0                                            
__________________________________________________________________________________________________
embedding_16 (Embedding)        (None, 1, 64)        256         Pclass[0][0]                     
__________________________________________________________________________________________________
embedding_17 (Embedding)        (None, 1, 64)        192         Sex[0][0]                        
__________________________________________________________________________________________________
embedding_18 (Embedding)        (None, 1, 64)        9536        Cabin[0][0]                      
__________________________________________________________________________________________________
embedding_19 (Embedding)        (None, 1, 64)        320         Embarked[0][0]                   
__________________________________________________________________________________________________
concatenate_15 (Concatenate)    (None, 4, 64)        0           embedding_16[0][0]               
                                                                 embedding_17[0][0]               
                                                                 embedding_18[0][0]               
                                                                 embedding_19[0][0]               
__________________________________________________________________________________________________
bi_interaction_pooling_3 (BiInt (None, 1, 64)        0           concatenate_15[0][0]             
__________________________________________________________________________________________________
Age (InputLayer)                [(None, 1)]          0                                            
__________________________________________________________________________________________________
SibSp (InputLayer)              [(None, 1)]          0                                            
__________________________________________________________________________________________________
Parch (InputLayer)              [(None, 1)]          0                                            
__________________________________________________________________________________________________
Fare (InputLayer)               [(None, 1)]          0                                            
__________________________________________________________________________________________________
dropout_2 (Dropout)             (None, 1, 64)        0           bi_interaction_pooling_3[0][0]   
__________________________________________________________________________________________________
concatenate_14 (Concatenate)    (None, 4)            0           Age[0][0]                        
                                                                 SibSp[0][0]                      
                                                                 Parch[0][0]                      
                                                                 Fare[0][0]                       
__________________________________________________________________________________________________
flatten_2 (Flatten)             (None, 64)           0           dropout_2[0][0]                  
__________________________________________________________________________________________________
concatenate_16 (Concatenate)    (None, 68)           0           flatten_2[0][0]                  
                                                                 concatenate_14[0][0]             
__________________________________________________________________________________________________
concatenate_13 (Concatenate)    (None, 1, 256)       0           embedding_16[0][0]               
                                                                 embedding_17[0][0]               
                                                                 embedding_18[0][0]               
                                                                 embedding_19[0][0]               
__________________________________________________________________________________________________
dnn_2 (DNN)                     (None, 128)          25344       concatenate_16[0][0]             
__________________________________________________________________________________________________
linear_4 (Linear)               (None, 1)            5           concatenate_13[0][0]             
                                                                 concatenate_14[0][0]             
__________________________________________________________________________________________________
dense_2 (Dense)                 (None, 1)            128         dnn_2[0][0]                      
__________________________________________________________________________________________________
add_2 (Add)                     (None, 1)            0           linear_4[0][0]                   
                                                                 dense_2[0][0]                    
__________________________________________________________________________________________________
prediction_layer_2 (PredictionL (None, 1)            1           add_2[0][0]                      
==================================================================================================
Total params: 35,782
Trainable params: 35,782
Non-trainable params: 0
__________________________________________________________________________________________________
None

参考

1. Neural Factorization Machines for Sparse Predictive Analytics

2. https://github.com/shenweichen/DeepCTR