Keras2.0の紹介
- Kerasについて
- Keras2.0について(Keras2.0の概要)
- Keras2.0について(バックエンドについて)
- インストール方法
- TensorFlowへの簡易インタフェースとしてのKeras
Kerasについて
KerasはTensorFlowまたはTheanoをバックエンドとして動作する深層学習ライブラリです。
Pythonで実装されています。
Kerasは、迅速な実験を可能にすることに重点を置いて開発されました。
Keras2.0について(Keras2.0の概要)
2017年3月にKeras2.0がリリースされました。これにあたりアップデート関連で気になることについてまとめています。
1. KerasではAPIの変更がある場合、そのリリースを1つのリリースにまとめているため、ユーザーはコードの更新をまとめることができる
2. Keras 1とKeras 2の間のAPIの変更は可能な限り下位互換性がある。(複雑な場合を除いて、Keras 2でKeras 1のコードを実行可能。)
3. Keras 2はKerasの最初の「長期サポート」API。Keras 2で書かれたコードは、これからも数年間、最新のソフトウェアで動作するはず。
Keras2.0について(バックエンドについて)
- Keras 2 APIはTensorFlowリポジトリの一部となり、TensorFlowの高水準APIとして機能する。
- Theanoのサポートは無限に続く
- 将来的に多くのバックエンドをサポートする予定(MicrosoftはKerasのCNTKバックエンドを構築しています)
インストール方法
$ pip install keras
TensorFlowへの簡易インタフェースとしてのKeras
以下のようにも使える。
import tensorflow as tf
sess = tf.Session()
from keras import backend as K
K.set_session(sess)
# Keras layers can be called on TensorFlow tensors:
x = Dense(128, activation='relu')(img) # fully-connected layer with 128 units and ReLU activation
x = Dense(128, activation='relu')(x)
preds = Dense(10, activation='softmax')(x) # output layer with 10 units and a softmax activation
https://blog.keras.io/keras-as-a-simplified-interface-to-tensorflow-tutorial.html
より抜粋
参考資料
Spring 2017 roadmap: Keras 2, PR freeze, TF integration
Introducing Keras 2
類似資料
以下のアップデート版です。
Keras 2.0の概要
http://qiita.com/taki_tflare/items/49740a9d8f36464947b9