可在训练引擎内进行特征级别的counting统计,从而简化离线特征计算流程的复杂度
在xdl.embedding接口函数中添加参数statis_list、statis_decay、statis_decay_period、labels,典型例子如下:
emb, statis = xdl.embedding(emb_name, batch["unit_id_expand"], xdl.Normal(stddev=0.001), emb_dim, 50000, emb_combiner, vtype="hash", feature_add_probability=feature_add_probability, statis_list=['click'], statis_decay=0.07, statis_decay_period=10, labels=batch['label']) # emb 是原embedding的输出,进入dense网络。 # statis 是统计输出,也可进入dense网络计算,也可由xdl.TrainSession(hooks).run()打印结果。数目与statis_list一致。
/* * S[0] = a[0] * S[N] = a[N] + decay * S[N-1] * = a[N] + decay*a[N-1] + decay^2*a[N-2] + ... + decay^(N-1)*a[1] + decay^N*a[0] * = a[N] + decay^(N-n) * S[n] (if a[n+1:N] == 0) * * N = gs / period * data = click + data * pow(decay, N - updated_n) * updated_n = N */
There was an error while loading. Please reload this page.