Deep Learning 2 自然言語処理編 第1章を実行してみた。

例題：
https://github.com/oreilly-japan/deep-learning-from-scratch-2


```

$ cd Downloads

$ cd deep-learning-from-scratch-2-master

$ ls
LICENSE.md	ch01	ch03	ch05	ch07	common
README.md	ch02	ch04	ch06	ch08	dataset

$ cd ch01

OgawaKiyoshi-no-MacBook-Pro:ch01 ogawakiyoshi$ ls -al
total 40
drwxr-xr-x@  8 ogawakiyoshi  staff   256  8 23 09:07 .
drwxr-xr-x@ 15 ogawakiyoshi  staff   480  8 23 09:03 ..
-rwxr-xr-x@  1 ogawakiyoshi  staff  1157  7 31 19:14 forward_net.py
-rwxr-xr-x@  1 ogawakiyoshi  staff   471  7 31 19:14 show_spiral_dataset.py
-rwxr-xr-x@  1 ogawakiyoshi  staff   617  7 31 19:14 train.py
-rwxr-xr-x@  1 ogawakiyoshi  staff  2276  7 31 19:14 train_custom_loop.py
-rwxr-xr-x@  1 ogawakiyoshi  staff  1353  7 31 19:14 two_layer_net.py

$ python forward_net.py 
[[-0.71481099 -1.00625488 -0.93497303]
 [ 0.01973645 -0.76415706  0.05342717]
 [-0.27815234 -0.527526   -0.08480045]
 [-0.34995857 -0.9076847  -0.57283108]
 [-0.77221886 -0.81256796 -0.72007658]
 [-0.61498102 -1.30148752 -1.22495622]
 [-0.99750837 -1.11785173 -1.2184949 ]
 [-0.75274298 -1.24928424 -1.25333797]
 [-0.33772971 -0.55274088 -0.15540955]
 [-0.10492393 -0.95263256 -0.3006416 ]]
$ python show_spiral_dataset.py 
x (300, 2)
t (300, 3)
^Z
[3]+  Stopped                 python show_spiral_dataset.py
$ python two_layer_net.py 
$ python train_custom_loop.py 
| epoch 1 |  iter 10 / 10 | loss 1.13
| epoch 2 |  iter 10 / 10 | loss 1.13
| epoch 3 |  iter 10 / 10 | loss 1.12
| epoch 4 |  iter 10 / 10 | loss 1.12
| epoch 5 |  iter 10 / 10 | loss 1.11
| epoch 6 |  iter 10 / 10 | loss 1.14
| epoch 7 |  iter 10 / 10 | loss 1.16
| epoch 8 |  iter 10 / 10 | loss 1.11
| epoch 9 |  iter 10 / 10 | loss 1.12
| epoch 10 |  iter 10 / 10 | loss 1.13
| epoch 11 |  iter 10 / 10 | loss 1.12
| epoch 12 |  iter 10 / 10 | loss 1.11
| epoch 13 |  iter 10 / 10 | loss 1.09
| epoch 14 |  iter 10 / 10 | loss 1.08
| epoch 15 |  iter 10 / 10 | loss 1.04
| epoch 16 |  iter 10 / 10 | loss 1.03
| epoch 17 |  iter 10 / 10 | loss 0.96
| epoch 18 |  iter 10 / 10 | loss 0.92
| epoch 19 |  iter 10 / 10 | loss 0.92
| epoch 20 |  iter 10 / 10 | loss 0.87
| epoch 21 |  iter 10 / 10 | loss 0.85
| epoch 22 |  iter 10 / 10 | loss 0.82
| epoch 23 |  iter 10 / 10 | loss 0.79
| epoch 24 |  iter 10 / 10 | loss 0.78
| epoch 25 |  iter 10 / 10 | loss 0.82
| epoch 26 |  iter 10 / 10 | loss 0.78
| epoch 27 |  iter 10 / 10 | loss 0.76
| epoch 28 |  iter 10 / 10 | loss 0.76
| epoch 29 |  iter 10 / 10 | loss 0.78
| epoch 30 |  iter 10 / 10 | loss 0.75
| epoch 31 |  iter 10 / 10 | loss 0.78
| epoch 32 |  iter 10 / 10 | loss 0.77
| epoch 33 |  iter 10 / 10 | loss 0.77
| epoch 34 |  iter 10 / 10 | loss 0.78
| epoch 35 |  iter 10 / 10 | loss 0.75
| epoch 36 |  iter 10 / 10 | loss 0.74
| epoch 37 |  iter 10 / 10 | loss 0.76
| epoch 38 |  iter 10 / 10 | loss 0.76
| epoch 39 |  iter 10 / 10 | loss 0.73
| epoch 40 |  iter 10 / 10 | loss 0.75
| epoch 41 |  iter 10 / 10 | loss 0.76
| epoch 42 |  iter 10 / 10 | loss 0.76
| epoch 43 |  iter 10 / 10 | loss 0.76
| epoch 44 |  iter 10 / 10 | loss 0.74
| epoch 45 |  iter 10 / 10 | loss 0.75
| epoch 46 |  iter 10 / 10 | loss 0.73
| epoch 47 |  iter 10 / 10 | loss 0.72
| epoch 48 |  iter 10 / 10 | loss 0.73
| epoch 49 |  iter 10 / 10 | loss 0.72
| epoch 50 |  iter 10 / 10 | loss 0.72
| epoch 51 |  iter 10 / 10 | loss 0.72
| epoch 52 |  iter 10 / 10 | loss 0.72
| epoch 53 |  iter 10 / 10 | loss 0.74
| epoch 54 |  iter 10 / 10 | loss 0.74
| epoch 55 |  iter 10 / 10 | loss 0.72
| epoch 56 |  iter 10 / 10 | loss 0.72
| epoch 57 |  iter 10 / 10 | loss 0.71
| epoch 58 |  iter 10 / 10 | loss 0.70
| epoch 59 |  iter 10 / 10 | loss 0.72
| epoch 60 |  iter 10 / 10 | loss 0.70
| epoch 61 |  iter 10 / 10 | loss 0.71
| epoch 62 |  iter 10 / 10 | loss 0.72
| epoch 63 |  iter 10 / 10 | loss 0.70
| epoch 64 |  iter 10 / 10 | loss 0.71
| epoch 65 |  iter 10 / 10 | loss 0.73
| epoch 66 |  iter 10 / 10 | loss 0.70
| epoch 67 |  iter 10 / 10 | loss 0.71
| epoch 68 |  iter 10 / 10 | loss 0.69
| epoch 69 |  iter 10 / 10 | loss 0.70
| epoch 70 |  iter 10 / 10 | loss 0.71
| epoch 71 |  iter 10 / 10 | loss 0.68
| epoch 72 |  iter 10 / 10 | loss 0.69
| epoch 73 |  iter 10 / 10 | loss 0.67
| epoch 74 |  iter 10 / 10 | loss 0.68
| epoch 75 |  iter 10 / 10 | loss 0.67
| epoch 76 |  iter 10 / 10 | loss 0.66
| epoch 77 |  iter 10 / 10 | loss 0.69
| epoch 78 |  iter 10 / 10 | loss 0.64
| epoch 79 |  iter 10 / 10 | loss 0.68
| epoch 80 |  iter 10 / 10 | loss 0.64
| epoch 81 |  iter 10 / 10 | loss 0.64
| epoch 82 |  iter 10 / 10 | loss 0.66
| epoch 83 |  iter 10 / 10 | loss 0.62

(中略)
| epoch 299 |  iter 10 / 10 | loss 0.11
| epoch 300 |  iter 10 / 10 | loss 0.11
^Z
[1]+  Stopped                 python train_custom_loop.py
$ python train.py
| epoch 1 |  iter 1 / 10 | time 0[s] | loss 1.10
| epoch 2 |  iter 1 / 10 | time 0[s] | loss 1.12
| epoch 3 |  iter 1 / 10 | time 0[s] | loss 1.13
| epoch 4 |  iter 1 / 10 | time 0[s] | loss 1.12
| epoch 5 |  iter 1 / 10 | time 0[s] | loss 1.12
| epoch 6 |  iter 1 / 10 | time 0[s] | loss 1.10
| epoch 7 |  iter 1 / 10 | time 0[s] | loss 1.14
| epoch 8 |  iter 1 / 10 | time 0[s] | loss 1.16
| epoch 9 |  iter 1 / 10 | time 0[s] | loss 1.11
| epoch 10 |  iter 1 / 10 | time 0[s] | loss 1.12
| epoch 11 |  iter 1 / 10 | time 0[s] | loss 1.12
| epoch 12 |  iter 1 / 10 | time 0[s] | loss 1.12
| epoch 13 |  iter 1 / 10 | time 0[s] | loss 1.10
| epoch 14 |  iter 1 / 10 | time 0[s] | loss 1.09
| epoch 15 |  iter 1 / 10 | time 0[s] | loss 1.08
| epoch 16 |  iter 1 / 10 | time 0[s] | loss 1.04
| epoch 17 |  iter 1 / 10 | time 0[s] | loss 1.03
| epoch 18 |  iter 1 / 10 | time 0[s] | loss 0.94
| epoch 19 |  iter 1 / 10 | time 0[s] | loss 0.92
| epoch 20 |  iter 1 / 10 | time 0[s] | loss 0.92
| epoch 21 |  iter 1 / 10 | time 0[s] | loss 0.87
| epoch 22 |  iter 1 / 10 | time 0[s] | loss 0.85
| epoch 23 |  iter 1 / 10 | time 0[s] | loss 0.80
| epoch 24 |  iter 1 / 10 | time 0[s] | loss 0.79
| epoch 25 |  iter 1 / 10 | time 0[s] | loss 0.78
| epoch 26 |  iter 1 / 10 | time 0[s] | loss 0.83
| epoch 27 |  iter 1 / 10 | time 0[s] | loss 0.77
| epoch 28 |  iter 1 / 10 | time 0[s] | loss 0.76
| epoch 29 |  iter 1 / 10 | time 0[s] | loss 0.77
| epoch 30 |  iter 1 / 10 | time 0[s] | loss 0.76
| epoch 31 |  iter 1 / 10 | time 0[s] | loss 0.77
| epoch 32 |  iter 1 / 10 | time 0[s] | loss 0.75
| epoch 33 |  iter 1 / 10 | time 0[s] | loss 0.78
| epoch 34 |  iter 1 / 10 | time 0[s] | loss 0.77
| epoch 35 |  iter 1 / 10 | time 0[s] | loss 0.78
| epoch 36 |  iter 1 / 10 | time 0[s] | loss 0.74
| epoch 37 |  iter 1 / 10 | time 0[s] | loss 0.75
| epoch 38 |  iter 1 / 10 | time 0[s] | loss 0.77
| epoch 39 |  iter 1 / 10 | time 0[s] | loss 0.75
| epoch 40 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 41 |  iter 1 / 10 | time 0[s] | loss 0.75
| epoch 42 |  iter 1 / 10 | time 0[s] | loss 0.76
| epoch 43 |  iter 1 / 10 | time 0[s] | loss 0.79
| epoch 44 |  iter 1 / 10 | time 0[s] | loss 0.74
| epoch 45 |  iter 1 / 10 | time 0[s] | loss 0.75
| epoch 46 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 47 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 48 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 49 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 50 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 51 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 52 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 53 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 54 |  iter 1 / 10 | time 0[s] | loss 0.74
| epoch 55 |  iter 1 / 10 | time 0[s] | loss 0.74
| epoch 56 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 57 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 58 |  iter 1 / 10 | time 0[s] | loss 0.69
| epoch 59 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 60 |  iter 1 / 10 | time 0[s] | loss 0.70
| epoch 61 |  iter 1 / 10 | time 0[s] | loss 0.69
| epoch 62 |  iter 1 / 10 | time 0[s] | loss 0.71
| epoch 63 |  iter 1 / 10 | time 0[s] | loss 0.70
| epoch 64 |  iter 1 / 10 | time 0[s] | loss 0.71
| epoch 65 |  iter 1 / 10 | time 0[s] | loss 0.72
| epoch 66 |  iter 1 / 10 | time 0[s] | loss 0.71
| epoch 67 |  iter 1 / 10 | time 0[s] | loss 0.71
| epoch 68 |  iter 1 / 10 | time 0[s] | loss 0.71
| epoch 69 |  iter 1 / 10 | time 0[s] | loss 0.70
| epoch 70 |  iter 1 / 10 | time 0[s] | loss 0.68
| epoch 71 |  iter 1 / 10 | time 0[s] | loss 0.73
| epoch 72 |  iter 1 / 10 | time 0[s] | loss 0.66
| epoch 73 |  iter 1 / 10 | time 0[s] | loss 0.69
| epoch 74 |  iter 1 / 10 | time 0[s] | loss 0.66
| epoch 75 |  iter 1 / 10 | time 0[s] | loss 0.70
| epoch 76 |  iter 1 / 10 | time 0[s] | loss 0.65
| epoch 77 |  iter 1 / 10 | time 0[s] | loss 0.67
| epoch 78 |  iter 1 / 10 | time 0[s] | loss 0.70
| epoch 79 |  iter 1 / 10 | time 0[s] | loss 0.63
| epoch 80 |  iter 1 / 10 | time 0[s] | loss 0.66
| epoch 81 |  iter 1 / 10 | time 0[s] | loss 0.65
| epoch 82 |  iter 1 / 10 | time 0[s] | loss 0.66
| epoch 83 |  iter 1 / 10 | time 0[s] | loss 0.64
| epoch 84 |  iter 1 / 10 | time 0[s] | loss 0.62
| epoch 85 |  iter 1 / 10 | time 0[s] | loss 0.62
| epoch 86 |  iter 1 / 10 | time 0[s] | loss 0.63
| epoch 87 |  iter 1 / 10 | time 0[s] | loss 0.59
| epoch 88 |  iter 1 / 10 | time 0[s] | loss 0.58
| epoch 89 |  iter 1 / 10 | time 0[s] | loss 0.61
| epoch 90 |  iter 1 / 10 | time 0[s] | loss 0.59
| epoch 91 |  iter 1 / 10 | time 0[s] | loss 0.58
| epoch 92 |  iter 1 / 10 | time 0[s] | loss 0.57
| epoch 93 |  iter 1 / 10 | time 0[s] | loss 0.55
| epoch 94 |  iter 1 / 10 | time 0[s] | loss 0.54
| epoch 95 |  iter 1 / 10 | time 0[s] | loss 0.53
| epoch 96 |  iter 1 / 10 | time 0[s] | loss 0.54
| epoch 97 |  iter 1 / 10 | time 0[s] | loss 0.51
| epoch 98 |  iter 1 / 10 | time 0[s] | loss 0.51
| epoch 99 |  iter 1 / 10 | time 0[s] | loss 0.50
（中略）
| epoch 252 |  iter 1 / 10 | time 0[s] | loss 0.13
| epoch 253 |  iter 1 / 10 | time 0[s] | loss 0.12
| epoch 254 |  iter 1 / 10 | time 0[s] | loss 0.12
(後略)
^Z
[2]+  Stopped                 python train.py
```

#振り返り
##１　わかったこと、
ゼロからはじめるDeep Learning を演習しておくとよい。
##２　わからなかったこと
図１−３３の多色の図をどう出すか。
two_layer_net.pyがなにか出力するようにする。
##３　よかったこと
pythonがうごいた。
##４　あらためたいこと
事前に資料をWeb上に整理しておくこと。