cifar10の分類は、以前にもPytorchでプログラムするよりfast.aiを使ったらいかに簡単かを比較するために行っています。
その時はバカチョンで行いましたが、今回は少しパラメータを調整しています。
精度は上がるでしょうか?。
また細かいことですが、前回はcifar10のダウンロードデータを画像ファイルに変換したものをデータとして使用しました。
今回はcifar10のダウンロードデータをそのまま使いました。
いつもの通りおまじないですか。
usr'◇◇◇◇'のルートディレクトリ下の.fastaiにデータファイルが保存されるようです。
お決まりでサンプルデータを見てみます。
クラス名とクラス数を確認します。
['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
10
modelの作成
Learning rate finder
epoch | train_loss | valid_loss | accuracy | time |
---|---|---|---|---|
0 | 0.744703 | 0.354537 | 0.885400 | 03:53 |
1 | 0.469512 | 0.201625 | 0.930600 | 03:46 |
2 | 0.270212 | 0.166902 | 0.944000 | 03:55 |
3 | 0.222146 | 0.147838 | 0.950600 | 03:55 |
4 | 0.159085 | 0.142335 | 0.953500 | 03:56 |
5 | 0.100209 | 0.138606 | 0.957700 | 03:57 |
6 | 0.084313 | 0.137753 | 0.957900 | 03:55 |
7 | 0.074560 | 0.139501 | 0.958700 | 03:58 |
8 | 0.045900 | 0.131465 | 0.963800 | 03:56 |
9 | 0.041630 | 0.134978 | 0.961700 | 03:57 |
10 | 0.036739 | 0.133509 | 0.963900 | 03:58 |
11 | 0.042298 | 0.128095 | 0.966300 | 03:58 |
12 | 0.018616 | 0.128820 | 0.967100 | 03:57 |
13 | 0.012673 | 0.129448 | 0.965900 | 03:54 |
14 | 0.018020 | 0.132760 | 0.967200 | 03:54 |
15 | 0.011624 | 0.125211 | 0.969000 | 03:40 |
16 | 0.004508 | 0.120462 | 0.970000 | 03:54 |
17 | 0.009019 | 0.118949 | 0.970300 | 03:58 |
18 | 0.006994 | 0.119183 | 0.970700 | 03:54 |
19 | 0.008199 | 0.116295 | 0.971000 | 03:55 |
Load pre-trained weights
training結果の分析
Confusion matrix
array([[973, 2, 6, 2, ..., 1, 0, 14, 0], [ 0, 989, 0, 0, ..., 0, 0, 1, 10], [ 7, 1, 962, 8, ..., 6, 0, 2, 0], [ 0, 1, 6, 928, ..., 8, 4, 3, 0], ..., [ 1, 0, 3, 6, ..., 983, 0, 0, 1], [ 0, 0, 1, 4, ..., 1, 975, 0, 0], [ 5, 0, 1, 0, ..., 0, 0, 991, 3], [ 3, 21, 0, 1, ..., 0, 0, 6, 968]])
[('cat', 'dog', 44), ('dog', 'cat', 37), ('truck', 'automobile', 21), ('airplane', 'ship', 14), ('horse', 'deer', 13), ('deer', 'cat', 11), ('automobile', 'truck', 10), ('dog', 'deer', 10), ('bird', 'deer', 9), ('bird', 'cat', 8), ('cat', 'frog', 8), ('bird', 'airplane', 7), ('airplane', 'bird', 6), ('bird', 'frog', 6), ('cat', 'bird', 6), ('cat', 'deer', 6), ('frog', 'cat', 6), ('horse', 'dog', 6), ('truck', 'ship', 6), ('bird', 'dog', 5), ('dog', 'bird', 5), ('frog', 'deer', 5), ('ship', 'airplane', 5), ('cat', 'horse', 4), ('deer', 'dog', 4), ('horse', 'cat', 4), ('cat', 'ship', 3), ('deer', 'horse', 3), ('dog', 'horse', 3), ('frog', 'bird', 3), ('ship', 'truck', 3), ('truck', 'airplane', 3), ('airplane', 'automobile', 2), ('airplane', 'cat', 2), ('bird', 'ship', 2), ('deer', 'frog', 2), ('airplane', 'deer', 1), ('airplane', 'dog', 1), ('airplane', 'frog', 1), ('automobile', 'ship', 1), ('bird', 'automobile', 1), ('cat', 'automobile', 1), ('dog', 'frog', 1), ('frog', 'airplane', 1), ('frog', 'dog', 1), ('frog', 'truck', 1), ('horse', 'bird', 1), ('horse', 'frog', 1), ('ship', 'bird', 1), ('truck', 'cat', 1), ('truck', 'deer', 1)]
検証データのクラス毎のaccuracy
airplane : 0.9730 automobile : 0.9890 bird : 0.9620 cat : 0.9280 deer : 0.9800 dog : 0.9440 frog : 0.9830 horse : 0.9750 ship : 0.9910 truck : 0.9680
0 件のコメント:
コメントを投稿