第21章推薦システム
21.6.1. The NeuMF model21.6.1 NeuMFのモデル
As aforementioned, NeuMF fuses two subnetworks. The GMF is a generic neural network version of matrix factorization where the input is the elementwise product of user and item latent factors. It consists of two neural layers:
英語のヒント
前に述べたように、NeuMFは二つの部分ネットワークを融合する。GMFは行列分解の汎用のニューラルネットワーク版で、入力は利用者とアイテムの潜在因子の要素ごとの積である。これは二つのニューラルな層からなる。
(21.6.1)
where denotes the Hadamard product of vectors. and correspond to user and item latent matrix respectively. is the row of and is the row of . and denote the activation function and weight of the output layer. is the prediction score of the user might give to the item .
英語のヒント
ここではベクトルのアダマール積を表す。とは、それぞれ利用者とアイテムの潜在行列に対応する。はのの行であり、はのの行である。とは、出力層の活性化関数と重みを表す。は、利用者がアイテムにつけるであろう予測点数である。
Another component of this model is MLP. To enrich model flexibility, the MLP subnetwork does not share user and item embeddings with GMF. It uses the concatenation of user and item embeddings as input. With the complicated connections and nonlinear transformations, it is capable of estimating the intricate interactions between users and items. More precisely, the MLP subnetwork is defined as:
英語のヒント
このモデルのもう一つの構成要素はMLPである。モデルの柔軟性を豊かにするため、MLPの部分ネットワークはGMFと利用者とアイテムの埋め込みを共有しない。MLPは、利用者とアイテムの埋め込みの連結を入力として使う。複雑な結合と非線形の変換によって、利用者とアイテムの間の入り組んだやりとりを推定できる。より正確には、MLPの部分ネットワークは次のように定義される。
(21.6.2)
where and denote the weight matrix, bias vector, and activation function. denotes the function of the corresponding layer. denotes the output of corresponding layer.
英語のヒント
ここでとは、重み行列、バイアスベクトル、活性化関数を表す。は対応する層の関数を表す。は対応する層の出力を表す。
To fuse the results of GMF and MLP, instead of simple addition, NeuMF concatenates the second last layers of two subnetworks to create a feature vector which can be passed to the further layers. Afterwards, the outputs are projected with matrix and a sigmoid activation function. The prediction layer is formulated as:
英語のヒント
GMFとMLPの結果を融合するため、NeuMFは単純な足し算ではなく、二つの部分ネットワークの最後から二番目の層を連結して、さらに先の層に渡せる特徴ベクトルを作る。その後、出力は行列とシグモイド活性化関数で射影される。予測層は次のように定式化される。
(21.6.3)
The following figure illustrates the model architecture of NeuMF.
英語のヒント
次の図は、NeuMFのモデルの構造を図解している。
Fig. 21.6.1図21.6.1
Illustration of the NeuMF model
英語のヒント
NeuMFのモデルの図解
import random
import mxnet as mx
from mxnet import autograd, gluon, np, npx
from mxnet.gluon import nn
from d2l import mxnet as d2l
npx.set_np()