第21章推薦システム
21.7.1. Model Architectures21.7.1 モデルの構造
In sequence-aware recommendation system, each user is associated with a sequence of some items from the item set. Let denotes the ordered sequence. The goal of Caser is to recommend item by considering user general tastes as well as short-term intention. Suppose we take the previous items into consideration, an embedding matrix that represents the former interactions for time step can be constructed:
英語のヒント
系列を考慮した推薦システムでは、各利用者は、アイテムの集合から選ばれたいくつかのアイテムの系列と結びついている。を、順に並べた系列とする。Caserの目標は、利用者の一般的な好みと短期的な意図の両方を考えてアイテムを推薦することである。直前の個のアイテムを考慮に入れるとすると、時間ステップでの以前のやりとりを表す埋め込み行列を作れる。
(21.7.1)
where represents item embeddings and denotes the row. can be used to infer the transient interest of user at time-step . We can view the input matrix as an image which is the input of the subsequent two convolutional components.
英語のヒント
ここではアイテムの埋め込みを表し、はそのの行を表す。は、時間ステップでの利用者の一時的な関心を推測するのに使える。入力行列は、後に続く二つの畳み込みの構成要素の入力となる画像とみなせる。
The horizontal convolutional layer has horizontal filters , and the vertical convolutional layer has vertical filters . After a series of convolutional and pool operations, we get the two outputs:
英語のヒント
水平の畳み込み層は個の水平フィルタをもち、垂直の畳み込み層は個の垂直フィルタをもつ。一連の畳み込みとプーリングの演算の後、二つの出力が得られる。
(21.7.2)
where is the output of horizontal convolutional network and is the output of vertical convolutional network. For simplicity, we omit the details of convolution and pool operations. They are concatenated and fed into a fully connected neural network layer to get more high-level representations.
英語のヒント
ここでは水平の畳み込みネットワークの出力、は垂直の畳み込みネットワークの出力である。簡単にするため、畳み込みとプーリングの演算の詳細は省く。これらは連結され、全結合のニューラルネットワークの層に入力されて、より高レベルの表現が得られる。
(21.7.3)
where is the weight matrix and is the bias. The learned vector is the representation of user’s short-term intent.
英語のヒント
ここでは重み行列、はバイアスである。学習されたベクトルは、利用者の短期的な意図の表現である。
At last, the prediction function combines users’ short-term and general taste together, which is defined as:
英語のヒント
最後に、予測関数は利用者の短期的な好みと一般的な好みを組み合わせる。これは次のように定義される。
(21.7.4)
where is another item embedding matrix. is the item specific bias. is the user embedding matrix for users’ general tastes. is the row of and is the row of .
英語のヒント
ここではもう一つのアイテム埋め込み行列である。はアイテムに固有のバイアスである。は、利用者の一般的な好みのための利用者埋め込み行列である。はのの行であり、はのの行である。
The model can be learned with BPR or Hinge loss. The architecture of Caser is shown below:
英語のヒント
このモデルは、BPRやヒンジ損失で学習できる。Caserの構造を以下に示す。
Fig. 21.7.1図21.7.1
Illustration of the Caser Model
英語のヒント
Caserのモデルの図解
We first import the required libraries.
英語のヒント
まず、必要なライブラリをインポートする。
import random
import mxnet as mx
from mxnet import gluon, np, npx
from mxnet.gluon import nn
from d2l import mxnet as d2l
npx.set_np()