この文書の現在のバージョンと選択したバージョンの差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| 
                    windowsでkeras可視化 [2017/07/29] adash333 [参考]  | 
                
                    windowsでkeras可視化 [2018/10/07] (現在) | 
            ||
|---|---|---|---|
| ライン 1: | ライン 1: | ||
| ===== (5)WindowsでKerasモデル可視化 ===== | ===== (5)WindowsでKerasモデル可視化 ===== | ||
| + | <html> | ||
| + | <iframe width="560" height="315" src="https://www.youtube.com/embed/83p_7_2Dw6s" frameborder="0" allowfullscreen></iframe> | ||
| + | </html> | ||
| 初めてのTensorflow ~Kerasで機械学習プログラミング~\\ | 初めてのTensorflow ~Kerasで機械学習プログラミング~\\ | ||
| (5)WindowsでKerasモデル可視化\\ | (5)WindowsでKerasモデル可視化\\ | ||
| ライン 54: | ライン 57: | ||
| ==== 6.モデル可視化ソースコードのコピペと実行 ==== | ==== 6.モデル可視化ソースコードのコピペと実行 ==== | ||
| + | <html> | ||
| + | <iframe width="560" height="315" src="https://www.youtube.com/embed/uWok532FhPo" frameborder="0" allowfullscreen></iframe> | ||
| + | </html> | ||
| + | |||
| + | |||
| 以下のコードをコピペしてから、Shift + Enterで実行。 | 以下のコードをコピペしてから、Shift + Enterで実行。 | ||
| https://gist.github.com/adash333/40925326a010216ac32e58e1b3cd2f86 | https://gist.github.com/adash333/40925326a010216ac32e58e1b3cd2f86 | ||
| - | 大事な部分は、以下の3行。 | + | 今回大事な部分は、最後の数行。 | 
| <code> | <code> | ||
| + | # モデルの可視化 | ||
| + | |||
| from IPython.display import SVG | from IPython.display import SVG | ||
| - | from keras.utils.vis_util import model_to_dot | + | from keras.utils.vis_utils import model_to_dot | 
| SVG(model_to_dot(model).create(prog='dot', format='svg')) | SVG(model_to_dot(model).create(prog='dot', format='svg')) | ||
| + | |||
| + | # モデルの画像をpng形式で保存したいとき | ||
| + | # from keras.utils import plot_model | ||
| + | # plot_model(model, to_file='model.png') | ||
| </code> | </code> | ||
| - | |||
| - | ==== 参考 ==== | ||
| - | https://keras.io/ja/visualization/ | + | # モデルの画像をpng形式で保存したいとき | 
| + | のコードを実行すると、.ipynbと同じフォルダに、Kerasのモデル図がmodel.pngという名前で保存される。 | ||
| - | http://qiita.com/agumon/items/4d7826c2c39d0af868bd | + | {{:pasted:20170730-202635.png}} | 
| + | {{:pasted:20170730-202802.png}} | ||
| + | ==== 参考 ==== | ||
| + | Keras Documentation\\ | ||
| + | Visualization\\ | ||
| + | https://keras.io/visualization/\\ | ||
| + | →KerasのDocumentationは日本語もありますが、なんか古いことがあるので、日本語のDocumentationを読んでうまくいかないときは、アドレスから、「\ja」を消して、英語のDocumentationを読むことをお勧めします。Versionによってコマンドがころころ変わるので、最初から英語のDocumentationを読む方が結局早いかもしれません。 | ||
| + | |||
| + | [Keras/TensorFlow] Keras(Tensorflow)の環境構築 | ||
| + | agumon | ||
| + | 2017年05月03日に更新\\ | ||
| + | http://qiita.com/agumon/items/4d7826c2c39d0af868bd | ||
| + | Windows8.1でAnaconda3+Keras2.0でモデル可視化の際の注意点(2017年7月版) | ||
| + | 2017/7/23 2017/7/29\\ | ||
| http://twosquirrel.mints.ne.jp/?p=19173 | http://twosquirrel.mints.ne.jp/?p=19173 | ||