https://github.com/oreilly-japan/deep-learning-from-scratch/blob/master/ch04/two_layer_net.py

↑のひどいコードを↓のように変更しました。

https://github.com/for-2ch/for-2ch-codes/blob/master/my_two_layer_net.py

大きな改善ですね。