CN111949892A - A Multi-Relation Aware Temporal Interaction Network Prediction Method - Google Patents
A Multi-Relation Aware Temporal Interaction Network Prediction Method Download PDFInfo
- Publication number
- CN111949892A CN111949892A CN202010797094.5A CN202010797094A CN111949892A CN 111949892 A CN111949892 A CN 111949892A CN 202010797094 A CN202010797094 A CN 202010797094A CN 111949892 A CN111949892 A CN 111949892A
- Authority
- CN
- China
- Prior art keywords
- interaction
- relationship
- representation
- neighbor
- node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 65
- 230000009625 temporal interaction Effects 0.000 title claims abstract description 39
- 230000003993 interaction Effects 0.000 claims abstract description 226
- 230000002452 interceptive effect Effects 0.000 claims abstract description 31
- 238000004220 aggregation Methods 0.000 claims abstract description 21
- 230000002776 aggregation Effects 0.000 claims abstract description 19
- 238000005065 mining Methods 0.000 claims abstract description 5
- 239000011159 matrix material Substances 0.000 claims description 25
- 238000004364 calculation method Methods 0.000 claims description 23
- 230000008569 process Effects 0.000 claims description 22
- 230000007246 mechanism Effects 0.000 claims description 15
- 238000010586 diagram Methods 0.000 claims description 11
- 230000000644 propagated effect Effects 0.000 claims description 9
- 238000013528 artificial neural network Methods 0.000 claims description 8
- 239000013598 vector Substances 0.000 claims description 6
- 230000000306 recurrent effect Effects 0.000 claims description 5
- 238000004422 calculation algorithm Methods 0.000 claims description 4
- 230000008447 perception Effects 0.000 claims description 4
- 238000009795 derivation Methods 0.000 claims description 3
- 238000012935 Averaging Methods 0.000 claims description 2
- 238000010606 normalization Methods 0.000 claims description 2
- 230000008859 change Effects 0.000 claims 1
- 125000004122 cyclic group Chemical group 0.000 claims 1
- 230000003068 static effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9536—Search customisation based on social or collaborative filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9024—Graphs; Linked lists
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种多关系感知的时态交互网络预测方法,包括:(1)将时态交互网络中的交互作为样本;(2)按交互发生时间依次处理每个交互,基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点构建当前交互前的局部关系图;(3)根据用户上一次交互后的表示以及通过层次化多关系感知聚合得到的用户基于邻居的表示预测当前交互前物品的表示;(4)根据交互节点上一次交互后的表示、上一次交互和当前交互的时间间隔以及基于邻居的表示来更新交互节点的表示;(5)对时态交互网络预测模型进行训练后,利用参数调优后的时态交互网络预测模型预测用户可能会发生交互的物品。
The invention discloses a multi-relation-aware temporal interaction network prediction method, comprising: (1) taking the interaction in the temporal interaction network as a sample; (2) processing each interaction in sequence according to the interaction occurrence time, and based on historical interaction information Mining nodes with historical interaction, common interaction and interaction sequence similarity with interactive nodes, and constructs a local relationship graph before the current interaction for the interaction node; (3) According to the user's last interaction representation and through hierarchical The relationship-aware aggregation obtained by the user predicts the representation of the item before the current interaction based on the representation of the neighbors; (4) According to the representation of the interaction node after the last interaction, the time interval between the last interaction and the current interaction, and the neighbor-based representation, update the interaction node's representation. (5) After training the temporal interaction network prediction model, use the parameter-tuned temporal interaction network prediction model to predict items that users may interact with.
Description
技术领域technical field
本发明涉及时态交互网络预测领域,具体涉及一种多关系感知的时态交互网络预测方法。The invention relates to the field of temporal interaction network prediction, in particular to a multi-relation-aware temporal interaction network prediction method.
背景技术Background technique
在现实生活许多领域中,例如电子商务(顾客购买商品)、教育平台(学生参加慕课教程)和社交网络平台(用户在社区中发布帖子),用户会在不同时间和不同物品发生交互,用户和物品之间的交互形成了时态交互网络。与静态交互网络相比,时态交互网络增加了对交互时间的关注。时态交互网络预测指在交互发生前预测用户会和哪个物品进行交互,对于商品推荐、课程推荐、社区推荐等任务具有重要意义。In many real-life areas, such as e-commerce (customers buy goods), educational platforms (students take MOOCs), and social networking platforms (users post in communities), users interact with different items at different times, and users The interaction with objects forms a temporal interaction network. Compared with static interaction networks, temporal interaction networks increase the focus on interaction time. Temporal interaction network prediction refers to predicting which item the user will interact with before the interaction occurs, which is of great significance for tasks such as product recommendation, course recommendation, and community recommendation.
现有基于时态交互网络的预测方法包括两类,一类是不基于图结构的预测方法,另一类是基于图结构的预测方法。不基于图结构的预测方法是指不以图结构而以矩阵或序列等其他形式表示用户和物品之间的交互,可以分为基于隐语义模型的预测方法和基于序列模型的预测方法。基于隐语义模型的预测方法在传统隐语义模型的基础上引入时间信息来建模用户兴趣和物品属性的变化,得到用户和物品的表示从而进行预测。然而,这类工作没有考虑用户和物品之间发生交互的顺序。在时态交互网络中往往存在着丰富的序列信息,为了利用这些信息,许多基于序列模型的预测方法被提出,然而,这些方法都利用物品静态的表示作为输入来更新用户的表示,忽略了物品的当前状态信息。此外,这些方法大部分只考虑了用户兴趣的动态变化,忽略了物品属性的动态变化。Existing prediction methods based on temporal interaction networks include two categories, one is a prediction method not based on graph structure, and the other is a prediction method based on graph structure. Prediction methods not based on graph structure refer to representing the interaction between users and items in other forms such as matrices or sequences instead of graph structures. They can be divided into prediction methods based on latent semantic models and prediction methods based on sequence models. The prediction method based on the latent semantic model introduces time information on the basis of the traditional latent semantic model to model the changes of user interests and item attributes, and obtains the representation of users and items for prediction. However, this type of work does not consider the order in which interactions between users and items occur. There is often rich sequence information in temporal interaction networks. In order to utilize this information, many prediction methods based on sequence models have been proposed. However, these methods all use the static representation of items as input to update the user's representation, ignoring the items. current status information. In addition, most of these methods only consider the dynamic changes of user interests and ignore the dynamic changes of item attributes.
为了挖掘到用户和物品交互中更加丰富的信息,许多基于图结构的预测方法被提出。传统基于图结构的预测方法虽然将时间段作为图中节点,但其本质上还是静态图,无法很好建模用户和物品属性的动态性。为了解决这一问题,许多基于时态交互网络嵌入的预测方法被提出。基于时态交互网络嵌入的预测方法对时态交互网络进行嵌入得到用户和物品的表示从而进行预测。根据嵌入时是否聚合邻居信息,基于时态交互网络嵌入的预测方法可分为不考虑邻居信息的预测方法和考虑邻居信息的预测方法。不考虑邻居信息的预测方法虽然建模了交互节点的属性变化,但忽略了邻居信息的影响。现有的考虑邻居信息的预测方法考虑邻居信息时,只将具有历史交互关系的节点作为邻居节点,忽略了历史交互信息中的其他关系类型(共同交互关系、交互序列相似关系等)。In order to mine richer information in user-item interactions, many prediction methods based on graph structure have been proposed. Although traditional prediction methods based on graph structure use time periods as nodes in the graph, they are essentially static graphs and cannot model the dynamics of user and item attributes well. To address this issue, many prediction methods based on temporal interaction network embeddings have been proposed. Prediction methods based on temporal interaction network embeddings embed temporal interaction networks to obtain representations of users and items for prediction. According to whether neighbor information is aggregated during embedding, prediction methods based on temporal interaction network embedding can be divided into prediction methods that do not consider neighbor information and prediction methods that consider neighbor information. Although the prediction method without considering neighbor information models the attribute changes of interacting nodes, it ignores the influence of neighbor information. When the existing prediction methods considering neighbor information consider neighbor information, only nodes with historical interaction relationship are regarded as neighbor nodes, ignoring other relationship types (common interaction relationship, interaction sequence similarity relationship, etc.) in the historical interaction information.
发明内容SUMMARY OF THE INVENTION
鉴于上述,本发明提供了一种多关系感知的时态交互网络预测方法,通过有效利用邻居信息提升时态交互网络预测的准确性。In view of the above, the present invention provides a multi-relation-aware temporal interaction network prediction method, which improves the accuracy of temporal interaction network prediction by effectively utilizing neighbor information.
本发明的技术方案为:The technical scheme of the present invention is:
一种多关系感知的时态交互网络预测方法,包括以下步骤:A multi-relation-aware temporal interaction network prediction method, comprising the following steps:
(1)以用户ui和物品vj在时刻t发生的交互(ui,vj,t)作为一个样本构建训练数据集,并对训练数据集进行分批;(1) The interaction (u i , v j , t) between user ui and item v j at time t is used as a sample to construct a training data set, and the training data set is divided into batches;
(2)对于交互(ui,vj,t),基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点ui和vj构建当前交互前的局部关系图和 (2) For interaction (u i , v j , t), based on historical interaction information mining nodes with historical interaction relationship, common interaction relationship and interaction sequence similarity relationship between interaction nodes, and construct for interaction nodes u i and v j Local relationship graph before the current interaction and
(3)根据局部关系图和通过层次化多关系感知聚合得到用户ui基于邻居的表示和物品vj基于邻居的表示 (3) According to the local relationship diagram and Neighbor-based representation of user ui is obtained through hierarchical multi-relation-aware aggregation and neighbor-based representation of item v j
(4)根据用户ui上一次交互后的表示和用户ui基于邻居的表示利用全连接层计算当前交互前物品vj预测的表示 (4) According to the representation of user ui after the last interaction and the neighbor-based representation of user ui Using a fully connected layer to compute a representation of the prediction of the item v j before the current interaction
(5)根据用户ui和物品vj上一次交互后的表示和上一次交互和当前交互的时间间隔和以及基于邻居的表示和利用两个循环神经网络层分别计算用户ui和物品vj当前交互后的表示和 (5) According to the last interaction between user ui and item v j and The time interval between the last interaction and the current interaction and and a neighbor-based representation and Use two recurrent neural network layers to calculate the current interaction representation of user ui and item v j respectively and
(6)根据当前交互前物品vj预测的表示和真实的表示之间的误差、用户ui正则化损失和物品vj正则化损失,计算整体损失根据批次中所有样本的损失对时态交互网络预测模型中的网络参数进行调整,直到所有批次都参与了模型训练,所述时态交互网络预测模型包括步骤(2)~(6)用到的所有全连接层和循环神经网络层;(6) Representation predicted according to the current pre-interaction item v j and true representation The error between, user ui regularization loss and item v j regularization loss, calculate the overall loss Loss based on all samples in the batch Adjust the network parameters in the temporal interaction network prediction model until all batches participate in model training, and the temporal interaction network prediction model includes all fully connected layers and loops used in steps (2) to (6). neural network layer;
(7)利用参数调优后的时态交互网络预测模型预测用户可能会发生交互的物品。(7) Use the temporal interaction network prediction model after parameter tuning to predict the items that users may interact with.
本发明基于历史交互信息挖掘节点之间的多关系,为交互节点构建当前交互前的局部关系图,通过层次化多关系感知聚合来考虑邻居节点根据不同关系类型传播过来的交互影响。与现有方法相比,其优点在于:The present invention mines multi-relationships between nodes based on historical interaction information, constructs a local relationship graph before current interaction for interaction nodes, and considers the interaction effects propagated by neighbor nodes according to different relationship types through hierarchical multi-relational perceptual aggregation. Compared with existing methods, its advantages are:
1)基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点构建当前交互前的局部关系图,通过层次化多关系感知聚合得到交互节点基于邻居的表示来预测物品的表示以及更新交互节点的表示,考虑了节点之间的多关系,有效利用邻居信息,从而提升时态交互网络预测的准确性;1) Based on historical interaction information mining and nodes with historical interaction relationship, common interaction relationship and interaction sequence similarity relationship between interaction nodes, construct a local relationship graph before current interaction for interaction nodes, and obtain interaction nodes through hierarchical multi-relationship perception aggregation Predicting the representation of items and updating the representation of interactive nodes based on the representation of neighbors, considering multiple relationships between nodes, effectively utilizing neighbor information, thereby improving the accuracy of temporal interaction network prediction;
2)引入带注意力层的图神经网络,根据邻居节点传播过来的交互影响和节点之间的关系类型为邻居节点赋予相应权重,层次化地聚合根据不同关系类型传播过来的交互影响。2) Introduce a graph neural network with an attention layer, assign corresponding weights to neighbor nodes according to the interaction influences propagated by neighbor nodes and the relationship types between nodes, and hierarchically aggregate the interaction influences propagated according to different relationship types.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图做简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动前提下,还可以根据这些附图获得其他附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative efforts.
图1是实施例提供的多关系感知的时态交互网络预测方法整体流程图;1 is an overall flowchart of a multi-relation-aware temporal interaction network prediction method provided by an embodiment;
图2是实施例提供的多关系感知的时态交互网络预测方法整体框架图;2 is an overall framework diagram of a multi-relation-aware temporal interaction network prediction method provided by an embodiment;
图3是实施例提供的层次化多关系感知聚合示意图。FIG. 3 is a schematic diagram of hierarchical multi-relationship-aware aggregation provided by an embodiment.
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例对本发明进行进一步的详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本发明,并不限定本发明的保护范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and do not limit the protection scope of the present invention.
图1是实施例提供的多关系感知的时态交互网络预测方法整体流程图。图2是实施例提供的多关系感知的时态交互网络预测方法整体框架图。如图1和图2所示,实施例提供的多关系感知的时态交互网络预测方法包括以下步骤:FIG. 1 is an overall flowchart of a multi-relation-aware temporal interaction network prediction method provided by an embodiment. FIG. 2 is an overall framework diagram of a multi-relation-aware temporal interaction network prediction method provided by an embodiment. As shown in FIG. 1 and FIG. 2 , the multi-relation-aware temporal interaction network prediction method provided by the embodiment includes the following steps:
步骤1,输入时态交互网络表示按时间排序的N个交互,i为交互的索引,将每个交互s作为样本得到训练数据集,其中s=(u,v,t)表示用户和物品在时刻发生的交互,和分别为用户集合、物品集合和交互时间集合。将训练数据集按照t-n-Batch算法进行分批,批次总数为C。Step 1, input the temporal interaction network Represents N interactions sorted by time, i is the index of the interaction, and each interaction s is used as a sample to obtain a training data set, where s=(u, v, t) represents the user and items exist interactions that take place all the time, and They are user set, item set and interaction time set respectively. The training data set is divided into batches according to the tn-Batch algorithm, and the total number of batches is C.
实施例中,利用t-n-Batch算法对训练数据集进行分批,使同一个批次中的交互可以并行处理,并且按批次的索引顺序处理所有批次时可以保持交互之间的时间依赖。In the embodiment, the t-n-Batch algorithm is used to batch the training data set, so that the interactions in the same batch can be processed in parallel, and the time dependency between the interactions can be maintained when all batches are processed in the order of the index of the batch.
利用t-n-Batch算法对训练数据集进行分批的过程为:The process of batching the training data set using the t-n-Batch algorithm is as follows:
首先,初始化N个空批次,然后遍历训练数据集,将每个交互划分到相应的批次中。令lastU和lastV分别记录用户和物品所在批次的最大索引。以交互(ui,vj,t)为例,lastU[ui]表示用户ui所在批次的最大索引,即索引为lastU[ui]的批次中的交互涉及到用户ui,且该批次为涉及到该用户的批次中索引最大的。同理lastV[vj]表示物品vj所在批次的最大索引,idxN为用户ui和物品vj的所有邻居节点所在batch的最大索引。由于每个节点在一个批次中最多只能出现一次,并且每个节点的第i个和第i+1个交互需要分别被划分到第k个批次Bk和第l个批次Bl,其中k<l,因此交互(ui,vj,t)会被划分到索引为max(lastU[ui],lastV[vj],idxN)+1的批次。批次划分结束后,去掉多余的空批次,剩余批次总数为C。First, N empty batches are initialized, and then the training dataset is traversed, dividing each interaction into a corresponding batch. Let lastU and lastV record the maximum index of the batch in which the user and item are located, respectively. Taking the interaction (u i , v j , t) as an example, lastU[u i ] represents the maximum index of the batch where the user ui is located, that is, the interaction in the batch with the index lastU[u i ] involves the user ui , And the batch has the largest index among the batches involving the user. Similarly lastV[v j ] represents the maximum index of the batch where item v j is located, and idxN is the maximum index of the batch where user ui and all neighbor nodes of item v j are located. Since each node can only appear at most once in a batch, and the i-th and i+1-th interactions of each node need to be divided into the k-th batch B k and the l-th batch B l respectively , where k<l, so interactions (u i ,v j ,t) are divided into batches with index max(lastU[u i ],lastV[v j ],idxN)+1. After the batch division is completed, the redundant empty batches are removed, and the total number of remaining batches is C.
步骤2,从训练数据集中顺序选取索引为k的一批训练样本,其中k∈{1,2,…,C}。对该批次中的每一个训练样本,进行步骤3-7。Step 2, sequentially select a batch of training samples with index k from the training dataset, where k∈{1,2,…,C}. For each training sample in the batch, proceed to steps 3-7.
步骤3,对于交互(ui,vj,t),基于历史交互信息挖掘与交互节点之间存在历史交互关系、共同交互关系和交互序列相似关系的节点,为交互节点ui和vj构建当前交互前的局部关系图和 Step 3: For interaction (u i , v j , t), based on historical interaction information, mine the nodes with historical interaction, common interaction and interaction sequence similarity with interaction nodes, and construct for interaction nodes ui and vj . Local relationship graph before the current interaction and
本实施例中,以节点ni为例,局部关系图其中和分别表示与节点ni相关的节点集合、边集合、关系类型集合和关系属性集合。边e定义为三元组表示节点ni与节点nj之间存在关系,关系类型为包括历史交互关系、共同交互关系和交互序列相似关系三种类型,关系属性为其中q=(t,w),t表示时间属性,w表示权重属性。In this embodiment, taking the node n i as an example, the local relationship diagram in and Respectively represent the node set, edge set, relation type set and relation attribute set related to node n i . Edge e is defined as a triple Indicates that there is a relationship between node n i and node n j , and the relationship type is It includes three types of historical interaction relationship, common interaction relationship and interaction sequence similarity relationship. The relationship attributes are Where q=(t, w), t represents the time attribute, and w represents the weight attribute.
多关系导出的具体方法如下:The specific method of multi-relation export is as follows:
1)历史交互关系1) Historical interaction
若两个节点历史上发生过交互,则两个节点之间存在历史交互关系,历史交互关系的时间属性t为两个节点最后一次交互的时刻,权重属性w为历史发生交互的次数。If the two nodes have interacted in the history, there is a historical interaction relationship between the two nodes. The time attribute t of the historical interaction relationship is the last interaction time between the two nodes, and the weight attribute w is the number of historical interactions.
2)共同交互关系2) Common interaction
若两个节点在T时间段内和同一个节点发生过交互,则两个节点之间存在共同交互关系。共同交互关系的时间属性t为两个节点最后一次共同交互的时刻,其中共同交互的时刻为两个节点和同一个节点交互的时刻中离当前最近的时刻,权重属性w为历史共同交互次数。If the two nodes have interacted with the same node within the T time period, there is a common interaction relationship between the two nodes. The time attribute t of the common interaction relationship is the last time when the two nodes interact together, where the time of common interaction is the closest moment to the current moment when the two nodes interact with the same node, and the weight attribute w is the number of historical common interactions.
3)交互序列相似关系3) Reciprocal sequence similarity
将所有交互序列看成“文档”,每个交互序列看成“句子”,交互序列中的节点看成“词”,利用Doc2Vec模型分别对用户交互序列和物品交互序列进行嵌入后,可以得到每个用户基于交互序列的表示和每个物品基于交互序列的表示。All interaction sequences are regarded as "documents", each interaction sequence is regarded as "sentence", and the nodes in the interaction sequence are regarded as "words". interaction-sequence-based representation of each user and interaction-sequence-based representation of each item.
由于用户和物品之间不断发生交互,使用增量训练的方式来更新Doc2Vec模型,得到新的用户和物品基于交互序列的表示。给定两个同类型节点(两个用户或两个物品)ni和nj基于交互序列的表示和计算两者之间的余弦相似度,计算方式如下:Due to the continuous interaction between users and items, incremental training is used to update the Doc2Vec model to obtain new representations of users and items based on interaction sequences. Given two nodes of the same type (two users or two items) n i and n j based on the interaction sequence representation and Calculate the cosine similarity between the two as follows:
其中,·表示点积。where · represents the dot product.
设置阈值μ,只有当余弦相似度cosSim大于阈值μ时,两个节点之间存在交互序列相似关系。交互序列相似关系的时间属性t为两个节点交互序列中最后发生的交互的时刻,权重属性w为余弦相似度。Set the threshold μ, only when the cosine similarity cosSim When it is greater than the threshold μ, there is an interaction sequence similarity relationship between the two nodes. The time attribute t of the interaction sequence similarity relationship is the moment of the last interaction in the interaction sequence of the two nodes, and the weight attribute w is the cosine similarity.
通过上述多关系导出具体方法挖掘与交互节点存在历史交互关系、共同交互关系和交互序列相似关系的节点后,即可以为交互节点ui和vj构建当前交互前的局部关系图和 After mining the nodes that have historical interaction relationship, common interaction relationship and interaction sequence similarity relationship with interactive nodes through the above specific method of multi-relation derivation, the local relationship graph before the current interaction can be constructed for the interaction nodes u i and v j and
步骤4,根据局部关系图和通过层次化多关系感知聚合得到用户ui基于邻居的表示和物品vj基于邻居的表示 Step 4, according to the local relationship diagram and Neighbor-based representation of user ui is obtained through hierarchical multi-relation-aware aggregation and neighbor-based representation of item v j
实施例中,层次化多关系感知聚合共包含两层聚合过程:关系内聚合和关系间聚合。图3给出了层次化多关系感知聚合示意图。In the embodiment, the hierarchical multi-relationship-aware aggregation includes a total of two layers of aggregation processes: intra-relational aggregation and inter-relational aggregation. Figure 3 presents a schematic diagram of hierarchical multi-relation-aware aggregation.
为简化运算,将邻居节点上一次交互后的表示作为其传播过来的交互影响。以节点ni为例,构建该节点在当前交互前的局部关系图若节点ni为用户,对应用户为uj,则该节点上一次交互后的表示为若节点ni为物品,对应物品为vj,则该节点上一次交互后的表示为为简化符号,将节点ni上一次交互后的表示记为当节点ni发生交互时,给定该节点在上一次交互和当前交互的时间间隔内,局部关系图中发生了交互的邻居节点传播过来的交互影响,即邻居节点发生交互后的表示其中M为邻居节点中发生了交互的节点数量,层次化多关系感知聚合的具体过程为:In order to simplify the operation, the representation of the neighbor node after the last interaction is taken as its propagated interaction influence. Taking node n i as an example, construct the local relationship graph of this node before the current interaction If the node n i is a user and the corresponding user is u j , the representation of the node after the last interaction is: If the node n i is an item and the corresponding item is v j , the representation of the node after the last interaction is To simplify the notation, denote the representation of node n i after the last interaction as When node n i interacts, given the time interval between the last interaction and the current interaction of this node, the local relationship graph The interactive influence propagated by the interacting neighbor nodes, that is, the representation after the neighbor nodes interact where M is the number of nodes that interact with neighbor nodes, and the specific process of hierarchical multi-relationship-aware aggregation is:
第一层为关系内聚合,聚合邻居节点根据同一种关系类型传播过来的交互影响,为不同的邻居节点赋予相应的权重,得到节点基于特定关系类型的邻居表示。为区分节点之间的关系类型,利用三个参数不同的包含K个头的多头注意力机制分别对历史交互关系、共同交互关系和交互序列相似关系进行关系内聚合,得到节点ni基于历史交互关系的邻居表示基于共同交互关系的邻居表示和基于交互序列相似关系的邻居表示 The first layer is intra-relational aggregation, which aggregates neighbor nodes according to the interactive influences propagated by the same relationship type, assigns corresponding weights to different neighbor nodes, and obtains a node’s neighbor representation based on a specific relationship type. In order to distinguish the relationship types between nodes, three multi-head attention mechanisms including K heads with different parameters are used to aggregate historical interaction, common interaction and interaction sequence similarity respectively, and get node n i based on historical interaction. neighbors said Neighbor Representation Based on Common Interactions and neighbor representations based on interaction sequence similarity
对于给定节点ni的邻居节点nj,多头注意力机制的输入为则第k个头的注意力机制的输入计算如下:For the neighbor nodes n j of a given node n i , the input of the multi-head attention mechanism is Then the input of the attention mechanism of the kth head The calculation is as follows:
其中,表示第k个头输入参数矩阵,不同关系类型相同。根据该邻居节点的输入第k个头的注意力系数计算如下:in, Represents the kth head input parameter matrix, different relation types same. According to the input of this neighbor node The attention coefficient of the k-th head is calculated as follows:
其中,表示第k个头的注意力权重矩阵,不同关系类型不同。T表示矩阵转置,‖表示向量连接操作。表示与关系属性q相关的权重,计算过程如公式(4)所示。in, Represents the attention weight matrix of the kth head, different relation types different. T stands for matrix transpose, and ‖ stands for vector join operation. represents the weight related to the relationship attribute q, and the calculation process is shown in formula (4).
将关系属性q=(t,w)输入全连接层,得到输出值若关系类型r为历史交互关系,则t属性表示节点ni和邻居节点nj最后一次交互的时刻,w属性表示两个节点历史发生交互的次数;若关系类型r为共同交互关系,则t属性为两个节点最后一次共同交互的时刻,w属性为历史共同交互次数;若关系类型r为交互序列相似关系,则t属性为两个节点交互序列中最后发生的交互的时刻,w属性为余弦相似度。计算公式如下:Input the relational attribute q=(t, w) into the fully connected layer to get the output value If the relationship type r is a historical interaction relationship, the t attribute represents the last interaction moment between the node n i and its neighbor node n j , and the w attribute represents the number of historical interactions between the two nodes; if the relationship type r is a common interaction relationship, then t The attribute is the last mutual interaction time between the two nodes, and the w attribute is the number of historical mutual interactions; if the relationship type r is an interaction sequence similarity relationship, the t attribute is the last interaction time in the interaction sequence of the two nodes, and the w attribute is Cosine similarity. Calculated as follows:
其中Wfeat为全连接层的参数矩阵,bfeat为全连接层的偏置,不同关系类型不同头共享该全连接层。Among them, W feat is the parameter matrix of the fully connected layer, and b feat is the bias of the fully connected layer. Different relationship types and different heads share the fully connected layer.
对给定节点ni所有关系类型为历史交互关系的邻居节点做权重归一化,得到邻居节点nj归一化后的第k个头的注意力系数:Normalize the weights of all neighbor nodes whose relationship type is historical interaction relationship for a given node n i , and obtain the attention coefficient of the k-th head after the normalization of neighbor node n j :
其中,是给定节点ni关系类型为历史交互关系的邻居节点集合。基于上述计算,第k个头的隐向量计算如下:in, is the set of neighbor nodes for a given node n i whose relationship type is historical interaction relationship. Based on the above calculation, the hidden vector of the kth head The calculation is as follows:
对于给定节点ni通过K个头得到的隐向量求均值后得到节点ni基于历史交互关系的邻居表示计算过程如公式(7)所示:For a given node n i the hidden vector obtained through the K heads After averaging, the neighbor representation of node n i based on the historical interaction relationship is obtained The calculation process is shown in formula (7):
将关系类型为历史交互关系的相关参数换成共同交互关系的相关参数,利用公式(2)~(7)获得基于共同交互关系的邻居表示同样,将关系类型为历史交互关系的相关参数换成交互序列相似关系的相关参数,利用公式(2)~(7)获得基于交互序列相似关系的邻居表示涉及到的相关参数包括关系属性q、每种关系类型的邻居节点集合、注意力权重矩阵 Replace the relevant parameters of the historical interaction relationship with the relevant parameters of the common interaction relationship, and use formulas (2) to (7) to obtain the neighbor representation based on the common interaction relationship Similarly, replace the relevant parameters of the historical interaction relationship with the relevant parameters of the interaction sequence similarity relationship, and use formulas (2) to (7) to obtain the neighbor representation based on the interaction sequence similarity relationship. The relevant parameters involved include the relationship attribute q, the set of neighbor nodes for each relationship type, and the attention weight matrix
第二层为关系间聚合,由于根据不同关系类型传播过来的交互影响对给定节点的重要性是不同的,利用自注意力机制为不同的关系类型赋予相应的权重。给定节点ni,利用关系内聚合可以得到基于不同关系类型的邻居表示,将其通过自注意力机制进行聚合,得到节点ni基于邻居的表示。The second layer is the aggregation between relations. Since the importance of the interaction effects propagated by different relation types to a given node is different, the self-attention mechanism is used to assign corresponding weights to different relation types. Given a node n i , neighbor representations based on different relation types can be obtained by using intra-relational aggregation, and aggregated through a self-attention mechanism to obtain a neighbor-based representation of node n i .
对于节点ni基于历史交互关系的邻居表示基于共同交互关系的邻居表示和基于交互序列相似关系的邻居表示拼接后得到自注意力机制的输入自注意力机制的查询矩阵Q、键矩阵K和值矩阵V的计算过程如下:Neighbor representation based on historical interaction for node n i Neighbor Representation Based on Common Interactions and neighbor representations based on interaction sequence similarity After splicing, the input of the self-attention mechanism is obtained The calculation process of the query matrix Q, key matrix K and value matrix V of the self-attention mechanism is as follows:
Q=HWQ (8)Q=HW Q (8)
K=HWK (9)K=HW K (9)
V=HWV (10)V=HW V (10)
其中和分别为查询权重矩阵、键权重矩阵和值权重矩阵。自注意力机制的输出如公式(11)所示:in and are the query weight matrix, key weight matrix and value weight matrix, respectively. The output of the self-attention mechanism As shown in formula (11):
其中,为比例因子,dk=dv。in, is the scaling factor, d k =d v .
将上述注意力机制的输出Z输入到全连接层中,得到节点ni基于邻居的表示计算过程如公式(12)所示:Input the output Z of the above attention mechanism into the fully connected layer to obtain the neighbor-based representation of node n i The calculation process is shown in formula (12):
其中,Wout为全连接层的参数矩阵,bout为全连接层的偏置。Among them, W out is the parameter matrix of the fully connected layer, and b out is the bias of the fully connected layer.
根据局部关系图和利用上述层次化多关系感知聚合得到用户ui基于邻居的表示和物品vj基于邻居的表示 According to the local relationship diagram and Using the above hierarchical multi-relation-aware aggregation to obtain the neighbor-based representation of user ui and neighbor-based representation of item v j
步骤5,根据用户ui上一次交互后的表示和用户ui基于邻居的表示利用全连接层计算当前交互前物品vj预测的表示 Step 5, according to the representation of user ui after the last interaction and the neighbor-based representation of user ui Using a fully connected layer to compute a representation of the prediction of the item v j before the current interaction
实施例中,根据用户ui上一次交互后的表示和用户ui基于邻居的表示利用全连接层计算当前交互前物品vj预测的表示计算过程如公式(13)所示:In the embodiment, according to the representation of the user ui after the last interaction and the neighbor-based representation of user ui Using a fully connected layer to compute a representation of the prediction of the item v j before the current interaction The calculation process is shown in formula (13):
其中,W1和W2为全连接层的参数矩阵,b为全连接层的偏置。Among them, W 1 and W 2 are the parameter matrices of the fully connected layer, and b is the bias of the fully connected layer.
步骤6,根据用户ui和物品vj上一次交互后的表示和上一次交互和当前交互的时间间隔和以及基于邻居的表示和利用两个循环神经网络层分别计算用户ui和物品vj当前交互后的表示和 Step 6, according to the last interaction between user ui and item v j and The time interval between the last interaction and the current interaction and and a neighbor-based representation and Use two recurrent neural network layers to calculate the current interaction representation of user ui and item v j respectively and
如图2所示,利用两个循环神经网络层RNNU和RNNV分别计算用户ui和物品vj当前交互后的表示和RNNU的输入为用户ui上一次交互后的表示物品vj上一次交互后的表示用户ui基于邻居的表示以及用户上一次交互和当前交互的时间间隔RNNV的输入为物品vj上一次交互后的表示用户ui上一次交互后的表示物品vj基于邻居的表示以及物品上一次交互和当前交互的时间间隔RNNU和RNNV的具体计算公式如下:As shown in Figure 2, two recurrent neural network layers RNN U and RNN V are used to calculate the current interaction representation of user ui and item v j , respectively and The input of RNN U is the representation of user u i after the last interaction Representation of item v j after the last interaction Neighbor-based representation of user u i and the time interval between the user's last interaction and the current interaction The input of RNN V is the representation of item v j after the last interaction The representation of user u i after the last interaction Neighbor-based representation of item v j and the time interval between the item's last interaction and the current interaction The specific calculation formulas of RNN U and RNN V are as follows:
其中,表示RNNU的网络参数,表示RNNV的网络参数,和分别为时间间隔和通过全连接层得到的表示,不同时间间隔共享该全连接层。所有用户共享RNNU以更新用户的表示,所有物品共享RNNV以更新物品的表示。将RNNU和RNNV的隐状态分别作为用户和物品的表示。in, represents the network parameters of RNN U , represents the network parameters of RNN V , and time interval and A representation obtained through a fully connected layer, which is shared across different time intervals. All users share RNN U to update the user's representation, and all items share RNN V to update the item's representation. The hidden states of RNN U and RNN V are used as user and item representations, respectively.
步骤7,根据当前交互前物品vj预测的表示和真实的表示之间的误差、用户ui正则化损失和物品vj正则化损失,计算整体损失 Step 7, according to the predicted representation of the item v j before the current interaction and true representation The error between, user ui regularization loss and item v j regularization loss, calculate the overall loss
将物品vj上一次交互后的表示作为其当前交互前真实的表示最小化物品vj预测的表示和真实的表示之间的均方误差得到预测损失,整体损失计算如下:Take the representation of item v j after the last interaction as its real representation before the current interaction Minimize the representation of item v j predictions and true representation The mean squared error between gets the predicted loss, the overall loss The calculation is as follows:
其中,第一项为预测损失,后两项为正则化项,以避免用户和物品的表示变化过大,λU和λI为尺度参数,‖ ‖2表示L2距离。Among them, the first term is the prediction loss, the last two terms are regularization terms to avoid excessive variation in the representation of users and items, λ U and λ I are scale parameters, and ‖ ‖ 2 represents the L2 distance.
步骤8,根据批次中所有样本的损失对整个模型中的网络参数进行调整。Step 8, according to the loss of all samples in the batch Make adjustments to network parameters throughout the model.
计算批次中所有样本的损失具体计算方式如下所示:Calculate the loss for all samples in the batch The specific calculation method is as follows:
其中为每个样本的损失,M为批次中样本的数量。在本发明中,根据损失对整个模型中的网络参数进行调整。in is the loss per sample, and M is the number of samples in the batch. In the present invention, according to the loss Make adjustments to network parameters throughout the model.
步骤9,重复步骤2-8直到训练数据集的所有批次都参与了模型训练。Step 9, repeat steps 2-8 until all batches of the training dataset participate in model training.
步骤10,若达到指定的训练迭代次数,则训练结束;否则返回步骤2。Step 10: If the specified number of training iterations is reached, the training ends; otherwise, return to Step 2.
步骤11,利用参数调优后的时态交互网络预测模型预测用户可能会发生交互的物品。Step 11: Use the temporal interaction network prediction model after parameter tuning to predict items that the user may interact with.
基于上述训练结束后得到的用户和物品表示,以用户ui为例,给定用户ui上一次交互后的表示和用户ui基于邻居的表示计算交互涉及物品预测的表示具体过程如公式(13)所示。计算物品预测的表示与所有物品真实的表示之间的L2距离,L2距离小的top-K个物品为该用户可能会发生交互的物品。Based on the user and item representations obtained after the above training, taking user ui as an example, given the representation of user ui after the last interaction and the neighbor-based representation of user ui Computational interactions involve representations of item predictions The specific process is shown in formula (13). Compute the representation of item predictions Authentic representation with all items The L2 distance between them, the top-K items with the smallest L2 distance are the items that the user may interact with.
以上所述的具体实施方式对本发明的技术方案和有益效果进行了详细说明,应理解的是以上所述仅为本发明的最优选实施例,并不用于限制本发明,凡在本发明的原则范围内所做的任何修改、补充和等同替换等,均应包含在本发明的保护范围之内。The above-mentioned specific embodiments describe in detail the technical solutions and beneficial effects of the present invention. It should be understood that the above-mentioned embodiments are only the most preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, additions and equivalent substitutions made within the scope shall be included within the protection scope of the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010797094.5A CN111949892B (en) | 2020-08-10 | 2020-08-10 | A Multi-Relation Aware Temporal Interaction Network Prediction Method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010797094.5A CN111949892B (en) | 2020-08-10 | 2020-08-10 | A Multi-Relation Aware Temporal Interaction Network Prediction Method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111949892A true CN111949892A (en) | 2020-11-17 |
CN111949892B CN111949892B (en) | 2022-04-05 |
Family
ID=73331993
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010797094.5A Active CN111949892B (en) | 2020-08-10 | 2020-08-10 | A Multi-Relation Aware Temporal Interaction Network Prediction Method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111949892B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112541129A (en) * | 2020-12-06 | 2021-03-23 | 支付宝(杭州)信息技术有限公司 | Method and device for processing interaction event |
CN113191400A (en) * | 2021-04-14 | 2021-07-30 | 中国海洋大学 | Method and device for retrieving corresponding three-dimensional model based on two-dimensional image |
CN113537613A (en) * | 2021-07-28 | 2021-10-22 | 浙江大学 | A Motif-aware Temporal Network Prediction Method |
CN114969540A (en) * | 2022-06-10 | 2022-08-30 | 重庆大学 | Method for predicting future interaction behavior of user in social network |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140362091A1 (en) * | 2013-06-07 | 2014-12-11 | Ecole Polytechnique Federale De Lausanne | Online modeling for real-time facial animation |
CN110555469A (en) * | 2019-08-15 | 2019-12-10 | 阿里巴巴集团控股有限公司 | Method and device for processing interactive sequence data |
US10650432B1 (en) * | 2016-11-28 | 2020-05-12 | Amazon Technologies, Inc. | Recommendation system using improved neural network |
CN111159425A (en) * | 2019-12-30 | 2020-05-15 | 浙江大学 | A Temporal Knowledge Graph Representation Method Based on Historical Relation and Bi-Graph Convolutional Networks |
-
2020
- 2020-08-10 CN CN202010797094.5A patent/CN111949892B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140362091A1 (en) * | 2013-06-07 | 2014-12-11 | Ecole Polytechnique Federale De Lausanne | Online modeling for real-time facial animation |
US10650432B1 (en) * | 2016-11-28 | 2020-05-12 | Amazon Technologies, Inc. | Recommendation system using improved neural network |
CN110555469A (en) * | 2019-08-15 | 2019-12-10 | 阿里巴巴集团控股有限公司 | Method and device for processing interactive sequence data |
CN111159425A (en) * | 2019-12-30 | 2020-05-15 | 浙江大学 | A Temporal Knowledge Graph Representation Method Based on Historical Relation and Bi-Graph Convolutional Networks |
Non-Patent Citations (1)
Title |
---|
刘辉等: "融合邻居选择策略和信任关系的兴趣点推荐", 《计算机工程与科学》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112541129A (en) * | 2020-12-06 | 2021-03-23 | 支付宝(杭州)信息技术有限公司 | Method and device for processing interaction event |
CN112541129B (en) * | 2020-12-06 | 2023-05-23 | 支付宝(杭州)信息技术有限公司 | Method and device for processing interaction event |
CN113191400A (en) * | 2021-04-14 | 2021-07-30 | 中国海洋大学 | Method and device for retrieving corresponding three-dimensional model based on two-dimensional image |
CN113537613A (en) * | 2021-07-28 | 2021-10-22 | 浙江大学 | A Motif-aware Temporal Network Prediction Method |
CN113537613B (en) * | 2021-07-28 | 2023-11-21 | 浙江大学 | Temporal network prediction method for die body perception |
CN114969540A (en) * | 2022-06-10 | 2022-08-30 | 重庆大学 | Method for predicting future interaction behavior of user in social network |
Also Published As
Publication number | Publication date |
---|---|
CN111949892B (en) | 2022-04-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111949892B (en) | A Multi-Relation Aware Temporal Interaction Network Prediction Method | |
Pálovics et al. | Exploiting temporal influence in online recommendation | |
CN109062962B (en) | Weather information fused gated cyclic neural network interest point recommendation method | |
CN115082147A (en) | Sequence recommendation method and device based on hypergraph neural network | |
WO2021139415A1 (en) | Data processing method and apparatus, computer readable storage medium, and electronic device | |
Shi et al. | Long-term performance of collaborative filtering based recommenders in temporally evolving systems | |
Shakibian et al. | Statistical similarity measures for link prediction in heterogeneous complex networks | |
CN112733027A (en) | Hybrid recommendation algorithm based on local and global representation model joint learning | |
CN108573041A (en) | Probabilistic matrix factorization recommendation method based on weighted trust relationship | |
Luo et al. | BGNN: Behavior-aware graph neural network for heterogeneous session-based recommendation | |
CN113590964A (en) | Deep neural network Top-N recommendation algorithm based on heterogeneous modeling | |
CN116071128A (en) | A multi-task recommendation method based on multi-behavior feature extraction and self-supervised learning | |
Zareie et al. | Centrality measures in fuzzy social networks | |
CN113569139A (en) | A method and system for personalized session recommendation | |
CN106777123B (en) | A Group Recommendation Method Based on Bidirectional Tensor Decomposition Model | |
CN112149734A (en) | A Cross-Domain Recommendation Method Based on Stacked Autoencoders | |
Gao et al. | Multi-objective pointer network for combinatorial optimization | |
CN118568301A (en) | Sequential recommendation method based on global information and hybrid temporal query attention mechanism | |
Chetana et al. | Handling massive sparse data in recommendation systems | |
CN114708064B (en) | Commodity recommendation method based on meta learning and knowledge graph | |
CN109919219A (en) | A Xgboost Multi-View Portrait Construction Method Based on Granular Computing ML-kNN | |
CN115310004A (en) | Graph Neural Collaborative Filtering Recommendation Method Based on Item Time Series Relationship | |
Shams et al. | IteRank: An iterative network-oriented approach to neighbor-based collaborative ranking | |
Yu et al. | Movie Rating Prediction Recommendation Algorithm based on XGBoost-DNN | |
Lu et al. | Trust-enhanced matrix factorization using PageRank for recommender system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |