#python #machine-learning #keras #text-to-speech
Вопрос:
Я создаю модель преобразования текста в речь в keras. Обучение выполняется нормально, пока потеря [mse] не достигнет 200 или 250, а затем оно перестает улучшаться.
мой код
model = Sequential([
layers.Embedding(4220,8,input_length=70),
layers.Conv1D(32,3,activation='relu'),
#layers.MaxPooling1D(2),
layers.Bidirectional(layers.GRU(32,return_sequences=True)),
layers.Bidirectional(layers.GRU(64,return_sequences=True)),
layers.Bidirectional(layers.GRU(128,return_sequences=True)),
layers.Bidirectional(layers.GRU(512,return_sequences=True)),
layers.Flatten(),
layers.Dense(70,activation='relu'),
layers.Dense(700,activation='relu'),
layers.Dense(82688,activation='linear')
])
моя потеря и val_loss
История моей эпохи :
Epoch 1/600
100/100 [==============================] - 184s 2s/step - loss: 1277.8810 - val_loss: 1351.1093
Epoch 2/600
100/100 [==============================] - ETA: 0s - loss: 1270.0303Epoch 3/600
100/100 [==============================] - 167s 2s/step - loss: 1259.7238 - val_loss: 1325.2167
Epoch 4/600
100/100 [==============================] - 166s 2s/step - loss: 1248.1462 - val_loss: 1323.8337
Epoch 5/600
100/100 [==============================] - 167s 2s/step - loss: 1243.7775 - val_loss: 1314.3406
Epoch 6/600
100/100 [==============================] - 167s 2s/step - loss: 1238.6522 - val_loss: 1309.3848
Epoch 7/600
100/100 [==============================] - 167s 2s/step - loss: 1236.4279 - val_loss: 1310.0287
Epoch 8/600
100/100 [==============================] - 166s 2s/step - loss: 1233.0273 - val_loss: 1302.7568
Epoch 9/600
100/100 [==============================] - 167s 2s/step - loss: 1230.3721 - val_loss: 1301.9248
Epoch 10/600
100/100 [==============================] - 167s 2s/step - loss: 1222.4075 - val_loss: 1291.3480
Epoch 11/600
100/100 [==============================] - 171s 2s/step - loss: 1212.7744 - val_loss: 1283.5021
Epoch 12/600
100/100 [==============================] - 167s 2s/step - loss: 1202.2744 - val_loss: 1267.7415
Epoch 13/600
100/100 [==============================] - 166s 2s/step - loss: 1192.2128 - val_loss: 1266.8981
Epoch 14/600
100/100 [==============================] - 166s 2s/step - loss: 1180.1565 - val_loss: 1245.8889
Epoch 15/600
100/100 [==============================] - 166s 2s/step - loss: 1160.5439 - val_loss: 1239.8575
Epoch 16/600
100/100 [==============================] - 167s 2s/step - loss: 1145.3345 - val_loss: 1230.9562
Epoch 17/600
100/100 [==============================] - 170s 2s/step - loss: 1123.7307 - val_loss: 1210.9500
Epoch 18/600
100/100 [==============================] - 169s 2s/step - loss: 1093.4578 - val_loss: 1175.7172
Epoch 19/600
100/100 [==============================] - 174s 2s/step - loss: 1075.5237 - val_loss: 1146.8014
Epoch 20/600
100/100 [==============================] - 171s 2s/step - loss: 1038.1080 - val_loss: 1102.3202
Epoch 21/600
100/100 [==============================] - 170s 2s/step - loss: 1007.4012 - val_loss: 1080.9078
Epoch 22/600
100/100 [==============================] - 169s 2s/step - loss: 964.5367 - val_loss: 1040.2711
Epoch 23/600
100/100 [==============================] - 169s 2s/step - loss: 935.2628 - val_loss: 1001.4338
Epoch 24/600
100/100 [==============================] - 170s 2s/step - loss: 905.0437 - val_loss: 964.1932
Epoch 25/600
100/100 [==============================] - 174s 2s/step - loss: 855.8116 - val_loss: 925.6329
Epoch 26/600
100/100 [==============================] - 171s 2s/step - loss: 841.3853 - val_loss: 906.4941
Epoch 27/600
100/100 [==============================] - 169s 2s/step - loss: 799.1079 - val_loss: 871.1532
Epoch 28/600
100/100 [==============================] - ETA: 0s - loss: 773.6056Epoch 29/600
100/100 [==============================] - 173s 2s/step - loss: 729.3723 - val_loss: 786.2578
Epoch 30/600
100/100 [==============================] - 171s 2s/step - loss: 700.6778 - val_loss: 746.0270
Epoch 31/600
100/100 [==============================] - 169s 2s/step - loss: 668.5749 - val_loss: 722.8984
Epoch 32/600
100/100 [==============================] - 171s 2s/step - loss: 663.7871 - val_loss: 700.9728
Epoch 33/600
100/100 [==============================] - 170s 2s/step - loss: 631.1932 - val_loss: 693.3641
Epoch 34/600
100/100 [==============================] - 169s 2s/step - loss: 605.1631 - val_loss: 632.8056
Epoch 35/600
100/100 [==============================] - 168s 2s/step - loss: 569.0238 - val_loss: 629.2961
Epoch 36/600
100/100 [==============================] - 169s 2s/step - loss: 558.2274 - val_loss: 605.8413
Epoch 37/600
100/100 [==============================] - 169s 2s/step - loss: 542.5693 - val_loss: 601.4443
Epoch 38/600
100/100 [==============================] - 168s 2s/step - loss: 536.8228 - val_loss: 573.8625
Epoch 39/600
100/100 [==============================] - 168s 2s/step - loss: 521.8893 - val_loss: 581.7361
Epoch 40/600
100/100 [==============================] - 168s 2s/step - loss: 513.2167 - val_loss: 552.5815
Epoch 41/600
100/100 [==============================] - 169s 2s/step - loss: 487.2066 - val_loss: 542.0209
Epoch 42/600
100/100 [==============================] - 168s 2s/step - loss: 476.7976 - val_loss: 526.0634
Epoch 43/600
100/100 [==============================] - 168s 2s/step - loss: 463.9364 - val_loss: 513.9921
Epoch 44/600
100/100 [==============================] - ETA: 0s - loss: 455.5290Epoch 45/600
100/100 [==============================] - 168s 2s/step - loss: 450.6151 - val_loss: 499.5727
Epoch 46/600
100/100 [==============================] - 168s 2s/step - loss: 442.5982 - val_loss: 517.9942
Epoch 47/600
100/100 [==============================] - 168s 2s/step - loss: 432.7837 - val_loss: 486.6371
Epoch 48/600
100/100 [==============================] - 168s 2s/step - loss: 435.1079 - val_loss: 468.2446
Epoch 49/600
100/100 [==============================] - 168s 2s/step - loss: 418.9065 - val_loss: 457.4920
Epoch 50/600
100/100 [==============================] - ETA: 0s - loss: 403.9354Epoch 51/600
100/100 [==============================] - 169s 2s/step - loss: 396.1986 - val_loss: 451.8055
Epoch 52/600
100/100 [==============================] - 168s 2s/step - loss: 395.5801 - val_loss: 444.5719
Epoch 53/600
100/100 [==============================] - 169s 2s/step - loss: 391.9252 - val_loss: 440.7292
Epoch 54/600
100/100 [==============================] - 168s 2s/step - loss: 390.3062 - val_loss: 435.1925
Epoch 55/600
100/100 [==============================] - 169s 2s/step - loss: 384.1246 - val_loss: 426.5699
Epoch 56/600
100/100 [==============================] - 168s 2s/step - loss: 378.4158 - val_loss: 416.9171
Epoch 57/600
100/100 [==============================] - 169s 2s/step - loss: 374.4364 - val_loss: 415.8269
Epoch 58/600
100/100 [==============================] - 169s 2s/step - loss: 373.1714 - val_loss: 412.0515
Epoch 59/600
100/100 [==============================] - ETA: 0s - loss: 372.6999Epoch 60/600
100/100 [==============================] - 168s 2s/step - loss: 366.2562 - val_loss: 411.2773
Epoch 61/600
100/100 [==============================] - 169s 2s/step - loss: 356.3777 - val_loss: 400.4987
Epoch 62/600
100/100 [==============================] - 167s 2s/step - loss: 347.1350 - val_loss: 393.9872
Epoch 63/600
100/100 [==============================] - 167s 2s/step - loss: 348.1526 - val_loss: 404.4293
Epoch 64/600
100/100 [==============================] - 167s 2s/step - loss: 351.8647 - val_loss: 394.9397
Epoch 65/600
100/100 [==============================] - 168s 2s/step - loss: 350.8889 - val_loss: 391.0047
Epoch 66/600
100/100 [==============================] - 170s 2s/step - loss: 345.6855 - val_loss: 384.2527
Epoch 67/600
100/100 [==============================] - 170s 2s/step - loss: 340.5289 - val_loss: 384.8631
Epoch 68/600
100/100 [==============================] - 170s 2s/step - loss: 335.2769 - val_loss: 383.4778
Epoch 69/600
100/100 [==============================] - 169s 2s/step - loss: 333.9134 - val_loss: 372.5128
Epoch 70/600
100/100 [==============================] - 174s 2s/step - loss: 331.4970 - val_loss: 379.6816
Epoch 71/600
100/100 [==============================] - 169s 2s/step - loss: 328.9393 - val_loss: 367.0433
Epoch 72/600
100/100 [==============================] - 168s 2s/step - loss: 324.4344 - val_loss: 366.4271
Epoch 73/600
100/100 [==============================] - 169s 2s/step - loss: 326.3188 - val_loss: 367.3526
Epoch 74/600
100/100 [==============================] - 169s 2s/step - loss: 323.1003 - val_loss: 366.2170
Epoch 75/600
100/100 [==============================] - 170s 2s/step - loss: 319.6701 - val_loss: 363.6429
Epoch 76/600
100/100 [==============================] - 169s 2s/step - loss: 317.2768 - val_loss: 362.6992
Epoch 77/600
100/100 [==============================] - 168s 2s/step - loss: 327.8936 - val_loss: 371.5877
Epoch 78/600
100/100 [==============================] - 170s 2s/step - loss: 327.2147 - val_loss: 372.3321
Epoch 79/600
100/100 [==============================] - 169s 2s/step - loss: 323.5416 - val_loss: 370.9175
Epoch 80/600
100/100 [==============================] - 169s 2s/step - loss: 314.2548 - val_loss: 350.6062
Epoch 81/600
100/100 [==============================] - 169s 2s/step - loss: 306.0438 - val_loss: 343.2444
Epoch 82/600
100/100 [==============================] - 169s 2s/step - loss: 297.7496 - val_loss: 339.3951
Epoch 83/600
100/100 [==============================] - 169s 2s/step - loss: 297.1666 - val_loss: 341.4118
Epoch 84/600
100/100 [==============================] - 168s 2s/step - loss: 304.3513 - val_loss: 346.7999
Epoch 85/600
100/100 [==============================] - 169s 2s/step - loss: 298.1828 - val_loss: 334.8227
Epoch 86/600
100/100 [==============================] - 168s 2s/step - loss: 291.7958 - val_loss: 331.8147
Epoch 87/600
100/100 [==============================] - 168s 2s/step - loss: 293.4404 - val_loss: 332.5406
Epoch 88/600
100/100 [==============================] - 169s 2s/step - loss: 291.5654 - val_loss: 332.8572
Epoch 89/600
100/100 [==============================] - 169s 2s/step - loss: 292.3975 - val_loss: 330.1451
Epoch 90/600
100/100 [==============================] - 169s 2s/step - loss: 292.7254 - val_loss: 332.5945
Epoch 91/600
100/100 [==============================] - 169s 2s/step - loss: 293.6047 - val_loss: 343.6122
Epoch 92/600
100/100 [==============================] - 168s 2s/step - loss: 290.7727 - val_loss: 335.6723
Epoch 93/600
100/100 [==============================] - 169s 2s/step - loss: 290.4878 - val_loss: 327.3437
Epoch 94/600
100/100 [==============================] - 169s 2s/step - loss: 290.0660 - val_loss: 326.8318
Epoch 95/600
100/100 [==============================] - 171s 2s/step - loss: 286.1216 - val_loss: 321.0185
Epoch 96/600
100/100 [==============================] - 170s 2s/step - loss: 279.6049 - val_loss: 316.1211
Epoch 97/600
100/100 [==============================] - 171s 2s/step - loss: 275.9084 - val_loss: 310.0760
Epoch 98/600
100/100 [==============================] - 171s 2s/step - loss: 274.8510 - val_loss: 310.8442
Epoch 99/600
100/100 [==============================] - 177s 2s/step - loss: 273.8518 - val_loss: 315.4663
Epoch 100/600
100/100 [==============================] - 174s 2s/step - loss: 277.0237 - val_loss: 316.6178
Epoch 101/600
100/100 [==============================] - 173s 2s/step - loss: 279.0191 - val_loss: 317.5232
Epoch 102/600
100/100 [==============================] - 173s 2s/step - loss: 278.4234 - val_loss: 315.9617
Epoch 103/600
100/100 [==============================] - ETA: 0s - loss: 278.2243Epoch 104/600
100/100 [==============================] - 172s 2s/step - loss: 281.0945 - val_loss: 321.7167
Epoch 105/600
100/100 [==============================] - 173s 2s/step - loss: 276.5663 - val_loss: 310.6582
Epoch 106/600
100/100 [==============================] - 173s 2s/step - loss: 273.8687 - val_loss: 315.6835
Epoch 107/600
100/100 [==============================] - 172s 2s/step - loss: 276.4300 - val_loss: 314.7690
Epoch 00107: early stopping
Комментарии:
1. не переобучайте свою модель.
2. это может относиться больше к datascience.stackexchange.com
3. Кривая обучения кажется довольно приличной. Все методы обучения могут достигать определенного порога, а затем останавливаться. Вопрос, который вы должны задать себе, заключается в том, достаточна ли изученная модель для вашей задачи
4. Я думаю, что именно так работает машинное обучение, в зависимости от того, сколько у вас данных для обучения / проверки и насколько хорошо они сбалансированы для обучения. В какой-то момент точность модели или потеря проверки или что-то вроде стабилизируется.