Research Article

Session-Based Recommendation with GNN and Time-Aware Memory Network

Algorithm 1

Session-based recommendation model with GNN and time-aware memory networks (SR-GTM).
Input: the input session and time information
Output: Top- recommendations list.
1: 
2: for l in do
3:  Learn the item representation: by Equations (1) and (2)
4: end for
5: Inner feature extraction:
6:  Calculate position information: by Equation (3)
7:  
8:   by Equation (4)
9:  Learn inner session representation: by Equation (5)
10: Outer feature extraction:
11:  Learn dwell time information: by Equations (6) and (7)
12:  
13:  Learn outer session representation: by Equations (8)–(10)
14: Learn session representation: by Equation (11)
15:  by Equation (12)
16:  by Equation (13)
17: Calculate the rating of items: by Equations (14) and (15)
18: Loss function is given by Equation (16)
19: Recommend top- items as the recommendations list