[linux] deepctr[gpu] VarLenSparseFeat调用格式

deepctr.inputs.VarLenSparseFeat

由于VarLenSparseFeatSparseFeat存在较多相同参数,且很多情况下相同参数的取值也是相同的(如用户历史商品点击序列和待预估商品),故将VarLenSparseFeat的初始化参数更改为由一个SparseFeat的实例和其他序列相关的参数组成。

对用户而言,只需要理解SparseFeat的参数含义以及一些序列相关的参数含义就可以使用VarLenSparseFeat

  • 旧:VarLenSparseFeat(name, maxlen, vocabulary_size, embedding_dim=4, combiner="mean", use_hash=False, dtype="float32", length_name=None, weight_name=None, embedding_name=None, group_name=DEFAULT_GROUP_NAME)
  • 新:VarLenSparseFeat(sparsefeat, maxlen, combiner="mean", length_name=None, weight_name=None, weight_norm=True)

or feature_columns += [VarLenSparseFeat(SparseFeat('hist_merchant_id',vocabulary_size=19111+1,embedding_dim=8, embedding_name='merchant_id'), maxlen=M, combiner='mean', weight_name='merchant_id'),
                   VarLenSparseFeat(SparseFeat('hist_action_type',vocabulary_size=4+1, embedding_dim=4, embedding_name='action_type') , maxlen=M,  combiner='mean', weight_name='action_type')]

参考:https://github.com/shenweichen/

你可能感兴趣的:(linux,python)