プリンキピア

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

3.3.5. Exercises3.3.5 練習問題

  1. What will happen if the number of examples cannot be divided by the batch size. How would you change this behavior by specifying a different argument by using the framework’s API?
    英語のヒント
    事例の数がバッチの大きさで割り切れないと何が起きるか。フレームワークのAPIを使って別の引数を指定することで、この振る舞いをどう変えられるか。
  2. Suppose that we want to generate a huge dataset, where both the size of the parameter vector w and the number of examples num_examples are large.
    英語のヒント
    パラメータベクトルwの大きさも事例の数num_examplesも大きい、巨大なデータセットを生成したいとする。
    1. What happens if we cannot hold all data in memory?
      英語のヒント
      すべてのデータをメモリに保持できないと何が起きるか。
    2. How would you shuffle the data if it is held on disk? Your task is to design an efficient algorithm that does not require too many random reads or writes. Hint: pseudorandom permutation generators allow you to design a reshuffle without the need to store the permutation table explicitly (Naor and Reingold, 1999).
      英語のヒント
      データがディスク上にあるとき、どうやってシャッフルするか。あなたの課題は、無作為な読み書きをあまり必要としない効率的なアルゴリズムを設計することである。ヒント:疑似乱数置換の生成器を使うと、置換の表を明示的に保存せずに再シャッフルを設計できる(Naor and Reingold, 1999)。
  3. Implement a data generator that produces new data on the fly, every time the iterator is called.
    英語のヒント
    イテレータが呼ばれるたびに、その場で新しいデータを作るデータ生成器を実装せよ。
  4. How would you design a random data generator that generates the same data each time it is called?
    英語のヒント
    呼ばれるたびに同じデータを生成する、無作為なデータ生成器をどう設計するか。