0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

pytorch-geometric のドキュメント中のChebConvの式の導出

Posted at

pytorch-geometric (以下pyg) のChebConvの式は以下のように書かれています.

\begin{align}
\mathbf{X}^{\prime} &= \sum_{k=1}^{K} \mathbf{Z}^{(k)} \cdot \mathbf{\Theta}^{(k)} \\
        \mathbf{Z}^{(1)} &= \mathbf{X} \\
        \mathbf{Z}^{(2)} &= \mathbf{\hat{L}} \cdot \mathbf{X} \\
        \mathbf{Z}^{(k)} &= 2 \cdot \mathbf{\hat{L}} \cdot \mathbf{Z}^{(k-1)} - \mathbf{Z}^{(k-2)}
\end{align}

これは普段我々が目にする式と同じではありません.普段我々が目にするのは

\boldsymbol{x}^\prime = \sum \theta_k T_k\left(\boldsymbol{\hat{L}}\right) \boldsymbol{x}

の方です.ただし$T_k(\cdot)$はチェビシフ多項式にするための適当な変換です.そこで,pygの式を普段目にする式から導出します.まず元の式は,

\begin{align}
\boldsymbol{x}^\prime &= \sum \theta_k T_k\left(\boldsymbol{\hat{L}}\right) \boldsymbol{x} \\
\boldsymbol{x}^\prime &= \sum T_k\left(\boldsymbol{\hat{L}}\right) \boldsymbol{x} \cdot \theta_k
\end{align}

入力を$(N, C)$の次元に拡張し,出力を$(N,F)$の次元に拡張します.ここで$N,C,F$はそれぞれノード数,入力チャネル数,出力チャネル数です.

\begin{align}
\boldsymbol{X}^\prime &= \sum T_k\left(\boldsymbol{\hat{L}}\right) \boldsymbol{X} \cdot \boldsymbol{\Theta}_k
\end{align}

次元に着目すると,

(N,F) = (N,N) \times (N,C) \times (\boldsymbol{\Theta}_kの行,\boldsymbol{\Theta}_kの列)

となるので,$\boldsymbol{\Theta}_k \in \mathbb{R}^{C\times F}$となります.さらに$T_k\left(\boldsymbol{\hat{L}}\right)\boldsymbol{X}=\mathbf{Z}^{(k)}$と置き換えればpygの数式と一致します.

\mathbf{X}^{\prime} = \sum_{k=1}^{K} \mathbf{Z}^{(k)} \cdot \mathbf{\Theta}^{(k)}

pygでは再帰的な計算をすることで高次の項を計算しているため,実装上の参考になるのはpygの式の方です.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?