1_kerasを使用するためのimport文
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
1_kerasを使用するためのimport文 [2017/11/04] – [開発環境] adash333 | 1_kerasを使用するためのimport文 [2019/08/04] (現在) – [2. Import文の入力(Copy and Paste)] adash333 | ||
---|---|---|---|
行 67: | 行 67: | ||
{{: | {{: | ||
- | 今回は、C:/ | + | 今回は、C:/ |
Anaconda Prompt上で、以下のコマンドを入力 | Anaconda Prompt上で、以下のコマンドを入力 | ||
< | < | ||
- | cd c:/py/chainer2/MNIST_MLP | + | cd c:/py/keras/MNIST_MLP |
</ | </ | ||
- | chainer2仮想環境を起動 | + | keras2仮想環境を起動 |
< | < | ||
- | activate | + | activate |
</ | </ | ||
Jupyter Notebookの起動 | Jupyter Notebookの起動 | ||
行 82: | 行 82: | ||
</ | </ | ||
- | {{:pasted:20171103-172241.png}} | + | {{:pasted:20171106-041410.png}} |
すると、ブラウザ(Chromeがお勧めです)が自動的に開いて、以下のような画面になるので、画面右側の方の「New」>「python3」の順にクリックして、新規Jupyter Notebookを作成。 | すると、ブラウザ(Chromeがお勧めです)が自動的に開いて、以下のような画面になるので、画面右側の方の「New」>「python3」の順にクリックして、新規Jupyter Notebookを作成。 | ||
行 91: | 行 91: | ||
{{: | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 以下のような状態からスタートします。 | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== 2. Import文の入力(Copy and Paste) ==== | ||
+ | |||
+ | 次のような状態になっていると思われます。 | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 上図の部分に、Kerasプログラミングを開始するために必要な、以下のImport文をコピペします。 | ||
+ | |||
+ | < | ||
+ | import keras | ||
+ | from keras.models import Sequential | ||
+ | from keras.layers import Dense, Dropout | ||
+ | from keras.optimizers import RMSprop | ||
+ | from keras.utils import np_utils | ||
+ | |||
+ | from sklearn.model_selection import train_test_split | ||
+ | |||
+ | import numpy as np | ||
+ | from PIL import Image | ||
+ | import os | ||
+ | </ | ||
+ | |||
+ | さらに、Shift + Enter を押してから、数秒待つと、以下のようになります。 | ||
+ | |||
+ | {{: | ||
+ | |||
+ | これで、Import文の入力は終了です。 | ||
+ | |||
+ | 次に、< | ||
+ | |||
===== 参考文献 ===== | ===== 参考文献 ===== | ||
初めてKerasプログラミングをやるときの超おすすめ本。\\ | 初めてKerasプログラミングをやるときの超おすすめ本。\\ | ||
行 102: | 行 139: | ||
<iframe style=" | <iframe style=" | ||
</ | </ | ||
+ | |||
+ | |||
+ | 機械学習で用いるpythonの”import xxx”まとめ | ||
+ | 2017/10/25 | ||
+ | http:// | ||
+ | |||
===== リンク ===== | ===== リンク ===== |
1_kerasを使用するためのimport文.1509802773.txt.gz · 最終更新: 2018/10/07 (外部編集)