zgw21cn / deepfm Goto Github PK
View Code? Open in Web Editor NEWImplementation of DeepFM using tensorflow.
Implementation of DeepFM using tensorflow.
second_order = np.zeros([sample_size,1])
second_order = second_order+tf.reshape(tf.reduce_sum(tf.multiply(former, later), 1, keep_dims=True ),[sample_size,1])
It seems all the second order product are added together before sending to the output layer.
However, in the paper each dot product node are connected to the output. How should we understand this piece of code?
sparse_index = tf.placeholder(tf.int64, [None, 2])
sparse_ids = tf.placeholder(tf.int64, [None])
sparse_values = tf.placeholder(tf.float32, [None])
sparse_shape = tf.placeholder(tf.int64, [2])
ids = tf.SparseTensor(sparse_index, sparse_ids, sparse_shape)
values = tf.SparseTensor(sparse_index, sparse_values, sparse_shape)
sparse input like this above
how do you handle it?
Line 163 in eaefd89
Thanks for sharing!
According to the original paper, DeepFM should concatenate linear, 2-order and DNN layer first, then apply a final DNN layer to generate the final CTR. In your code base, these 3 layers are added before feeding to the final DNN layer. Am I wrong?
In the build_model method:
V =tf.reshape(tf.nn.embedding_lookup(inter_vector, X_code),[sample_size,feature_code_size*embed_size])
Then will different code variables share the same embedding vector? e.g. Variable A code 1, and Variable B code 1 will use the same piece of embedding vector after the embedding_lookup.
Please, are you implementing deep FMDeepFM: A Factorization-Machine based Neural Network for CTR Prediction.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.