プリンキピア

第3章回帰のための線形ニューラルネットワーク

3.1.6. Exercises3.1.6 練習問題

  1. Assume that we have some data x1,…,xn∈ℝ. Our goal is to find a constant b such that ∑i(xi−b)2 is minimized.
    英語のヒント
    データx1,…,xn∈ℝがあるとする。目標は、∑i(xi−b)2が最小になるような定数bを見つけることである。
    1. Find an analytic solution for the optimal value of b.
      英語のヒント
      bの最適値の解析解を求めよ。
    2. How does this problem and its solution relate to the normal distribution?
      英語のヒント
      この問題とその解は正規分布とどう関係するか。
    3. What if we change the loss from ∑i(xi−b)2 to ∑i|xi−b|? Can you find the optimal solution for b?
      英語のヒント
      損失を∑i(xi−b)2から∑i|xi−b|に変えたらどうなるか。bの最適解を見つけられるか。
  2. Prove that the affine functions that can be expressed by 𝐱⊤𝐰+b are equivalent to linear functions on (𝐱,1).
    英語のヒント
    𝐱⊤𝐰+bで表せるアフィン関数が、(𝐱,1)上の線形関数と同等であることを証明せよ。
  3. Assume that you want to find quadratic functions of 𝐱, i.e., f(𝐱)=b+∑iwixi+∑j≤iwijxixj. How would you formulate this in a deep network?
    英語のヒント
    𝐱の2次関数、つまりf(𝐱)=b+∑iwixi+∑j≤iwijxixjを見つけたいとする。これを深いネットワークでどう定式化するか。
  4. Recall that one of the conditions for the linear regression problem to be solvable was that the design matrix 𝐗⊤𝐗 has full rank.
    英語のヒント
    線形回帰問題が解けるための条件の一つが、計画行列𝐗⊤𝐗が最大階数をもつことだったのを思い出そう。
    1. What happens if this is not the case?
      英語のヒント
      そうでない場合はどうなるか。
    2. How could you fix it? What happens if you add a small amount of coordinate-wise independent Gaussian noise to all entries of 𝐗?
      英語のヒント
      それをどう直せるか。𝐗のすべての成分に、座標ごとに独立な小さなガウスノイズを加えたらどうなるか。
    3. What is the expected value of the design matrix 𝐗⊤𝐗 in this case?
      英語のヒント
      この場合、計画行列𝐗⊤𝐗の期待値は何か。
    4. What happens with stochastic gradient descent when 𝐗⊤𝐗 does not have full rank?
      英語のヒント
      𝐗⊤𝐗が最大階数をもたないとき、確率的勾配降下法では何が起きるか。
  5. Assume that the noise model governing the additive noise ϵ is the exponential distribution. That is, p(ϵ)=12exp⁡(−|ϵ|).
    英語のヒント
    加法的なノイズϵを支配するノイズのモデルが指数分布だとする。つまりp(ϵ)=12exp⁡(−|ϵ|)である。
    1. Write out the negative log-likelihood of the data under the model −log⁡P(𝐲∣𝐗).
      英語のヒント
      モデル−log⁡P(𝐲∣𝐗)のもとで、データの負の対数尤度を書き出せ。
    2. Can you find a closed form solution?
      英語のヒント
      閉じた形の解を見つけられるか。
    3. Suggest a minibatch stochastic gradient descent algorithm to solve this problem. What could possibly go wrong (hint: what happens near the stationary point as we keep on updating the parameters)? Can you fix this?
      英語のヒント
      この問題を解くミニバッチ確率的勾配降下法のアルゴリズムを提案せよ。何がまずくなりうるか(ヒント:パラメータを更新し続けると、停留点の近くで何が起きるか)。それを直せるか。
  6. Assume that we want to design a neural network with two layers by composing two linear layers. That is, the output of the first layer becomes the input of the second layer. Why would such a naive composition not work?
    英語のヒント
    二つの線形層を合成して、2層のニューラルネットワークを設計したいとする。つまり、1層目の出力が2層目の入力になる。このような素朴な合成がうまくいかないのはなぜか。
  7. What happens if you want to use regression for realistic price estimation of houses or stock prices?
    英語のヒント
    住宅の価格や株価の現実的な推定に回帰を使いたいとしたら、どうなるか。
    1. Show that the additive Gaussian noise assumption is not appropriate. Hint: can we have negative prices? What about fluctuations?
      英語のヒント
      加法的なガウスノイズの仮定が適切でないことを示せ。ヒント:価格が負になりうるか。変動についてはどうか。
    2. Why would regression to the logarithm of the price be much better, i.e., y=log⁡price?
      英語のヒント
      価格の対数への回帰、つまりy=log⁡priceのほうがずっとよいのはなぜか。
    3. What do you need to worry about when dealing with pennystock, i.e., stock with very low prices? Hint: can you trade at all possible prices? Why is this a bigger problem for cheap stock? For more information review the celebrated Black–Scholes model for option pricing (Black and Scholes, 1973).
      英語のヒント
      ペニーストック、つまり非常に価格の低い株を扱うときは、何を心配する必要があるか。ヒント:あらゆる価格で取引できるか。なぜこれは安い株でいっそう大きな問題になるのか。詳しくは、オプションの価格付けについての有名なブラック–ショールズモデルを調べよ(Black and Scholes, 1973)。
  8. Suppose we want to use regression to estimate the number of apples sold in a grocery store.
    英語のヒント
    食料品店で売れたリンゴの数を、回帰を使って推定したいとする。
    1. What are the problems with a Gaussian additive noise model? Hint: you are selling apples, not oil.
      英語のヒント
      ガウスの加法的ノイズのモデルにはどんな問題があるか。ヒント:売っているのはリンゴであって、油ではない。
    2. The Poisson distribution captures distributions over counts. It is given by p(k∣λ)=λke−λ/k!. Here λ is the rate function and k is the number of events you see. Prove that λ is the expected value of counts k.
      英語のヒント
      ポアソン分布は、回数の上の分布をとらえる。それはp(k∣λ)=λke−λ/k!で与えられる。ここでλは率関数で、kは見た事象の回数である。λが回数kの期待値であることを証明せよ。
    3. Design a loss function associated with the Poisson distribution.
      英語のヒント
      ポアソン分布に対応する損失関数を設計せよ。
    4. Design a loss function for estimating log⁡λ instead.
      英語のヒント
      代わりにlog⁡λを推定するための損失関数を設計せよ。