プリンキピア

第7章畳み込みニューラルネットワーク

7.4.5. Exercises7.4.5 練習問題

  1. Assume that we have two convolution kernels of size k1 and k2, respectively (with no nonlinearity in between).
    英語のヒント
    それぞれ大きさがk1とk2の二つの畳み込みカーネルがあるとする(あいだに非線形性はない)。
    1. Prove that the result of the operation can be expressed by a single convolution.
      英語のヒント
      その演算の結果は、一つの畳み込みで表せることを証明せよ。
    2. What is the dimensionality of the equivalent single convolution?
      英語のヒント
      同等な一つの畳み込みの次元はいくつか。
    3. Is the converse true, i.e., can you always decompose a convolution into two smaller ones?
      英語のヒント
      逆は成り立つか。つまり、畳み込みをいつでも二つのもっと小さな畳み込みに分解できるか。
  2. Assume an input of shape ci×h×w and a convolution kernel of shape co×ci×kh×kw, padding of (ph,pw), and stride of (sh,sw).
    英語のヒント
    形状ci×h×wの入力と、形状co×ci×kh×kwの畳み込みカーネル、パディング(ph,pw)、ストライド(sh,sw)があるとする。
    1. What is the computational cost (multiplications and additions) for the forward propagation?
      英語のヒント
      順伝播の計算の費用(掛け算と足し算)はどれだけか。
    2. What is the memory footprint?
      英語のヒント
      使用メモリ量はどれだけか。
    3. What is the memory footprint for the backward computation?
      英語のヒント
      逆向きの計算の使用メモリ量はどれだけか。
    4. What is the computational cost for the backpropagation?
      英語のヒント
      逆伝播の計算の費用はどれだけか。
  3. By what factor does the number of calculations increase if we double both the number of input channels ci and the number of output channels co? What happens if we double the padding?
    英語のヒント
    入力チャネルの数ciと出力チャネルの数coの両方を2倍にすると、計算の回数は何倍になるか。パディングを2倍にすると何が起きるか。
  4. Are the variables Y1 and Y2 in the final example of this section exactly the same? Why?
    英語のヒント
    この節の最後の例の変数Y1とY2は、まったく同じか。それはなぜか。
  5. Express convolutions as a matrix multiplication, even when the convolution window is not 1×1.
    英語のヒント
    畳み込みの窓が1×1でないときでも、畳み込みを行列の掛け算として表せ。
  6. Your task is to implement fast convolutions with a k×k kernel. One of the algorithm candidates is to scan horizontally across the source, reading a k-wide strip and computing the 1-wide output strip one value at a time. The alternative is to read a k+Δ wide strip and compute a Δ-wide output strip. Why is the latter preferable? Is there a limit to how large you should choose Δ?
    英語のヒント
    課題は、k×kのカーネルで速い畳み込みを実装することである。アルゴリズムの候補の一つは、元のデータを横に走査し、幅kの帯を読んで、幅1の出力の帯を一度に一つの値ずつ計算することである。もう一つの方法は、幅k+Δの帯を読んで、幅Δの出力の帯を計算することである。なぜ後者のほうが望ましいのか。Δをどれだけ大きく選ぶべきかに限界はあるか。
  7. Assume that we have a c×c matrix.
    英語のヒント
    c×cの行列があるとする。
    1. How much faster is it to multiply with a block-diagonal matrix if the matrix is broken up into b blocks?
      英語のヒント
      行列をb個のブロックに分けると、ブロック対角行列との掛け算はどれだけ速くなるか。
    2. What is the downside of having b blocks? How could you fix it, at least partly?
      英語のヒント
      b個のブロックをもつことの欠点は何か。少なくとも部分的にでも、それをどう直せるか。