2016年12月8日木曜日

chainerをはじめよう

# chainerについて AdventCalendar2016も八日目、kinsanです 前回ちょびっと触れたような触れなかったような chainerについて書いていきます ## chainerの長所 - わりと読みやすい - 日本製なので日本語で情報が落ちてたりする - pythonで触れる - インストールもお手軽 - 更新も頻繁 - 書籍もそこそこ出てる ## インストール インストールはとてもお手軽~ ``` pip install chainer ``` これだけでインストールされます gpuを使うにはめんどくさい準備が必要です 公式を見ながら環境に合わせて気合い入れて行ってください ## サンプルを動かそう 次はさくっとサンプルを動かしてみましょう [GitHub - pfnet/chainer](https://github.com/pfnet/chainer) ここからcloneしてきてください examples以下を見てみると、 - imagenet - mnist - modelzoo - ptb - sentiment - vae - word2vec などのサンプルが入っています 今回は基本となるmnistを動かしてみましょう 多層パーセプトロンを用いて手書き文字の認識をするサンプルになっています examples/mnistに移動して、 ``` python train_mnist.py ``` と打ち込むことで早速学習が始まります windowsやipythonを使っている場合に正常に表示されるかはわかりませんが、 学習の進度や、終了までの予測時間などを表示してくれるようになっています また、epochごとの学習の制度の推移なども確認できます train_mnist.pyを見てみるとわかりますが、 今回の例は色々な引数で内部のパラメータを簡単に変更することができます gpuを使用することができる人は -g 0で学習の速度が数倍速くなります -bでバッチサイズの変更が可能です -eでepochの数が変更可能です -uでユニットの数が変更可能です 深層学習に興味がある人はパラメータを小さくするとどうなるのか、 違うネットワークを使ったらどうなるのかなど試してみると面白いと思います また、自前のデータで学習してみると結構楽しむことができます 画像処理に興味がある人はimagenet、 自然言語処理に興味がある人はptbやword2vecを動かしてみるといいと思います

3 件のコメント:



  1. Welcome to the Official Panda Express/Feedback Survey Program. Visit the official survey website of Panda Express Survey

    返信削除
  2. Because the vast majority of} apps are downloaded via two app shops, and these can restrict content based mostly on location, it is more difficult to avoid restrictions on gambling apps than a PC or laptop. Furthermore, the availability of gambling apps on Android telephones is more restricted than iOS as these apps are banned on the Google Play Store. However, gambling apps can still be installed onto units, and a few major UK operators 카지노사이트 have Android offerings.

    返信削除
  3. I offer support in writing coherent and concise literature review chapters for Pay Someone To Write My Assignment UK.

    返信削除