Project/캡스톤디자인2

[NLP Project] 성능 기록

sillon 2022. 11. 6. 01:30
728x90
반응형

모델명: test_model.h5 

파라미터 설정

test-train split : 8:2

Optimaizer: Adam

Epoch = 3

batch_size=128

Learning_rate = 0.001

 

 

성능

loss: 0.1447 - accuracy: 0.7625

 


모델명: test_model2.h5 

파라미터 설정

test-train split : 8:2

Optimaizer: Adam

Epoch = 20

batch_size=128

Learning_rate = 0.005

성능

loss: 0.1796 - accuracy: 0.7463

 

학습로그

더보기

Epoch 1/20
2022-11-06 01:29:32.795455: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.10
2022-11-06 01:29:33.114739: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.7
563/563 [==============================] - 18s 25ms/step - loss: 0.2038 - accuracy: 0.7059 - val_loss: 0.1458 - val_accuracy: 0.7606
Epoch 2/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1406 - accuracy: 0.7660 - val_loss: 0.1398 - val_accuracy: 0.7676
Epoch 3/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1334 - accuracy: 0.7723 - val_loss: 0.1376 - val_accuracy: 0.7702
Epoch 4/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1293 - accuracy: 0.7764 - val_loss: 0.1374 - val_accuracy: 0.7701
Epoch 5/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1240 - accuracy: 0.7826 - val_loss: 0.1376 - val_accuracy: 0.7705
Epoch 6/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1194 - accuracy: 0.7895 - val_loss: 0.1394 - val_accuracy: 0.7704
Epoch 7/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1142 - accuracy: 0.7953 - val_loss: 0.1420 - val_accuracy: 0.7668
Epoch 8/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1092 - accuracy: 0.8011 - val_loss: 0.1452 - val_accuracy: 0.7652
Epoch 9/20
563/563 [==============================] - 12s 21ms/step - loss: 0.1045 - accuracy: 0.8084 - val_loss: 0.1483 - val_accuracy: 0.7619
Epoch 10/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0998 - accuracy: 0.8154 - val_loss: 0.1523 - val_accuracy: 0.7590
Epoch 11/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0969 - accuracy: 0.8209 - val_loss: 0.1569 - val_accuracy: 0.7580
Epoch 12/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0929 - accuracy: 0.8267 - val_loss: 0.1589 - val_accuracy: 0.7563
Epoch 13/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0906 - accuracy: 0.8303 - val_loss: 0.1633 - val_accuracy: 0.7526
Epoch 14/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0882 - accuracy: 0.8347 - val_loss: 0.1649 - val_accuracy: 0.7547
Epoch 15/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0867 - accuracy: 0.8362 - val_loss: 0.1706 - val_accuracy: 0.7511
Epoch 16/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0833 - accuracy: 0.8423 - val_loss: 0.1722 - val_accuracy: 0.7490
Epoch 17/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0827 - accuracy: 0.8428 - val_loss: 0.1748 - val_accuracy: 0.7433
Epoch 18/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0811 - accuracy: 0.8456 - val_loss: 0.1768 - val_accuracy: 0.7500
Epoch 19/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0800 - accuracy: 0.8475 - val_loss: 0.1781 - val_accuracy: 0.7479
Epoch 20/20
563/563 [==============================] - 12s 21ms/step - loss: 0.0800 - accuracy: 0.8478 - val_loss: 0.1796 - val_accuracy: 0.7463
563/563 [==============================] - 4s 7ms/step - loss: 0.1796 - accuracy: 0.7463

모델명: test_model3.h5 

rmsprop 0.001

셀프어텐션 추가

Epoch 1/3
2022-11-08 13:26:29.106338: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.10
563/563 [==============================] - 186s 325ms/step - loss: 0.2460 - accuracy: 0.6769 - val_loss: 0.1975 - val_accuracy: 0.6903
Epoch 2/3
563/563 [==============================] - 181s 321ms/step - loss: 0.1895 - accuracy: 0.6960 - val_loss: 0.1757 - val_accuracy: 0.7169
Epoch 3/3
563/563 [==============================] - 181s 322ms/step - loss: 0.1705 - accuracy: 0.7228 - val_loss: 0.1621 - val_accuracy: 0.7378
563/563 [==============================] - 23s 40ms/step - loss: 0.1621 - accuracy: 0.7378
Model: "sequential"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
embedding (Embedding)        (None, 70, 128)           512000    
_________________________________________________________________
bidirectional (Bidirectional (None, 70, 256)           263168    
_________________________________________________________________
seq_self_attention (SeqSelfA (None, 70, 256)           16449     
_________________________________________________________________
time_distributed (TimeDistri (None, 70, 30)            7710      
=================================================================
Total params: 799,327
Trainable params: 799,327
Non-trainable params: 0
_________________________________________________________________
단어             |실제값  |예측값
----------------------------------
무단전재&재배포         |-      |-
금즙               |-      |-
-윤신욱             |PER_B  |PER_B
-                |CVL_B  |CVL_B
uk82@mydaily.co.kr|TRM_B  |TRM_B
**********************************
/home/suyeon/anaconda3/envs/py39/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1334: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
/home/suyeon/anaconda3/envs/py39/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1334: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
/home/suyeon/anaconda3/envs/py39/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1334: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
/home/suyeon/anaconda3/envs/py39/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1334: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
/home/suyeon/anaconda3/envs/py39/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1334: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
/home/suyeon/anaconda3/envs/py39/lib/python3.9/site-packages/sklearn/metrics/_classification.py:1334: UndefinedMetricWarning: Recall and F-score are ill-defined and being set to 0.0 in labels with no true samples. Use `zero_division` parameter to control this behavior.
  _warn_prf(average, modifier, msg_start, len(result))
              precision    recall  f1-score   support

           -       0.12      0.99      0.21    145777
       cvl_b       0.37      0.04      0.07     11495
       num_b       0.48      0.29      0.36     11032
       per_b       0.36      0.18      0.24      8497
       org_b       0.50      0.27      0.35      8114
       dat_b       0.88      0.60      0.71      5172
       loc_b       0.34      0.02      0.04      4088
       trm_b       0.14      0.10      0.12      3656
       evt_b       0.37      0.21      0.27      2242
       num_i       0.46      0.01      0.01      1800
       dat_i       0.44      0.66      0.53      1628
       anm_b       0.44      0.08      0.13      1337
       evt_i       0.10      0.07      0.08      1254
       per_i       0.00      0.00      0.00      1014
       org_i       0.00      0.00      0.00       979
       afw_b       0.00      0.00      0.00       849
       cvl_i       0.00      0.00      0.00       649
       trm_i       0.00      0.00      0.00       663
       tim_b       0.70      0.31      0.43       702
       fld_b       0.00      0.00      0.00       454
       afw_i       0.00      0.00      0.00       358
       tim_i       0.00      0.00      0.00       237
       plt_b       0.00      0.00      0.00        65
       mat_b       0.00      0.00      0.00        53
       loc_i       0.00      0.00      0.00        46
       anm_i       0.00      0.00      0.00        13
       fld_i       0.00      0.00      0.00         6
       mat_i       0.00      0.00      0.00         1
       plt_i       0.00      0.00      0.00         0
         PAD       0.00      0.00      0.00   1047819

   micro avg       0.12      0.12      0.12   1260000
   macro avg       0.19      0.13      0.12   1260000
weighted avg       0.03      0.12      0.04   1260000
728x90
반응형