レトリバセミナー 2017/03/15 Movie: https://www.youtube.com/watch?v=ok_bvPKAEaMRead less
はじめに 先日こちらの記事からChainerがすごく簡潔に書けるようになったと知り、前から試してみたかったCIFAR-10の画像分類に挑戦してみました ...と、書きたかったのですが、貧弱CPU環境しか持っていないので、実行確認までできていません 1日中動かして2epochくらい進んだのでおそらく正しい...はず^^; 実装に関してはこちらのブログを参考にさせていただきました 実装 CIFAR-10の画像を読み込んでくる ここからCIFAR-10のデータをダウンロードして読み込みます。pickleのようなので下記の関数で読み込みます。 def unpickle(file): fp = open(file, 'rb') if sys.version_info.major == 2: data = pickle.load(fp) elif sys.version_info.major == 3
MNIST のサンプルの 大体 の流れを追ってみます。(詳しい処理はこちらで) バージョンは 1.14.0 、2016年9月5日時点のソースです。 全体の流れはこうなっており ① モデルの生成 ② オプティマイザの生成 ③ 学習データのダウンロード ④ trainer、updater の生成 ⑤ Extension の登録 ⑥ 学習ループ ソースはこんな感じです。
【追記】(2017/03/01) chainer公式にDCGANのサンプルが追加されました。こちらでは、エレガントにUpdaterが書かれていますので是非そちらもご覧になってください。 個人的に今年はGANに関する論文がかなり多いと感じています。 GANを扱うとなると必要なモデルは最低2つ、場合によっては3つのこともあります。 さて、chainer=1.11からTrainerなどによる学習ループが抽象化された一方、Trainerでは基本的に1つのモデルを受け取り学習を実行するように実装されているためGANを実装する場合は、 for epoch in six.moves.range(n_epoch): perm = np.random.permutation(N) for i in six.moves.range(0, N, batch_size): x_batch = x_train[i*
皆さんこんにちは お元気ですか。最近、Chainer便利でびっくりしたような頃合いです。 頻繁に更新することで有名なChainerですが、久々にupgradeすると以前よりも シンプルなタスクについて、簡単に学習ができます。 Trainer Chainer version 1.11.0よりTrainerと呼ばれる機能が実装されています。 以前まで学習用バッチ処理を自前で書くようなことが 必要でしたが、これを使うことによってバッチ処理を書く必要がなくなります。 実際の機能としてはある処理をhockしたり、グラフを出力したり レポートを表示したりと学習中に確認したいグラフは沢山あります。 それらのグラフを可視化したいといったことは往々にしてあります。 Trainerの基本的な使い方 Trainerを使うと、Progress Barやlogを自動的に吐き出すことができます。 通常のモードでは、T
はじめに 前回Chainerの新機能、trainerを使ってCIFAR-10の画像分類に挑戦しようとしたのですが、マシンパワーの都合上、動作を確認できずに終わってしまいました。 そこで今回はMNISTを使ったAutoencoderの作成を通してtrainerの使い方を確認していこうと思います。 Autoencoderに関してはこちらの記事を参考にしました。 【ディープラーニング】ChainerでAutoencoderを試して結果を可視化してみる。 ChainerでDeep Autoencoderを作ってみる 実装 MNISTの手書き文字1000個を入力とし、隠れ層を1層通して入力と等しくなるような出力を得るネットワークを作成します。 コード全体はこちらにあげています。 ネットワーク部分 隠れ層のユニット数は64まで絞っています。 また、hidden=Trueで呼び出すと隠れ層を出力できるよ
> X[[0]] out: array([ 5.0999999 , 3.5 , 1.39999998, 0.2 ], dtype=float32) > Y out: array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2
Chainer1.11.0がリリースされ、Trainerという学習ループを抽象化する機能が追加されたようなので、独自のAV女優顔画像データセットを使って学習をしてみます。 顔画像の抽出やデータ拡張については、Qiita - chainerによるディープラーニングでAV女優の類似画像検索サービスをつくったノウハウを公開するを参照してください。 元記事ではnumpy形式に変換していますが、今回は学習時にディレクトリから直接画像を読み込むため、numpy形式に変換しません。 ここで使う顔画像は各女優につき1000枚ずつ画像があり、64×64のサイズにリサイズし、以下構成のディレクトリに分けられているものとします。 ./root | |--- /actress1 | |--- image1.jpg | |--- image2.jpg | |--- image3.jpg | |--- /actres
2016年7月12日に,Chainer v1.11.0がリリースされた. Chainer Meetup 03や,Amazon Picking Challenge 2016の準備もあったろうに…なんて速度だ! (第2位,おめでとうございます https://www.preferred-networks.jp/ja/news/amazon-picking-challenge-2016_result ) この記事では,Chainerの新機能を美味しさと共に紹介していきたいと思う. トレーニング部分のコードが抽象化できるようになった Chainer Meetup 03では,「beam2dさんがゲロ吐きながらTrainコードを抽象化してくれている」という話だった. あれからおよそ2週間,Chainerのコードは変化を遂げた.変化を遂げることを許された. 先日とあるライブコーディングイベントにて私が書
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く