shenweichen / DeepCTR

Easy-to-use,Modular and Extendible package of deep-learning based CTR models .
https://deepctr-doc.readthedocs.io/en/latest/index.html
Apache License 2.0
7.54k stars 2.21k forks source link

Why Linear layer mode 0 will keep dimension for the sparse feature while mode 2 will not? #505

Open fengyinyang opened 1 year ago

fengyinyang commented 1 year ago

In deepctr tensorflow package, the output for Linear if only sparse features are presented would be the reduce_sum(sparse_input, axis=-1, keep_dims=True), but if there are both sparse and dense features, the output would be reduce_sum(sparse_input, axis=-1, keep_dims=False), what's the rationale for that? Thanks