第2章準備
2.5.6. Exercises2.5.6 練習問題
- Why is the second derivative much more expensive to compute than the first derivative?
英語のヒント
2階導関数の計算が1階導関数よりずっと費用がかかるのはなぜか。 - After running the function for backpropagation, immediately run it again and see what happens. Investigate.
英語のヒント
誤差逆伝播の関数を実行した後、すぐにもう一度実行して、何が起きるかを見よ。調べてみよ。 - In the control flow example where we calculate the derivative of
dwith respect toa, what would happen if we changed the variableato a random vector or a matrix? At this point, the result of the calculationf(a)is no longer a scalar. What happens to the result? How do we analyze this?英語のヒント
aについてのdの導関数を計算する制御フローの例で、変数aを無作為なベクトルや行列に変えたら何が起きるか。この場合、計算f(a)の結果はもはやスカラーではない。結果はどうなるか。これをどう分析すればよいか。 - Let . Plot the graph of and of its derivative . Do not exploit the fact that but rather use automatic differentiation to get the result.
英語のヒント
とする。とその導関数のグラフを描け。であることは利用せず、自動微分を使って結果を得よ。 - Let . Write out a dependency graph tracing results from to .
英語のヒント
とする。からへと結果をたどる依存グラフを書き出せ。 - Use the chain rule to compute the derivative of the aforementioned function, placing each term on the dependency graph that you constructed previously.
英語のヒント
連鎖律を使って、前述の関数の導関数を計算し、各項を先ほど作った依存グラフの上に置け。 - Given the graph and the intermediate derivative results, you have a number of options when computing the gradient. Evaluate the result once starting from to and once from tracing back to . The path from to is commonly known as forward differentiation, whereas the path from to is known as backward differentiation.
英語のヒント
グラフと中間の導関数の結果が与えられたとき、勾配を計算する方法にはいくつかの選択肢がある。からへ向かって一度、からへさかのぼって一度、結果を評価せよ。からへの経路は一般に前進微分、からへの経路は後退微分として知られる。 - When might you want to use forward, and when backward, differentiation? Hint: consider the amount of intermediate data needed, the ability to parallelize steps, and the size of matrices and vectors involved.
英語のヒント
前進微分を使いたいのはどんなときで、後退微分を使いたいのはどんなときか。ヒント:必要な中間データの量、手順を並列化できるかどうか、関わる行列やベクトルの大きさを考えよ。