Tune Neural Network Regressor

For this tutorial we will be predicting NBA wins based on a number of team statistics

Import dependencies

import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from keras.callbacks import ModelCheckpoint
## C:\Users\aengland\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
##   from ._conv import register_converters as _register_converters
## Using TensorFlow backend.
from keras.callbacks import EarlyStopping
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn import metrics
import numpy as np
from scipy.stats import pearsonr, shapiro

Import data

df = pd.read_csv('dt_NBA_reg.csv')

Save the DV as DV

DV = 'W'

Dummy code categorical variables

final_data = pd.get_dummies(df, drop_first=True)

Standardize predictor variables

scaler = StandardScaler()

Fit scaler to the features

scaler.fit(final_data.drop(DV, axis = 1))

Transform features to scaled version

scaled_features = scaler.transform(final_data.drop(DV, axis = 1))

Save into data frame

dt_feat = pd.DataFrame(scaled_features, columns=final_data.loc[:,final_data.columns != DV].columns)

Get Xs and y

X = dt_feat
y = final_data[DV]

Create train and test sets to use when we have re-fit the model

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)

Save model and weights with lowest loss val

filepath = 'model_weights.hdf5'
callbacks_list = [ModelCheckpoint(filepath, monitor='val_loss', verbose=True, save_best_only=True, mode='min')]

Save number of columns

n_cols = len(X.columns)

Instantiate model

model = Sequential()
# Add first layer
model.add(Dense(units=n_cols, activation='relu', input_shape=(n_cols,)))
# Add next layer layer
model.add(Dense(units=19, activation='relu')) # 1 hidden layer with 19 nodes
# Add output layer
model.add(Dense(units=1))

Compile the model

model.compile(loss='mean_squared_error', optimizer='adam') 
# Fit model
model.fit(X, y, validation_split=0.33, epochs=250, callbacks=callbacks_list, verbose=True)
## Train on 578 samples, validate on 285 samples
## Epoch 1/250
## 
 32/578 [>.............................] - ETA: 2s - loss: 2256.8701
578/578 [==============================] - 0s 320us/step - loss: 1822.2062 - val_loss: 1814.3574
## 
## Epoch 00001: val_loss improved from inf to 1814.35739, saving model to model_weights.hdf5
## Epoch 2/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 1774.5526
578/578 [==============================] - 0s 81us/step - loss: 1766.0260 - val_loss: 1773.2376
## 
## Epoch 00002: val_loss improved from 1814.35739 to 1773.23765, saving model to model_weights.hdf5
## Epoch 3/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 2039.0398
578/578 [==============================] - 0s 57us/step - loss: 1692.8381 - val_loss: 1723.1984
## 
## Epoch 00003: val_loss improved from 1773.23765 to 1723.19839, saving model to model_weights.hdf5
## Epoch 4/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 1828.9131
578/578 [==============================] - 0s 26us/step - loss: 1580.8831 - val_loss: 1658.4835
## 
## Epoch 00004: val_loss improved from 1723.19839 to 1658.48354, saving model to model_weights.hdf5
## Epoch 5/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 1834.4213
578/578 [==============================] - 0s 58us/step - loss: 1418.7586 - val_loss: 1576.6471
## 
## Epoch 00005: val_loss improved from 1658.48354 to 1576.64705, saving model to model_weights.hdf5
## Epoch 6/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 1249.8021
578/578 [==============================] - 0s 56us/step - loss: 1215.6562 - val_loss: 1471.2834
## 
## Epoch 00006: val_loss improved from 1576.64705 to 1471.28345, saving model to model_weights.hdf5
## Epoch 7/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 1165.0219
578/578 [==============================] - 0s 71us/step - loss: 999.6617 - val_loss: 1347.4503
## 
## Epoch 00007: val_loss improved from 1471.28345 to 1347.45026, saving model to model_weights.hdf5
## Epoch 8/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 1177.1323
578/578 [==============================] - 0s 57us/step - loss: 811.6398 - val_loss: 1202.2513
## 
## Epoch 00008: val_loss improved from 1347.45026 to 1202.25134, saving model to model_weights.hdf5
## Epoch 9/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 723.8370
578/578 [==============================] - 0s 55us/step - loss: 679.9746 - val_loss: 1024.6681
## 
## Epoch 00009: val_loss improved from 1202.25134 to 1024.66808, saving model to model_weights.hdf5
## Epoch 10/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 245.8133
578/578 [==============================] - 0s 57us/step - loss: 589.8940 - val_loss: 823.3321
## 
## Epoch 00010: val_loss improved from 1024.66808 to 823.33211, saving model to model_weights.hdf5
## Epoch 11/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 438.3302
578/578 [==============================] - 0s 56us/step - loss: 516.3655 - val_loss: 634.0073
## 
## Epoch 00011: val_loss improved from 823.33211 to 634.00729, saving model to model_weights.hdf5
## Epoch 12/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 414.3252
578/578 [==============================] - 0s 73us/step - loss: 446.0073 - val_loss: 462.8330
## 
## Epoch 00012: val_loss improved from 634.00729 to 462.83300, saving model to model_weights.hdf5
## Epoch 13/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 317.2886
578/578 [==============================] - 0s 57us/step - loss: 380.5959 - val_loss: 320.9848
## 
## Epoch 00013: val_loss improved from 462.83300 to 320.98477, saving model to model_weights.hdf5
## Epoch 14/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 250.3728
578/578 [==============================] - 0s 51us/step - loss: 324.0045 - val_loss: 233.9230
## 
## Epoch 00014: val_loss improved from 320.98477 to 233.92296, saving model to model_weights.hdf5
## Epoch 15/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 221.8133
578/578 [==============================] - 0s 43us/step - loss: 283.8912 - val_loss: 187.0585
## 
## Epoch 00015: val_loss improved from 233.92296 to 187.05852, saving model to model_weights.hdf5
## Epoch 16/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 318.8459
578/578 [==============================] - 0s 57us/step - loss: 254.8669 - val_loss: 163.9023
## 
## Epoch 00016: val_loss improved from 187.05852 to 163.90226, saving model to model_weights.hdf5
## Epoch 17/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 272.4197
578/578 [==============================] - 0s 24us/step - loss: 232.4961 - val_loss: 150.8915
## 
## Epoch 00017: val_loss improved from 163.90226 to 150.89145, saving model to model_weights.hdf5
## Epoch 18/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 222.7967
578/578 [==============================] - 0s 59us/step - loss: 213.8739 - val_loss: 140.0411
## 
## Epoch 00018: val_loss improved from 150.89145 to 140.04107, saving model to model_weights.hdf5
## Epoch 19/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 196.5193
578/578 [==============================] - 0s 26us/step - loss: 197.0743 - val_loss: 127.4158
## 
## Epoch 00019: val_loss improved from 140.04107 to 127.41580, saving model to model_weights.hdf5
## Epoch 20/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 206.1652
578/578 [==============================] - 0s 72us/step - loss: 181.2364 - val_loss: 117.7159
## 
## Epoch 00020: val_loss improved from 127.41580 to 117.71594, saving model to model_weights.hdf5
## Epoch 21/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 127.7843
578/578 [==============================] - 0s 55us/step - loss: 167.2527 - val_loss: 107.9706
## 
## Epoch 00021: val_loss improved from 117.71594 to 107.97057, saving model to model_weights.hdf5
## Epoch 22/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 167.8942
578/578 [==============================] - 0s 57us/step - loss: 153.7919 - val_loss: 102.1179
## 
## Epoch 00022: val_loss improved from 107.97057 to 102.11789, saving model to model_weights.hdf5
## Epoch 23/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 234.5024
578/578 [==============================] - 0s 56us/step - loss: 141.7819 - val_loss: 94.9385
## 
## Epoch 00023: val_loss improved from 102.11789 to 94.93855, saving model to model_weights.hdf5
## Epoch 24/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 184.4449
578/578 [==============================] - 0s 57us/step - loss: 131.3236 - val_loss: 89.2787
## 
## Epoch 00024: val_loss improved from 94.93855 to 89.27873, saving model to model_weights.hdf5
## Epoch 25/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 189.5377
578/578 [==============================] - 0s 55us/step - loss: 122.8837 - val_loss: 85.1832
## 
## Epoch 00025: val_loss improved from 89.27873 to 85.18325, saving model to model_weights.hdf5
## Epoch 26/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 149.9276
578/578 [==============================] - 0s 62us/step - loss: 114.8672 - val_loss: 82.6147
## 
## Epoch 00026: val_loss improved from 85.18325 to 82.61474, saving model to model_weights.hdf5
## Epoch 27/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 127.0138
578/578 [==============================] - 0s 59us/step - loss: 107.7975 - val_loss: 79.4111
## 
## Epoch 00027: val_loss improved from 82.61474 to 79.41112, saving model to model_weights.hdf5
## Epoch 28/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 132.7285
578/578 [==============================] - 0s 57us/step - loss: 102.2205 - val_loss: 74.1177
## 
## Epoch 00028: val_loss improved from 79.41112 to 74.11770, saving model to model_weights.hdf5
## Epoch 29/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 82.7424
578/578 [==============================] - 0s 57us/step - loss: 96.4993 - val_loss: 72.0847
## 
## Epoch 00029: val_loss improved from 74.11770 to 72.08467, saving model to model_weights.hdf5
## Epoch 30/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 94.2207
578/578 [==============================] - 0s 55us/step - loss: 91.1369 - val_loss: 70.6224
## 
## Epoch 00030: val_loss improved from 72.08467 to 70.62244, saving model to model_weights.hdf5
## Epoch 31/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 104.6956
578/578 [==============================] - 0s 56us/step - loss: 86.4926 - val_loss: 68.6932
## 
## Epoch 00031: val_loss improved from 70.62244 to 68.69324, saving model to model_weights.hdf5
## Epoch 32/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 70.4587
578/578 [==============================] - 0s 55us/step - loss: 82.0326 - val_loss: 66.1157
## 
## Epoch 00032: val_loss improved from 68.69324 to 66.11569, saving model to model_weights.hdf5
## Epoch 33/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 94.2708
578/578 [==============================] - 0s 55us/step - loss: 78.1414 - val_loss: 62.3955
## 
## Epoch 00033: val_loss improved from 66.11569 to 62.39555, saving model to model_weights.hdf5
## Epoch 34/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 80.7757
578/578 [==============================] - 0s 60us/step - loss: 74.4653 - val_loss: 61.0905
## 
## Epoch 00034: val_loss improved from 62.39555 to 61.09051, saving model to model_weights.hdf5
## Epoch 35/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 77.2808
578/578 [==============================] - 0s 72us/step - loss: 71.8224 - val_loss: 60.6243
## 
## Epoch 00035: val_loss improved from 61.09051 to 60.62432, saving model to model_weights.hdf5
## Epoch 36/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 75.0708
578/578 [==============================] - 0s 53us/step - loss: 68.7552 - val_loss: 57.3307
## 
## Epoch 00036: val_loss improved from 60.62432 to 57.33067, saving model to model_weights.hdf5
## Epoch 37/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 56.2041
578/578 [==============================] - 0s 59us/step - loss: 65.9914 - val_loss: 55.5560
## 
## Epoch 00037: val_loss improved from 57.33067 to 55.55596, saving model to model_weights.hdf5
## Epoch 38/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 55.5510
578/578 [==============================] - 0s 25us/step - loss: 63.6188 - val_loss: 53.8817
## 
## Epoch 00038: val_loss improved from 55.55596 to 53.88173, saving model to model_weights.hdf5
## Epoch 39/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 70.1550
578/578 [==============================] - 0s 57us/step - loss: 61.4308 - val_loss: 52.7343
## 
## Epoch 00039: val_loss improved from 53.88173 to 52.73431, saving model to model_weights.hdf5
## Epoch 40/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 76.6490
578/578 [==============================] - 0s 59us/step - loss: 59.1099 - val_loss: 50.5711
## 
## Epoch 00040: val_loss improved from 52.73431 to 50.57110, saving model to model_weights.hdf5
## Epoch 41/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 62.1836
578/578 [==============================] - 0s 57us/step - loss: 57.2879 - val_loss: 49.2773
## 
## Epoch 00041: val_loss improved from 50.57110 to 49.27730, saving model to model_weights.hdf5
## Epoch 42/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 68.4199
578/578 [==============================] - 0s 57us/step - loss: 55.5099 - val_loss: 47.8206
## 
## Epoch 00042: val_loss improved from 49.27730 to 47.82062, saving model to model_weights.hdf5
## Epoch 43/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 43.0003
578/578 [==============================] - 0s 26us/step - loss: 53.9808 - val_loss: 46.5513
## 
## Epoch 00043: val_loss improved from 47.82062 to 46.55129, saving model to model_weights.hdf5
## Epoch 44/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 34.4701
578/578 [==============================] - 0s 57us/step - loss: 52.0230 - val_loss: 46.0004
## 
## Epoch 00044: val_loss improved from 46.55129 to 46.00044, saving model to model_weights.hdf5
## Epoch 45/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 42.9173
578/578 [==============================] - 0s 57us/step - loss: 50.3721 - val_loss: 44.8899
## 
## Epoch 00045: val_loss improved from 46.00044 to 44.88985, saving model to model_weights.hdf5
## Epoch 46/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 48.9650
578/578 [==============================] - 0s 59us/step - loss: 48.9629 - val_loss: 43.7363
## 
## Epoch 00046: val_loss improved from 44.88985 to 43.73632, saving model to model_weights.hdf5
## Epoch 47/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 63.9364
578/578 [==============================] - 0s 74us/step - loss: 47.5100 - val_loss: 43.1992
## 
## Epoch 00047: val_loss improved from 43.73632 to 43.19918, saving model to model_weights.hdf5
## Epoch 48/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 35.4763
578/578 [==============================] - 0s 57us/step - loss: 46.1451 - val_loss: 42.0727
## 
## Epoch 00048: val_loss improved from 43.19918 to 42.07275, saving model to model_weights.hdf5
## Epoch 49/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 40.0282
578/578 [==============================] - 0s 57us/step - loss: 45.1577 - val_loss: 41.2179
## 
## Epoch 00049: val_loss improved from 42.07275 to 41.21791, saving model to model_weights.hdf5
## Epoch 50/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 40.5458
578/578 [==============================] - 0s 59us/step - loss: 43.7662 - val_loss: 39.8454
## 
## Epoch 00050: val_loss improved from 41.21791 to 39.84543, saving model to model_weights.hdf5
## Epoch 51/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 49.9305
578/578 [==============================] - 0s 24us/step - loss: 42.5146 - val_loss: 38.9152
## 
## Epoch 00051: val_loss improved from 39.84543 to 38.91519, saving model to model_weights.hdf5
## Epoch 52/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 53.7980
578/578 [==============================] - 0s 56us/step - loss: 41.1121 - val_loss: 37.3054
## 
## Epoch 00052: val_loss improved from 38.91519 to 37.30538, saving model to model_weights.hdf5
## Epoch 53/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 45.7686
578/578 [==============================] - 0s 57us/step - loss: 40.0520 - val_loss: 36.3716
## 
## Epoch 00053: val_loss improved from 37.30538 to 36.37157, saving model to model_weights.hdf5
## Epoch 54/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 30.8098
578/578 [==============================] - 0s 57us/step - loss: 38.9065 - val_loss: 35.6055
## 
## Epoch 00054: val_loss improved from 36.37157 to 35.60549, saving model to model_weights.hdf5
## Epoch 55/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 46.7390
578/578 [==============================] - 0s 22us/step - loss: 38.1922 - val_loss: 34.8610
## 
## Epoch 00055: val_loss improved from 35.60549 to 34.86104, saving model to model_weights.hdf5
## Epoch 56/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 34.3910
578/578 [==============================] - 0s 29us/step - loss: 37.1287 - val_loss: 34.1410
## 
## Epoch 00056: val_loss improved from 34.86104 to 34.14095, saving model to model_weights.hdf5
## Epoch 57/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 30.9040
578/578 [==============================] - 0s 57us/step - loss: 36.2433 - val_loss: 33.8052
## 
## Epoch 00057: val_loss improved from 34.14095 to 33.80517, saving model to model_weights.hdf5
## Epoch 58/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 33.9738
578/578 [==============================] - 0s 24us/step - loss: 35.6514 - val_loss: 33.6481
## 
## Epoch 00058: val_loss improved from 33.80517 to 33.64807, saving model to model_weights.hdf5
## Epoch 59/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 32.8492
578/578 [==============================] - 0s 81us/step - loss: 34.8943 - val_loss: 32.5726
## 
## Epoch 00059: val_loss improved from 33.64807 to 32.57260, saving model to model_weights.hdf5
## Epoch 60/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 37.6763
578/578 [==============================] - 0s 22us/step - loss: 34.0720 - val_loss: 31.6350
## 
## Epoch 00060: val_loss improved from 32.57260 to 31.63499, saving model to model_weights.hdf5
## Epoch 61/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 30.8454
578/578 [==============================] - 0s 55us/step - loss: 33.3612 - val_loss: 31.1154
## 
## Epoch 00061: val_loss improved from 31.63499 to 31.11536, saving model to model_weights.hdf5
## Epoch 62/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 35.2231
578/578 [==============================] - 0s 57us/step - loss: 32.6192 - val_loss: 30.4042
## 
## Epoch 00062: val_loss improved from 31.11536 to 30.40422, saving model to model_weights.hdf5
## Epoch 63/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 28.8654
578/578 [==============================] - 0s 53us/step - loss: 32.0403 - val_loss: 29.8648
## 
## Epoch 00063: val_loss improved from 30.40422 to 29.86481, saving model to model_weights.hdf5
## Epoch 64/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 34.1576
578/578 [==============================] - 0s 83us/step - loss: 31.2988 - val_loss: 29.2967
## 
## Epoch 00064: val_loss improved from 29.86481 to 29.29666, saving model to model_weights.hdf5
## Epoch 65/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 34.1188
578/578 [==============================] - 0s 56us/step - loss: 30.6124 - val_loss: 29.1097
## 
## Epoch 00065: val_loss improved from 29.29666 to 29.10973, saving model to model_weights.hdf5
## Epoch 66/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 25.0518
578/578 [==============================] - 0s 87us/step - loss: 30.1158 - val_loss: 28.5496
## 
## Epoch 00066: val_loss improved from 29.10973 to 28.54965, saving model to model_weights.hdf5
## Epoch 67/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 34.8441
578/578 [==============================] - 0s 57us/step - loss: 29.4085 - val_loss: 27.7379
## 
## Epoch 00067: val_loss improved from 28.54965 to 27.73788, saving model to model_weights.hdf5
## Epoch 68/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 30.9335
578/578 [==============================] - 0s 86us/step - loss: 28.8430 - val_loss: 27.3581
## 
## Epoch 00068: val_loss improved from 27.73788 to 27.35810, saving model to model_weights.hdf5
## Epoch 69/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 25.1412
578/578 [==============================] - 0s 59us/step - loss: 28.4970 - val_loss: 26.9099
## 
## Epoch 00069: val_loss improved from 27.35810 to 26.90990, saving model to model_weights.hdf5
## Epoch 70/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 23.3568
578/578 [==============================] - 0s 55us/step - loss: 27.7748 - val_loss: 26.6249
## 
## Epoch 00070: val_loss improved from 26.90990 to 26.62486, saving model to model_weights.hdf5
## Epoch 71/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 27.0987
578/578 [==============================] - 0s 24us/step - loss: 27.3448 - val_loss: 25.9755
## 
## Epoch 00071: val_loss improved from 26.62486 to 25.97550, saving model to model_weights.hdf5
## Epoch 72/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 36.3487
578/578 [==============================] - 0s 88us/step - loss: 26.7253 - val_loss: 25.6118
## 
## Epoch 00072: val_loss improved from 25.97550 to 25.61178, saving model to model_weights.hdf5
## Epoch 73/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 23.6642
578/578 [==============================] - 0s 24us/step - loss: 26.4005 - val_loss: 25.7425
## 
## Epoch 00073: val_loss did not improve from 25.61178
## Epoch 74/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 26.9221
578/578 [==============================] - 0s 24us/step - loss: 26.0240 - val_loss: 24.9489
## 
## Epoch 00074: val_loss improved from 25.61178 to 24.94894, saving model to model_weights.hdf5
## Epoch 75/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 38.9938
578/578 [==============================] - 0s 58us/step - loss: 25.4419 - val_loss: 24.5737
## 
## Epoch 00075: val_loss improved from 24.94894 to 24.57373, saving model to model_weights.hdf5
## Epoch 76/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.9566
578/578 [==============================] - 0s 24us/step - loss: 25.0888 - val_loss: 24.3996
## 
## Epoch 00076: val_loss improved from 24.57373 to 24.39964, saving model to model_weights.hdf5
## Epoch 77/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 35.4701
578/578 [==============================] - 0s 57us/step - loss: 24.6879 - val_loss: 23.9605
## 
## Epoch 00077: val_loss improved from 24.39964 to 23.96050, saving model to model_weights.hdf5
## Epoch 78/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 32.2273
578/578 [==============================] - 0s 57us/step - loss: 24.0722 - val_loss: 23.7283
## 
## Epoch 00078: val_loss improved from 23.96050 to 23.72834, saving model to model_weights.hdf5
## Epoch 79/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 35.0355
578/578 [==============================] - 0s 24us/step - loss: 23.6906 - val_loss: 23.3329
## 
## Epoch 00079: val_loss improved from 23.72834 to 23.33292, saving model to model_weights.hdf5
## Epoch 80/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.7732
578/578 [==============================] - 0s 59us/step - loss: 23.3084 - val_loss: 23.0238
## 
## Epoch 00080: val_loss improved from 23.33292 to 23.02380, saving model to model_weights.hdf5
## Epoch 81/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 39.1684
578/578 [==============================] - 0s 24us/step - loss: 22.9903 - val_loss: 23.0451
## 
## Epoch 00081: val_loss did not improve from 23.02380
## Epoch 82/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 25.2258
578/578 [==============================] - 0s 26us/step - loss: 22.7592 - val_loss: 22.5805
## 
## Epoch 00082: val_loss improved from 23.02380 to 22.58054, saving model to model_weights.hdf5
## Epoch 83/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 21.8357
578/578 [==============================] - 0s 55us/step - loss: 22.2136 - val_loss: 22.1796
## 
## Epoch 00083: val_loss improved from 22.58054 to 22.17964, saving model to model_weights.hdf5
## Epoch 84/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.3841
578/578 [==============================] - 0s 55us/step - loss: 21.8409 - val_loss: 21.9244
## 
## Epoch 00084: val_loss improved from 22.17964 to 21.92445, saving model to model_weights.hdf5
## Epoch 85/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.0828
578/578 [==============================] - 0s 56us/step - loss: 21.4501 - val_loss: 21.5533
## 
## Epoch 00085: val_loss improved from 21.92445 to 21.55325, saving model to model_weights.hdf5
## Epoch 86/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 23.0660
578/578 [==============================] - 0s 55us/step - loss: 21.2722 - val_loss: 21.2098
## 
## Epoch 00086: val_loss improved from 21.55325 to 21.20979, saving model to model_weights.hdf5
## Epoch 87/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.4700
578/578 [==============================] - 0s 72us/step - loss: 21.0903 - val_loss: 21.4262
## 
## Epoch 00087: val_loss did not improve from 21.20979
## Epoch 88/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 22.1496
578/578 [==============================] - 0s 47us/step - loss: 20.6338 - val_loss: 20.6426
## 
## Epoch 00088: val_loss improved from 21.20979 to 20.64260, saving model to model_weights.hdf5
## Epoch 89/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.4180
578/578 [==============================] - 0s 26us/step - loss: 20.2861 - val_loss: 20.4197
## 
## Epoch 00089: val_loss improved from 20.64260 to 20.41967, saving model to model_weights.hdf5
## Epoch 90/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 24.7716
578/578 [==============================] - 0s 59us/step - loss: 20.0446 - val_loss: 20.3196
## 
## Epoch 00090: val_loss improved from 20.41967 to 20.31960, saving model to model_weights.hdf5
## Epoch 91/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.1945
578/578 [==============================] - 0s 24us/step - loss: 19.6761 - val_loss: 19.8744
## 
## Epoch 00091: val_loss improved from 20.31960 to 19.87437, saving model to model_weights.hdf5
## Epoch 92/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.8225
578/578 [==============================] - 0s 57us/step - loss: 19.6029 - val_loss: 19.4499
## 
## Epoch 00092: val_loss improved from 19.87437 to 19.44990, saving model to model_weights.hdf5
## Epoch 93/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 30.4569
578/578 [==============================] - 0s 26us/step - loss: 19.4721 - val_loss: 19.4980
## 
## Epoch 00093: val_loss did not improve from 19.44990
## Epoch 94/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 18.2113
578/578 [==============================] - 0s 24us/step - loss: 18.9719 - val_loss: 19.3966
## 
## Epoch 00094: val_loss improved from 19.44990 to 19.39658, saving model to model_weights.hdf5
## Epoch 95/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.0349
578/578 [==============================] - 0s 58us/step - loss: 18.6829 - val_loss: 18.9750
## 
## Epoch 00095: val_loss improved from 19.39658 to 18.97503, saving model to model_weights.hdf5
## Epoch 96/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 22.4614
578/578 [==============================] - 0s 58us/step - loss: 18.4213 - val_loss: 18.7113
## 
## Epoch 00096: val_loss improved from 18.97503 to 18.71128, saving model to model_weights.hdf5
## Epoch 97/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.0281
578/578 [==============================] - 0s 55us/step - loss: 18.1240 - val_loss: 18.4824
## 
## Epoch 00097: val_loss improved from 18.71128 to 18.48244, saving model to model_weights.hdf5
## Epoch 98/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 14.3478
578/578 [==============================] - 0s 55us/step - loss: 18.2411 - val_loss: 18.6293
## 
## Epoch 00098: val_loss did not improve from 18.48244
## Epoch 99/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 23.1161
578/578 [==============================] - 0s 54us/step - loss: 18.3320 - val_loss: 18.2723
## 
## Epoch 00099: val_loss improved from 18.48244 to 18.27227, saving model to model_weights.hdf5
## Epoch 100/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.0574
578/578 [==============================] - 0s 59us/step - loss: 17.6153 - val_loss: 18.3442
## 
## Epoch 00100: val_loss did not improve from 18.27227
## Epoch 101/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.2217
578/578 [==============================] - 0s 50us/step - loss: 17.4098 - val_loss: 18.0219
## 
## Epoch 00101: val_loss improved from 18.27227 to 18.02187, saving model to model_weights.hdf5
## Epoch 102/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.0663
578/578 [==============================] - 0s 56us/step - loss: 17.2640 - val_loss: 18.0063
## 
## Epoch 00102: val_loss improved from 18.02187 to 18.00627, saving model to model_weights.hdf5
## Epoch 103/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.3974
578/578 [==============================] - 0s 45us/step - loss: 17.0651 - val_loss: 18.3453
## 
## Epoch 00103: val_loss did not improve from 18.00627
## Epoch 104/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.0242
578/578 [==============================] - 0s 38us/step - loss: 16.9361 - val_loss: 17.7970
## 
## Epoch 00104: val_loss improved from 18.00627 to 17.79700, saving model to model_weights.hdf5
## Epoch 105/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.7366
578/578 [==============================] - 0s 64us/step - loss: 16.7273 - val_loss: 17.5832
## 
## Epoch 00105: val_loss improved from 17.79700 to 17.58322, saving model to model_weights.hdf5
## Epoch 106/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.8839
578/578 [==============================] - 0s 59us/step - loss: 16.6059 - val_loss: 17.7528
## 
## Epoch 00106: val_loss did not improve from 17.58322
## Epoch 107/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 20.7944
578/578 [==============================] - 0s 41us/step - loss: 16.4163 - val_loss: 17.5721
## 
## Epoch 00107: val_loss improved from 17.58322 to 17.57210, saving model to model_weights.hdf5
## Epoch 108/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 21.0114
578/578 [==============================] - 0s 22us/step - loss: 16.2871 - val_loss: 17.4151
## 
## Epoch 00108: val_loss improved from 17.57210 to 17.41505, saving model to model_weights.hdf5
## Epoch 109/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.8985
578/578 [==============================] - 0s 24us/step - loss: 16.0976 - val_loss: 17.2919
## 
## Epoch 00109: val_loss improved from 17.41505 to 17.29189, saving model to model_weights.hdf5
## Epoch 110/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 20.2419
578/578 [==============================] - 0s 57us/step - loss: 15.9581 - val_loss: 17.2395
## 
## Epoch 00110: val_loss improved from 17.29189 to 17.23947, saving model to model_weights.hdf5
## Epoch 111/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 22.4314
578/578 [==============================] - 0s 22us/step - loss: 15.8026 - val_loss: 17.2306
## 
## Epoch 00111: val_loss improved from 17.23947 to 17.23062, saving model to model_weights.hdf5
## Epoch 112/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 19.2781
578/578 [==============================] - 0s 57us/step - loss: 15.6209 - val_loss: 16.8756
## 
## Epoch 00112: val_loss improved from 17.23062 to 16.87562, saving model to model_weights.hdf5
## Epoch 113/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.8235
578/578 [==============================] - 0s 55us/step - loss: 15.5689 - val_loss: 16.7054
## 
## Epoch 00113: val_loss improved from 16.87562 to 16.70539, saving model to model_weights.hdf5
## Epoch 114/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.2264
578/578 [==============================] - 0s 98us/step - loss: 15.3340 - val_loss: 16.7838
## 
## Epoch 00114: val_loss did not improve from 16.70539
## Epoch 115/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.2061
578/578 [==============================] - 0s 33us/step - loss: 15.2075 - val_loss: 16.8028
## 
## Epoch 00115: val_loss did not improve from 16.70539
## Epoch 116/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 18.0148
578/578 [==============================] - 0s 24us/step - loss: 15.0730 - val_loss: 16.2511
## 
## Epoch 00116: val_loss improved from 16.70539 to 16.25108, saving model to model_weights.hdf5
## Epoch 117/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.5018
578/578 [==============================] - 0s 57us/step - loss: 15.1111 - val_loss: 16.4118
## 
## Epoch 00117: val_loss did not improve from 16.25108
## Epoch 118/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.8336
578/578 [==============================] - 0s 40us/step - loss: 14.8276 - val_loss: 15.6460
## 
## Epoch 00118: val_loss improved from 16.25108 to 15.64601, saving model to model_weights.hdf5
## Epoch 119/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.9931
578/578 [==============================] - 0s 38us/step - loss: 14.7147 - val_loss: 15.9892
## 
## Epoch 00119: val_loss did not improve from 15.64601
## Epoch 120/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.6864
578/578 [==============================] - 0s 28us/step - loss: 14.7265 - val_loss: 16.3296
## 
## Epoch 00120: val_loss did not improve from 15.64601
## Epoch 121/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.4952
578/578 [==============================] - 0s 26us/step - loss: 14.4768 - val_loss: 15.9200
## 
## Epoch 00121: val_loss did not improve from 15.64601
## Epoch 122/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.4030
578/578 [==============================] - 0s 28us/step - loss: 14.4212 - val_loss: 15.8232
## 
## Epoch 00122: val_loss did not improve from 15.64601
## Epoch 123/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 20.4413
578/578 [==============================] - 0s 26us/step - loss: 14.3623 - val_loss: 15.8369
## 
## Epoch 00123: val_loss did not improve from 15.64601
## Epoch 124/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 17.4531
578/578 [==============================] - 0s 28us/step - loss: 14.3997 - val_loss: 16.1404
## 
## Epoch 00124: val_loss did not improve from 15.64601
## Epoch 125/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.0473
578/578 [==============================] - 0s 26us/step - loss: 14.3116 - val_loss: 15.5858
## 
## Epoch 00125: val_loss improved from 15.64601 to 15.58579, saving model to model_weights.hdf5
## Epoch 126/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.8005
578/578 [==============================] - 0s 57us/step - loss: 14.0962 - val_loss: 15.9258
## 
## Epoch 00126: val_loss did not improve from 15.58579
## Epoch 127/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.8509
578/578 [==============================] - 0s 49us/step - loss: 13.9408 - val_loss: 15.7321
## 
## Epoch 00127: val_loss did not improve from 15.58579
## Epoch 128/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.3586
578/578 [==============================] - 0s 29us/step - loss: 14.0094 - val_loss: 14.9900
## 
## Epoch 00128: val_loss improved from 15.58579 to 14.98997, saving model to model_weights.hdf5
## Epoch 129/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 14.4913
578/578 [==============================] - 0s 55us/step - loss: 13.7009 - val_loss: 15.3474
## 
## Epoch 00129: val_loss did not improve from 14.98997
## Epoch 130/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 14.3043
578/578 [==============================] - 0s 45us/step - loss: 13.5597 - val_loss: 15.5082
## 
## Epoch 00130: val_loss did not improve from 14.98997
## Epoch 131/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.5827
578/578 [==============================] - 0s 24us/step - loss: 13.5769 - val_loss: 15.0546
## 
## Epoch 00131: val_loss did not improve from 14.98997
## Epoch 132/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.6747
578/578 [==============================] - 0s 24us/step - loss: 13.4913 - val_loss: 15.3591
## 
## Epoch 00132: val_loss did not improve from 14.98997
## Epoch 133/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.1737
578/578 [==============================] - 0s 28us/step - loss: 13.2754 - val_loss: 15.3023
## 
## Epoch 00133: val_loss did not improve from 14.98997
## Epoch 134/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.9575
578/578 [==============================] - 0s 28us/step - loss: 13.4315 - val_loss: 14.7182
## 
## Epoch 00134: val_loss improved from 14.98997 to 14.71824, saving model to model_weights.hdf5
## Epoch 135/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.6558
578/578 [==============================] - 0s 60us/step - loss: 13.0904 - val_loss: 14.8643
## 
## Epoch 00135: val_loss did not improve from 14.71824
## Epoch 136/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.8051
578/578 [==============================] - 0s 57us/step - loss: 13.1931 - val_loss: 14.6815
## 
## Epoch 00136: val_loss improved from 14.71824 to 14.68150, saving model to model_weights.hdf5
## Epoch 137/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.6090
578/578 [==============================] - 0s 57us/step - loss: 12.9415 - val_loss: 14.9301
## 
## Epoch 00137: val_loss did not improve from 14.68150
## Epoch 138/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.3520
578/578 [==============================] - 0s 55us/step - loss: 12.9082 - val_loss: 14.7374
## 
## Epoch 00138: val_loss did not improve from 14.68150
## Epoch 139/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.5228
578/578 [==============================] - 0s 43us/step - loss: 13.1504 - val_loss: 14.7763
## 
## Epoch 00139: val_loss did not improve from 14.68150
## Epoch 140/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 18.2848
578/578 [==============================] - 0s 41us/step - loss: 12.7187 - val_loss: 14.6994
## 
## Epoch 00140: val_loss did not improve from 14.68150
## Epoch 141/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.5938
578/578 [==============================] - 0s 43us/step - loss: 12.5481 - val_loss: 14.2836
## 
## Epoch 00141: val_loss improved from 14.68150 to 14.28364, saving model to model_weights.hdf5
## Epoch 142/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.5544
578/578 [==============================] - 0s 55us/step - loss: 12.5336 - val_loss: 14.4467
## 
## Epoch 00142: val_loss did not improve from 14.28364
## Epoch 143/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.1182
578/578 [==============================] - 0s 57us/step - loss: 12.5320 - val_loss: 14.0701
## 
## Epoch 00143: val_loss improved from 14.28364 to 14.07010, saving model to model_weights.hdf5
## Epoch 144/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.8860
578/578 [==============================] - 0s 60us/step - loss: 12.4031 - val_loss: 14.6770
## 
## Epoch 00144: val_loss did not improve from 14.07010
## Epoch 145/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.9821
578/578 [==============================] - 0s 57us/step - loss: 12.3993 - val_loss: 14.3823
## 
## Epoch 00145: val_loss did not improve from 14.07010
## Epoch 146/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.0915
578/578 [==============================] - 0s 35us/step - loss: 12.2966 - val_loss: 13.7651
## 
## Epoch 00146: val_loss improved from 14.07010 to 13.76512, saving model to model_weights.hdf5
## Epoch 147/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.1116
578/578 [==============================] - 0s 57us/step - loss: 12.1886 - val_loss: 14.1838
## 
## Epoch 00147: val_loss did not improve from 13.76512
## Epoch 148/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.4180
578/578 [==============================] - 0s 55us/step - loss: 12.0700 - val_loss: 13.7207
## 
## Epoch 00148: val_loss improved from 13.76512 to 13.72068, saving model to model_weights.hdf5
## Epoch 149/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.3011
578/578 [==============================] - 0s 55us/step - loss: 11.9887 - val_loss: 13.3494
## 
## Epoch 00149: val_loss improved from 13.72068 to 13.34940, saving model to model_weights.hdf5
## Epoch 150/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.1082
578/578 [==============================] - 0s 57us/step - loss: 11.8251 - val_loss: 13.8962
## 
## Epoch 00150: val_loss did not improve from 13.34940
## Epoch 151/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.3416
578/578 [==============================] - 0s 59us/step - loss: 11.7814 - val_loss: 13.9335
## 
## Epoch 00151: val_loss did not improve from 13.34940
## Epoch 152/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.2860
578/578 [==============================] - 0s 55us/step - loss: 11.7799 - val_loss: 13.3515
## 
## Epoch 00152: val_loss did not improve from 13.34940
## Epoch 153/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.6244
578/578 [==============================] - 0s 55us/step - loss: 11.6819 - val_loss: 13.8380
## 
## Epoch 00153: val_loss did not improve from 13.34940
## Epoch 154/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.3906
578/578 [==============================] - 0s 55us/step - loss: 11.5615 - val_loss: 13.5826
## 
## Epoch 00154: val_loss did not improve from 13.34940
## Epoch 155/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.2101
578/578 [==============================] - 0s 56us/step - loss: 11.4597 - val_loss: 13.9217
## 
## Epoch 00155: val_loss did not improve from 13.34940
## Epoch 156/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.2305
578/578 [==============================] - 0s 57us/step - loss: 11.5454 - val_loss: 13.2522
## 
## Epoch 00156: val_loss improved from 13.34940 to 13.25218, saving model to model_weights.hdf5
## Epoch 157/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.6810
578/578 [==============================] - 0s 24us/step - loss: 11.6355 - val_loss: 13.1105
## 
## Epoch 00157: val_loss improved from 13.25218 to 13.11047, saving model to model_weights.hdf5
## Epoch 158/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.7820
578/578 [==============================] - 0s 22us/step - loss: 11.4413 - val_loss: 13.0204
## 
## Epoch 00158: val_loss improved from 13.11047 to 13.02037, saving model to model_weights.hdf5
## Epoch 159/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.4440
578/578 [==============================] - 0s 48us/step - loss: 11.3885 - val_loss: 13.8407
## 
## Epoch 00159: val_loss did not improve from 13.02037
## Epoch 160/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.8245
578/578 [==============================] - 0s 28us/step - loss: 11.3051 - val_loss: 13.4290
## 
## Epoch 00160: val_loss did not improve from 13.02037
## Epoch 161/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.3673
578/578 [==============================] - 0s 27us/step - loss: 11.1848 - val_loss: 13.0545
## 
## Epoch 00161: val_loss did not improve from 13.02037
## Epoch 162/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.3869
578/578 [==============================] - 0s 26us/step - loss: 11.0061 - val_loss: 13.2217
## 
## Epoch 00162: val_loss did not improve from 13.02037
## Epoch 163/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.1840
578/578 [==============================] - 0s 26us/step - loss: 11.0362 - val_loss: 13.1325
## 
## Epoch 00163: val_loss did not improve from 13.02037
## Epoch 164/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.3193
578/578 [==============================] - 0s 23us/step - loss: 11.0084 - val_loss: 12.4500
## 
## Epoch 00164: val_loss improved from 13.02037 to 12.44998, saving model to model_weights.hdf5
## Epoch 165/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.2620
578/578 [==============================] - 0s 57us/step - loss: 11.1419 - val_loss: 12.8976
## 
## Epoch 00165: val_loss did not improve from 12.44998
## Epoch 166/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 15.0354
578/578 [==============================] - 0s 57us/step - loss: 10.9133 - val_loss: 12.3238
## 
## Epoch 00166: val_loss improved from 12.44998 to 12.32379, saving model to model_weights.hdf5
## Epoch 167/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.4692
578/578 [==============================] - 0s 57us/step - loss: 10.7886 - val_loss: 12.8735
## 
## Epoch 00167: val_loss did not improve from 12.32379
## Epoch 168/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.5530
578/578 [==============================] - 0s 59us/step - loss: 10.8263 - val_loss: 12.9578
## 
## Epoch 00168: val_loss did not improve from 12.32379
## Epoch 169/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.3580
578/578 [==============================] - 0s 60us/step - loss: 10.7060 - val_loss: 12.6348
## 
## Epoch 00169: val_loss did not improve from 12.32379
## Epoch 170/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.3136
578/578 [==============================] - 0s 57us/step - loss: 10.6348 - val_loss: 12.7382
## 
## Epoch 00170: val_loss did not improve from 12.32379
## Epoch 171/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.5226
578/578 [==============================] - 0s 57us/step - loss: 10.6358 - val_loss: 12.3663
## 
## Epoch 00171: val_loss did not improve from 12.32379
## Epoch 172/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 16.0774
578/578 [==============================] - 0s 56us/step - loss: 10.6311 - val_loss: 12.8221
## 
## Epoch 00172: val_loss did not improve from 12.32379
## Epoch 173/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.0721
578/578 [==============================] - 0s 55us/step - loss: 10.5246 - val_loss: 12.5345
## 
## Epoch 00173: val_loss did not improve from 12.32379
## Epoch 174/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.1418
578/578 [==============================] - 0s 55us/step - loss: 10.4757 - val_loss: 12.2225
## 
## Epoch 00174: val_loss improved from 12.32379 to 12.22250, saving model to model_weights.hdf5
## Epoch 175/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.0368
578/578 [==============================] - 0s 55us/step - loss: 10.6146 - val_loss: 12.5459
## 
## Epoch 00175: val_loss did not improve from 12.22250
## Epoch 176/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 14.7872
578/578 [==============================] - 0s 57us/step - loss: 10.4345 - val_loss: 12.8947
## 
## Epoch 00176: val_loss did not improve from 12.22250
## Epoch 177/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 14.3928
578/578 [==============================] - 0s 56us/step - loss: 10.3598 - val_loss: 12.4290
## 
## Epoch 00177: val_loss did not improve from 12.22250
## Epoch 178/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.8223
578/578 [==============================] - 0s 57us/step - loss: 10.3065 - val_loss: 12.2393
## 
## Epoch 00178: val_loss did not improve from 12.22250
## Epoch 179/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.1965
578/578 [==============================] - 0s 55us/step - loss: 10.4838 - val_loss: 12.0120
## 
## Epoch 00179: val_loss improved from 12.22250 to 12.01201, saving model to model_weights.hdf5
## Epoch 180/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.3284
578/578 [==============================] - 0s 55us/step - loss: 10.3884 - val_loss: 12.5449
## 
## Epoch 00180: val_loss did not improve from 12.01201
## Epoch 181/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 14.3119
578/578 [==============================] - 0s 56us/step - loss: 10.2690 - val_loss: 12.1963
## 
## Epoch 00181: val_loss did not improve from 12.01201
## Epoch 182/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.1196
578/578 [==============================] - 0s 57us/step - loss: 10.2265 - val_loss: 12.2345
## 
## Epoch 00182: val_loss did not improve from 12.01201
## Epoch 183/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.2192
578/578 [==============================] - 0s 57us/step - loss: 10.2305 - val_loss: 11.9154
## 
## Epoch 00183: val_loss improved from 12.01201 to 11.91537, saving model to model_weights.hdf5
## Epoch 184/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 5.6699
578/578 [==============================] - 0s 57us/step - loss: 10.1530 - val_loss: 11.8941
## 
## Epoch 00184: val_loss improved from 11.91537 to 11.89406, saving model to model_weights.hdf5
## Epoch 185/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 13.4273
578/578 [==============================] - 0s 72us/step - loss: 10.4942 - val_loss: 12.9117
## 
## Epoch 00185: val_loss did not improve from 11.89406
## Epoch 186/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.8833
578/578 [==============================] - 0s 73us/step - loss: 9.8989 - val_loss: 11.7595
## 
## Epoch 00186: val_loss improved from 11.89406 to 11.75948, saving model to model_weights.hdf5
## Epoch 187/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.8660
578/578 [==============================] - 0s 74us/step - loss: 10.0852 - val_loss: 12.4090
## 
## Epoch 00187: val_loss did not improve from 11.75948
## Epoch 188/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.2937
578/578 [==============================] - 0s 76us/step - loss: 9.9429 - val_loss: 11.7629
## 
## Epoch 00188: val_loss did not improve from 11.75948
## Epoch 189/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.8055
578/578 [==============================] - 0s 72us/step - loss: 9.9271 - val_loss: 11.8058
## 
## Epoch 00189: val_loss did not improve from 11.75948
## Epoch 190/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.1277
578/578 [==============================] - 0s 79us/step - loss: 9.8455 - val_loss: 12.1372
## 
## Epoch 00190: val_loss did not improve from 11.75948
## Epoch 191/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.7136
578/578 [==============================] - 0s 76us/step - loss: 9.7988 - val_loss: 11.7457
## 
## Epoch 00191: val_loss improved from 11.75948 to 11.74566, saving model to model_weights.hdf5
## Epoch 192/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.5152
578/578 [==============================] - 0s 73us/step - loss: 9.7070 - val_loss: 11.8056
## 
## Epoch 00192: val_loss did not improve from 11.74566
## Epoch 193/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 5.9690
578/578 [==============================] - 0s 73us/step - loss: 9.8162 - val_loss: 11.7072
## 
## Epoch 00193: val_loss improved from 11.74566 to 11.70716, saving model to model_weights.hdf5
## Epoch 194/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.9044
578/578 [==============================] - 0s 24us/step - loss: 9.6277 - val_loss: 11.9253
## 
## Epoch 00194: val_loss did not improve from 11.70716
## Epoch 195/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.3334
578/578 [==============================] - 0s 24us/step - loss: 9.6958 - val_loss: 11.5759
## 
## Epoch 00195: val_loss improved from 11.70716 to 11.57586, saving model to model_weights.hdf5
## Epoch 196/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.7360
578/578 [==============================] - 0s 55us/step - loss: 9.5985 - val_loss: 11.4986
## 
## Epoch 00196: val_loss improved from 11.57586 to 11.49860, saving model to model_weights.hdf5
## Epoch 197/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.4573
578/578 [==============================] - 0s 55us/step - loss: 9.6868 - val_loss: 12.3451
## 
## Epoch 00197: val_loss did not improve from 11.49860
## Epoch 198/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.6766
578/578 [==============================] - 0s 53us/step - loss: 9.5569 - val_loss: 11.8250
## 
## Epoch 00198: val_loss did not improve from 11.49860
## Epoch 199/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.7617
578/578 [==============================] - 0s 43us/step - loss: 9.4745 - val_loss: 11.5215
## 
## Epoch 00199: val_loss did not improve from 11.49860
## Epoch 200/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.8089
578/578 [==============================] - 0s 43us/step - loss: 9.5083 - val_loss: 11.6276
## 
## Epoch 00200: val_loss did not improve from 11.49860
## Epoch 201/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.2578
578/578 [==============================] - 0s 43us/step - loss: 9.5629 - val_loss: 11.7490
## 
## Epoch 00201: val_loss did not improve from 11.49860
## Epoch 202/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 6.9074
578/578 [==============================] - 0s 43us/step - loss: 9.5755 - val_loss: 11.6286
## 
## Epoch 00202: val_loss did not improve from 11.49860
## Epoch 203/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 5.9227
578/578 [==============================] - 0s 45us/step - loss: 9.4217 - val_loss: 11.4999
## 
## Epoch 00203: val_loss did not improve from 11.49860
## Epoch 204/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.3612
578/578 [==============================] - 0s 45us/step - loss: 9.3843 - val_loss: 11.2918
## 
## Epoch 00204: val_loss improved from 11.49860 to 11.29184, saving model to model_weights.hdf5
## Epoch 205/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 5.9032
578/578 [==============================] - 0s 57us/step - loss: 9.7682 - val_loss: 11.5572
## 
## Epoch 00205: val_loss did not improve from 11.29184
## Epoch 206/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.4694
578/578 [==============================] - 0s 56us/step - loss: 9.3777 - val_loss: 11.1418
## 
## Epoch 00206: val_loss improved from 11.29184 to 11.14177, saving model to model_weights.hdf5
## Epoch 207/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.4983
578/578 [==============================] - 0s 57us/step - loss: 9.3037 - val_loss: 11.3437
## 
## Epoch 00207: val_loss did not improve from 11.14177
## Epoch 208/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.1472
578/578 [==============================] - 0s 60us/step - loss: 9.1940 - val_loss: 11.3968
## 
## Epoch 00208: val_loss did not improve from 11.14177
## Epoch 209/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.2436
578/578 [==============================] - 0s 57us/step - loss: 9.2744 - val_loss: 11.2327
## 
## Epoch 00209: val_loss did not improve from 11.14177
## Epoch 210/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.4014
578/578 [==============================] - 0s 57us/step - loss: 9.2639 - val_loss: 11.5338
## 
## Epoch 00210: val_loss did not improve from 11.14177
## Epoch 211/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.8410
578/578 [==============================] - 0s 55us/step - loss: 9.2916 - val_loss: 11.0609
## 
## Epoch 00211: val_loss improved from 11.14177 to 11.06094, saving model to model_weights.hdf5
## Epoch 212/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.7301
578/578 [==============================] - 0s 55us/step - loss: 9.2856 - val_loss: 11.4195
## 
## Epoch 00212: val_loss did not improve from 11.06094
## Epoch 213/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.0738
578/578 [==============================] - 0s 57us/step - loss: 9.1601 - val_loss: 11.1372
## 
## Epoch 00213: val_loss did not improve from 11.06094
## Epoch 214/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 6.0513
578/578 [==============================] - 0s 57us/step - loss: 9.4869 - val_loss: 11.9581
## 
## Epoch 00214: val_loss did not improve from 11.06094
## Epoch 215/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.3473
578/578 [==============================] - 0s 56us/step - loss: 9.1191 - val_loss: 11.8057
## 
## Epoch 00215: val_loss did not improve from 11.06094
## Epoch 216/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.7104
578/578 [==============================] - 0s 57us/step - loss: 9.3333 - val_loss: 11.0456
## 
## Epoch 00216: val_loss improved from 11.06094 to 11.04557, saving model to model_weights.hdf5
## Epoch 217/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.5955
578/578 [==============================] - 0s 24us/step - loss: 9.3356 - val_loss: 11.2635
## 
## Epoch 00217: val_loss did not improve from 11.04557
## Epoch 218/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.0896
578/578 [==============================] - 0s 26us/step - loss: 9.0516 - val_loss: 11.4276
## 
## Epoch 00218: val_loss did not improve from 11.04557
## Epoch 219/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.2483
578/578 [==============================] - 0s 26us/step - loss: 8.9593 - val_loss: 11.2120
## 
## Epoch 00219: val_loss did not improve from 11.04557
## Epoch 220/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 6.0380
578/578 [==============================] - 0s 24us/step - loss: 8.8759 - val_loss: 11.0598
## 
## Epoch 00220: val_loss did not improve from 11.04557
## Epoch 221/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.9986
578/578 [==============================] - 0s 26us/step - loss: 8.8541 - val_loss: 11.0101
## 
## Epoch 00221: val_loss improved from 11.04557 to 11.01006, saving model to model_weights.hdf5
## Epoch 222/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.1188
578/578 [==============================] - 0s 57us/step - loss: 8.8676 - val_loss: 11.2074
## 
## Epoch 00222: val_loss did not improve from 11.01006
## Epoch 223/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.8844
578/578 [==============================] - 0s 59us/step - loss: 9.0388 - val_loss: 11.6705
## 
## Epoch 00223: val_loss did not improve from 11.01006
## Epoch 224/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.0809
578/578 [==============================] - 0s 56us/step - loss: 8.9977 - val_loss: 11.2987
## 
## Epoch 00224: val_loss did not improve from 11.01006
## Epoch 225/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.2608
578/578 [==============================] - 0s 56us/step - loss: 8.7712 - val_loss: 10.9828
## 
## Epoch 00225: val_loss improved from 11.01006 to 10.98279, saving model to model_weights.hdf5
## Epoch 226/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.6412
578/578 [==============================] - 0s 57us/step - loss: 9.2621 - val_loss: 11.9423
## 
## Epoch 00226: val_loss did not improve from 10.98279
## Epoch 227/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.5259
578/578 [==============================] - 0s 55us/step - loss: 8.9364 - val_loss: 10.8155
## 
## Epoch 00227: val_loss improved from 10.98279 to 10.81553, saving model to model_weights.hdf5
## Epoch 228/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.8405
578/578 [==============================] - 0s 57us/step - loss: 8.8501 - val_loss: 10.9562
## 
## Epoch 00228: val_loss did not improve from 10.81553
## Epoch 229/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.6594
578/578 [==============================] - 0s 57us/step - loss: 8.6861 - val_loss: 10.9295
## 
## Epoch 00229: val_loss did not improve from 10.81553
## Epoch 230/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 9.4091
578/578 [==============================] - 0s 55us/step - loss: 8.8936 - val_loss: 10.8352
## 
## Epoch 00230: val_loss did not improve from 10.81553
## Epoch 231/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.0552
578/578 [==============================] - 0s 57us/step - loss: 8.8826 - val_loss: 11.0695
## 
## Epoch 00231: val_loss did not improve from 10.81553
## Epoch 232/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 6.9049
578/578 [==============================] - 0s 55us/step - loss: 8.7829 - val_loss: 11.0865
## 
## Epoch 00232: val_loss did not improve from 10.81553
## Epoch 233/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.6607
578/578 [==============================] - 0s 62us/step - loss: 8.5663 - val_loss: 11.2369
## 
## Epoch 00233: val_loss did not improve from 10.81553
## Epoch 234/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.5589
578/578 [==============================] - 0s 59us/step - loss: 8.5603 - val_loss: 10.9191
## 
## Epoch 00234: val_loss did not improve from 10.81553
## Epoch 235/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.0081
578/578 [==============================] - 0s 55us/step - loss: 8.8345 - val_loss: 10.9773
## 
## Epoch 00235: val_loss did not improve from 10.81553
## Epoch 236/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 6.1617
578/578 [==============================] - 0s 57us/step - loss: 8.5899 - val_loss: 10.9432
## 
## Epoch 00236: val_loss did not improve from 10.81553
## Epoch 237/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.8100
578/578 [==============================] - 0s 55us/step - loss: 8.4856 - val_loss: 10.8887
## 
## Epoch 00237: val_loss did not improve from 10.81553
## Epoch 238/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.2116
578/578 [==============================] - 0s 57us/step - loss: 8.6331 - val_loss: 10.9872
## 
## Epoch 00238: val_loss did not improve from 10.81553
## Epoch 239/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.5180
578/578 [==============================] - 0s 55us/step - loss: 8.6490 - val_loss: 11.0430
## 
## Epoch 00239: val_loss did not improve from 10.81553
## Epoch 240/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.3062
578/578 [==============================] - 0s 55us/step - loss: 8.7840 - val_loss: 10.8976
## 
## Epoch 00240: val_loss did not improve from 10.81553
## Epoch 241/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.7639
578/578 [==============================] - 0s 59us/step - loss: 8.7323 - val_loss: 10.7219
## 
## Epoch 00241: val_loss improved from 10.81553 to 10.72190, saving model to model_weights.hdf5
## Epoch 242/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.4872
578/578 [==============================] - 0s 28us/step - loss: 8.5796 - val_loss: 10.8838
## 
## Epoch 00242: val_loss did not improve from 10.72190
## Epoch 243/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.5761
578/578 [==============================] - 0s 24us/step - loss: 8.4777 - val_loss: 10.8922
## 
## Epoch 00243: val_loss did not improve from 10.72190
## Epoch 244/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 7.3435
578/578 [==============================] - 0s 26us/step - loss: 8.6925 - val_loss: 11.0007
## 
## Epoch 00244: val_loss did not improve from 10.72190
## Epoch 245/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.8024
578/578 [==============================] - 0s 24us/step - loss: 8.4824 - val_loss: 11.1589
## 
## Epoch 00245: val_loss did not improve from 10.72190
## Epoch 246/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 10.9286
578/578 [==============================] - 0s 26us/step - loss: 8.6880 - val_loss: 11.2992
## 
## Epoch 00246: val_loss did not improve from 10.72190
## Epoch 247/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 12.6816
578/578 [==============================] - 0s 22us/step - loss: 8.5481 - val_loss: 11.0087
## 
## Epoch 00247: val_loss did not improve from 10.72190
## Epoch 248/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.1091
578/578 [==============================] - 0s 22us/step - loss: 8.6053 - val_loss: 10.9355
## 
## Epoch 00248: val_loss did not improve from 10.72190
## Epoch 249/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 8.6390
578/578 [==============================] - 0s 26us/step - loss: 8.4366 - val_loss: 11.2190
## 
## Epoch 00249: val_loss did not improve from 10.72190
## Epoch 250/250
## 
 32/578 [>.............................] - ETA: 0s - loss: 11.6189
578/578 [==============================] - 0s 21us/step - loss: 8.3640 - val_loss: 11.0127
## 
## Epoch 00250: val_loss did not improve from 10.72190

Load in the most recent, best model

model.load_weights('model_weights.hdf5')
# Re-Compile model
model.compile(loss='mean_squared_error', optimizer='adam')
# Re-Fit model but use training/testing datasets
model.fit(X_train, y_train, validation_split=0.33, epochs=250, callbacks=[EarlyStopping(patience=3)], verbose=True)
## Train on 387 samples, validate on 191 samples
## Epoch 1/250
## 
 32/387 [=>............................] - ETA: 1s - loss: 10.3369
387/387 [==============================] - 0s 441us/step - loss: 9.8772 - val_loss: 9.3116
## Epoch 2/250
## 
 32/387 [=>............................] - ETA: 0s - loss: 8.9084
387/387 [==============================] - 0s 23us/step - loss: 9.4733 - val_loss: 9.7138
## Epoch 3/250
## 
 32/387 [=>............................] - ETA: 0s - loss: 8.9404
387/387 [==============================] - 0s 23us/step - loss: 9.3797 - val_loss: 9.6481
## Epoch 4/250
## 
 32/387 [=>............................] - ETA: 0s - loss: 10.8136
387/387 [==============================] - 0s 23us/step - loss: 9.5070 - val_loss: 9.7532

Get predictions

predictions = model.predict(X_test)[:,0]

Get scatterplot of actual vs. predicted values

plt.scatter(y_test, predictions)
# Add a trendline
z = np.polyfit(y_test, predictions, 1)
p = np.poly1d(z)
plt.plot(y_test, p(y_test), 'r--')
# Add labels
plt.xlabel('Y Test (True Values)')
plt.ylabel('Predicted Values')
plt.title('Predicted vs. Actual Values (r = {0:0.2f})'.format(pearsonr(y_test, predictions)[0], 2))
plt.savefig('Neural_Net_Reg_Resid')
plt.show()

plt.clf()

Print interpretation of the pearson r

if pearsonr(y_test, predictions)[0] == 1.00:
    print('There is a perfect positive linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] >= 0.8:
    print('There is a very strong, positive linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] >= 0.6:
    print('There is a strong, positive linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] >= 0.4:
    print('There is a moderate, positive linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] >= 0.2:
    print('There is a weak, positive linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] > 0:
    print('There is a very weak, positive linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] == 0:
    print('There is no linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] <= -0.8:
    print('There is a very strong, negative linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] <= -0.6:
    print('There is a strong, negative linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] <= -0.4:
    print('There is a moderate, negative linear relationship between the predicted and actual values.')
elif pearsonr(y_test, predictions)[0] <= -0.2:
    print('There is a weak, negative linear relationship between the predicted and actual values.')
else: # <= 0 and pearsonr(y_test, predictions)[0] > -0.2
    print('There is a very weak, negative linear relationship between the predicted and actual values.')
## There is a very strong, positive linear relationship between the predicted and actual values.

Print regression metrics

# make metrics into a dataframe
metrics_df = pd.DataFrame({'Metric': ['MAE', 
                                      'MSE', 
                                      'RMSE', 
                                      'R-Squared'],
                          'Value': [metrics.mean_absolute_error(y_test, predictions),
                                    metrics.mean_squared_error(y_test, predictions),
                                    np.sqrt(metrics.mean_squared_error(y_test, predictions)),
                                    metrics.explained_variance_score(y_test, predictions)]}).round(3)
print(metrics_df)
##       Metric  Value
## 0        MAE  2.355
## 1        MSE  8.736
## 2       RMSE  2.956
## 3  R-Squared  0.948

Plot histogram of residuals (we want them to be normally distributed)

sns.distplot((y_test - predictions), bins = 50)
## C:\Users\aengland\AppData\Local\CONTIN~1\ANACON~1\lib\site-packages\matplotlib\axes\_axes.py:6499: MatplotlibDeprecationWarning: 
## The 'normed' kwarg was deprecated in Matplotlib 2.1 and will be removed in 3.1. Use 'density' instead.
##   alternative="'density'", removal="3.1")
plt.xlabel(DV)
plt.ylabel('Density')
plt.title('Histogram of Residuals')
plt.savefig('Neural_Net_Reg_Resid_Hist')
plt.show()

plt.clf()

Check residuals for normality

shapiro_df = pd.DataFrame({'Metric': ['Shapiro W',
                                      'p-value'],
                            'Value': [shapiro(y_test - predictions)[0],
                                      shapiro(y_test - predictions)[1]]}).round(3)
print(shapiro_df)
##       Metric  Value
## 0  Shapiro W  0.995
## 1    p-value  0.548

Print the interpretation of the test

if shapiro(y_test - predictions)[1] > 0.05:
    print('Fail to reject the null hypothesis. Data is normally distributed.')
else:
    print('Null hypothesis is rejected. Data is not normally distributed.')
## Fail to reject the null hypothesis. Data is normally distributed.