from tensorflow.python.keras.layers import Layer
import tensorflow as tf
class bi_interaction(Layer):
def __init__(self, **kwargs):
super(bi_interaction, self).__init__(**kwargs)
def build(self, input_shape):
super(bi_interaction, self).build(input_shape)
def call(self, inputs):
concat_embed_value = inputs
square_of_sum = tf.square(tf.reduce_sum(concat_embed_value, axis=1, keep_dims=True))
sum_of_square = tf.reduce_sum(concat_embed_value * concat_embed_value, axis=1, keep_dims=True)
cross = 0.5 * (square_of_sum - sum_of_square)
return cross#(batch , 1, embed_size)
017 推荐系统 | NFM及其实现
推荐系统相关文章
- 推荐系统中序列建模优化的思路和常见模型(DIN、DIEN等)
- MMoE - Multi-gate Mixture-of-Experts - 多任务排序算法
- 论文:Modeling the Sequential Dependence among Audience Multi-step Conversions with Multi-task Learning in Targeted Display Advertising(AITM)
- 论文:A Survey on Large Language Models for Recommendation,大语言模型在推荐系统中的应用综述
- 推荐系统 | 疲劳度建模
- Self-Attentive Sequential Recommendation(SASRec)
- 推荐系统中的时长建模
- HPMN:基于个性化记忆的终身顺序建模用于用户响应预测
- 推荐模型提效常用方法
- 样本稀疏问题和解决方案
最近热门
- SO-PMI(Semantic Orientation Pointwise Mutual Information,情感倾向点互信息算法)
- kimi api
- NPU(Neural Processing Unit,神经网络处理器)
- vue3 vditor
- Straight-Through Estimator(STE, 直推估计器)
- 流匹配(Flow Matching,FM)
- 模型证据下界(Evidence Lower Bound,ELBO)
- LLM | Chain of Thought(CoT,思维链)
- Zero Redundancy Optimizer(ZeRO)内存优化技术
- 面向任意目标的全库向量召回技术PDM
最常浏览
- 016 推荐系统 | 排序学习(LTR - Learning To Rank)
- 偏微分符号
- i.i.d(又称IID)
- 利普希茨连续条件(Lipschitz continuity)
- (error) MOVED 原因和解决方案
- TextCNN详解
- 找不到com.google.protobuf.GeneratedMessageV3的类文件
- Deployment failed: repository element was not specified in the POM inside distributionManagement
- cannot access com.google.protobuf.GeneratedMessageV3 解决方案
- CLUSTERDOWN Hash slot not served 问题原因和解决办法
×