Linear regression in keras


In [1]:
# Neural networks.
import tensorflow.keras as kr

# Numerical arrays
import numpy as np

# Data frames.
import pandas as pd

# Plotting
import matplotlib.pyplot as plt
In [2]:
# Plot style.
plt.style.use("ggplot")

# Plot size.
plt.rcParams['figure.figsize'] = [14, 8]


Fake data


In [3]:
# Simple linear equation.
f = lambda x: 3.0 * x + 1.0
In [4]:
# Create a training data frame with x and y values.
# The x values are randomly selected between 0 and 100.
# y_i is f(x_i)
train = pd.DataFrame()
train['x'] = np.random.uniform(0.0, 100.0, 1000)
train['y'] = f(train['x'])
train
Out[4]:
x y
0 63.925274 192.775821
1 77.057183 232.171549
2 95.969283 288.907849
3 69.007637 208.022910
4 12.036166 37.108498
... ... ...
995 34.581240 104.743721
996 69.168340 208.505020
997 75.001217 226.003652
998 46.011516 139.034549
999 91.853991 276.561974

1000 rows × 2 columns

In [5]:
# Create a corresponding test data frame.
# It might be better to create one big data frame and randomly select test cases.
test = pd.DataFrame()
test['x'] = np.random.uniform(0.0, 100.0, 100)
test['y'] = f(test['x'])
test
Out[5]:
x y
0 63.228103 190.684310
1 60.308378 181.925134
2 2.382016 8.146048
3 27.513951 83.541853
4 23.491201 71.473602
... ... ...
95 58.676870 177.030610
96 70.715696 213.147089
97 4.995021 15.985064
98 88.160448 265.481343
99 97.139237 292.417710

100 rows × 2 columns

In [6]:
# Create a neural network with one neuron.
model = kr.models.Sequential()
model.add(kr.layers.Dense(1, input_shape=(1,), activation="linear", kernel_initializer='ones', bias_initializer='zeros'))
model.compile('adam', loss='mean_squared_error')
In [7]:
# Train the neural network on our training data.
model.fit(train['x'], train['y'], epochs=500)
Epoch 1/500
32/32 [==============================] - 0s 820us/step - loss: 13606.5928
Epoch 2/500
32/32 [==============================] - 0s 705us/step - loss: 13176.3330
Epoch 3/500
32/32 [==============================] - 0s 969us/step - loss: 12757.7588
Epoch 4/500
32/32 [==============================] - 0s 750us/step - loss: 12347.5596
Epoch 5/500
32/32 [==============================] - 0s 687us/step - loss: 11945.8857
Epoch 6/500
32/32 [==============================] - 0s 780us/step - loss: 11553.2227
Epoch 7/500
32/32 [==============================] - 0s 812us/step - loss: 11171.2207
Epoch 8/500
32/32 [==============================] - 0s 750us/step - loss: 10802.5283
Epoch 9/500
32/32 [==============================] - 0s 906us/step - loss: 10442.4248
Epoch 10/500
32/32 [==============================] - 0s 813us/step - loss: 10087.4082
Epoch 11/500
32/32 [==============================] - 0s 625us/step - loss: 9742.6992
Epoch 12/500
32/32 [==============================] - 0s 750us/step - loss: 9405.4463
Epoch 13/500
32/32 [==============================] - 0s 812us/step - loss: 9077.2822
Epoch 14/500
32/32 [==============================] - 0s 844us/step - loss: 8763.9199
Epoch 15/500
32/32 [==============================] - 0s 812us/step - loss: 8452.5645
Epoch 16/500
32/32 [==============================] - 0s 594us/step - loss: 8153.3838
Epoch 17/500
32/32 [==============================] - 0s 625us/step - loss: 7861.3145
Epoch 18/500
32/32 [==============================] - 0s 750us/step - loss: 7574.0371
Epoch 19/500
32/32 [==============================] - 0s 875us/step - loss: 7295.1133
Epoch 20/500
32/32 [==============================] - 0s 781us/step - loss: 7023.2500
Epoch 21/500
32/32 [==============================] - 0s 531us/step - loss: 6758.1211
Epoch 22/500
32/32 [==============================] - 0s 874us/step - loss: 6500.2075
Epoch 23/500
32/32 [==============================] - 0s 656us/step - loss: 6250.2930
Epoch 24/500
32/32 [==============================] - 0s 812us/step - loss: 6009.8809
Epoch 25/500
32/32 [==============================] - 0s 844us/step - loss: 5771.4531
Epoch 26/500
32/32 [==============================] - 0s 656us/step - loss: 5543.4712
Epoch 27/500
32/32 [==============================] - 0s 733us/step - loss: 5322.6118
Epoch 28/500
32/32 [==============================] - 0s 727us/step - loss: 5109.7900
Epoch 29/500
32/32 [==============================] - 0s 629us/step - loss: 4902.8384
Epoch 30/500
32/32 [==============================] - 0s 625us/step - loss: 4702.5562
Epoch 31/500
32/32 [==============================] - 0s 938us/step - loss: 4506.9917
Epoch 32/500
32/32 [==============================] - 0s 750us/step - loss: 4318.8687
Epoch 33/500
32/32 [==============================] - 0s 562us/step - loss: 4136.9785
Epoch 34/500
32/32 [==============================] - 0s 812us/step - loss: 3960.7568
Epoch 35/500
32/32 [==============================] - 0s 844us/step - loss: 3790.7119
Epoch 36/500
32/32 [==============================] - 0s 781us/step - loss: 3624.5649
Epoch 37/500
32/32 [==============================] - 0s 830us/step - loss: 3464.1611
Epoch 38/500
32/32 [==============================] - 0s 569us/step - loss: 3308.4121
Epoch 39/500
32/32 [==============================] - 0s 750us/step - loss: 3158.0496
Epoch 40/500
32/32 [==============================] - 0s 781us/step - loss: 3013.1057
Epoch 41/500
32/32 [==============================] - 0s 812us/step - loss: 2873.8547
Epoch 42/500
32/32 [==============================] - 0s 531us/step - loss: 2739.9529
Epoch 43/500
32/32 [==============================] - 0s 693us/step - loss: 2609.1807
Epoch 44/500
32/32 [==============================] - 0s 719us/step - loss: 2483.4211
Epoch 45/500
32/32 [==============================] - 0s 656us/step - loss: 2362.6650
Epoch 46/500
32/32 [==============================] - 0s 657us/step - loss: 2246.5493
Epoch 47/500
32/32 [==============================] - 0s 567us/step - loss: 2134.0391
Epoch 48/500
32/32 [==============================] - 0s 719us/step - loss: 2025.5645
Epoch 49/500
32/32 [==============================] - 0s 537us/step - loss: 1921.4313
Epoch 50/500
32/32 [==============================] - 0s 562us/step - loss: 1822.3723
Epoch 51/500
32/32 [==============================] - 0s 749us/step - loss: 1727.2219
Epoch 52/500
32/32 [==============================] - 0s 750us/step - loss: 1636.3796
Epoch 53/500
32/32 [==============================] - 0s 731us/step - loss: 1548.6870
Epoch 54/500
32/32 [==============================] - 0s 476us/step - loss: 1464.7256
Epoch 55/500
32/32 [==============================] - 0s 656us/step - loss: 1383.3767
Epoch 56/500
32/32 [==============================] - 0s 469us/step - loss: 1307.1238
Epoch 57/500
32/32 [==============================] - 0s 438us/step - loss: 1232.9280
Epoch 58/500
32/32 [==============================] - 0s 469us/step - loss: 1163.1913
Epoch 59/500
32/32 [==============================] - 0s 357us/step - loss: 1095.3872
Epoch 60/500
32/32 [==============================] - 0s 469us/step - loss: 1031.0148
Epoch 61/500
32/32 [==============================] - 0s 375us/step - loss: 969.5814
Epoch 62/500
32/32 [==============================] - 0s 437us/step - loss: 910.8053
Epoch 63/500
32/32 [==============================] - 0s 407us/step - loss: 855.3129
Epoch 64/500
32/32 [==============================] - 0s 406us/step - loss: 801.6044
Epoch 65/500
32/32 [==============================] - 0s 416us/step - loss: 750.7576
Epoch 66/500
32/32 [==============================] - 0s 438us/step - loss: 702.9398
Epoch 67/500
32/32 [==============================] - 0s 375us/step - loss: 657.4185
Epoch 68/500
32/32 [==============================] - 0s 531us/step - loss: 614.0952
Epoch 69/500
32/32 [==============================] - 0s 687us/step - loss: 573.4281
Epoch 70/500
32/32 [==============================] - 0s 751us/step - loss: 534.5942
Epoch 71/500
32/32 [==============================] - 0s 625us/step - loss: 498.1048
Epoch 72/500
32/32 [==============================] - 0s 813us/step - loss: 463.5674
Epoch 73/500
32/32 [==============================] - 0s 722us/step - loss: 430.5838
Epoch 74/500
32/32 [==============================] - 0s 656us/step - loss: 399.7240
Epoch 75/500
32/32 [==============================] - 0s 608us/step - loss: 371.1237
Epoch 76/500
32/32 [==============================] - 0s 656us/step - loss: 343.9619
Epoch 77/500
32/32 [==============================] - 0s 625us/step - loss: 318.4699
Epoch 78/500
32/32 [==============================] - 0s 719us/step - loss: 294.6409
Epoch 79/500
32/32 [==============================] - 0s 692us/step - loss: 271.7671
Epoch 80/500
32/32 [==============================] - 0s 409us/step - loss: 250.6640
Epoch 81/500
32/32 [==============================] - 0s 500us/step - loss: 230.9724
Epoch 82/500
32/32 [==============================] - 0s 562us/step - loss: 212.2956
Epoch 83/500
32/32 [==============================] - 0s 500us/step - loss: 194.7590
Epoch 84/500
32/32 [==============================] - 0s 500us/step - loss: 178.4455
Epoch 85/500
32/32 [==============================] - 0s 406us/step - loss: 163.4382
Epoch 86/500
32/32 [==============================] - 0s 627us/step - loss: 149.4182
Epoch 87/500
32/32 [==============================] - 0s 539us/step - loss: 136.4665
Epoch 88/500
32/32 [==============================] - 0s 563us/step - loss: 124.4160
Epoch 89/500
32/32 [==============================] - 0s 437us/step - loss: 113.2377
Epoch 90/500
32/32 [==============================] - 0s 468us/step - loss: 102.9703
Epoch 91/500
32/32 [==============================] - 0s 626us/step - loss: 93.5727
Epoch 92/500
32/32 [==============================] - 0s 543us/step - loss: 84.8177
Epoch 93/500
32/32 [==============================] - 0s 562us/step - loss: 76.7797
Epoch 94/500
32/32 [==============================] - 0s 656us/step - loss: 69.4057
Epoch 95/500
32/32 [==============================] - 0s 701us/step - loss: 62.6355
Epoch 96/500
32/32 [==============================] - 0s 719us/step - loss: 56.4213
Epoch 97/500
32/32 [==============================] - 0s 875us/step - loss: 50.7397
Epoch 98/500
32/32 [==============================] - 0s 563us/step - loss: 45.5074
Epoch 99/500
32/32 [==============================] - 0s 687us/step - loss: 40.8151
Epoch 100/500
32/32 [==============================] - 0s 875us/step - loss: 36.5149
Epoch 101/500
32/32 [==============================] - 0s 841us/step - loss: 32.6225
Epoch 102/500
32/32 [==============================] - 0s 757us/step - loss: 29.0764
Epoch 103/500
32/32 [==============================] - 0s 969us/step - loss: 25.8799
Epoch 104/500
32/32 [==============================] - 0s 969us/step - loss: 22.9895
Epoch 105/500
32/32 [==============================] - 0s 937us/step - loss: 20.3557
Epoch 106/500
32/32 [==============================] - 0s 875us/step - loss: 17.9794
Epoch 107/500
32/32 [==============================] - 0s 1000us/step - loss: 15.8777
Epoch 108/500
32/32 [==============================] - 0s 625us/step - loss: 13.9889
Epoch 109/500
32/32 [==============================] - 0s 562us/step - loss: 12.3097
Epoch 110/500
32/32 [==============================] - 0s 500us/step - loss: 10.7943
Epoch 111/500
32/32 [==============================] - 0s 531us/step - loss: 9.4694
Epoch 112/500
32/32 [==============================] - 0s 510us/step - loss: 8.2794
Epoch 113/500
32/32 [==============================] - 0s 545us/step - loss: 7.2364
Epoch 114/500
32/32 [==============================] - 0s 500us/step - loss: 6.3160
Epoch 115/500
32/32 [==============================] - 0s 500us/step - loss: 5.4985
Epoch 116/500
32/32 [==============================] - 0s 406us/step - loss: 4.7844
Epoch 117/500
32/32 [==============================] - 0s 406us/step - loss: 4.1518
Epoch 118/500
32/32 [==============================] - 0s 625us/step - loss: 3.5993
Epoch 119/500
32/32 [==============================] - 0s 406us/step - loss: 3.1226
Epoch 120/500
32/32 [==============================] - 0s 562us/step - loss: 2.7057
Epoch 121/500
32/32 [==============================] - 0s 594us/step - loss: 2.3414
Epoch 122/500
32/32 [==============================] - 0s 844us/step - loss: 2.0243
Epoch 123/500
32/32 [==============================] - 0s 844us/step - loss: 1.7492
Epoch 124/500
32/32 [==============================] - 0s 750us/step - loss: 1.5158
Epoch 125/500
32/32 [==============================] - 0s 875us/step - loss: 1.3156
Epoch 126/500
32/32 [==============================] - 0s 906us/step - loss: 1.1435
Epoch 127/500
32/32 [==============================] - 0s 750us/step - loss: 0.9962
Epoch 128/500
32/32 [==============================] - 0s 437us/step - loss: 0.8700
Epoch 129/500
32/32 [==============================] - 0s 469us/step - loss: 0.7629
Epoch 130/500
32/32 [==============================] - 0s 406us/step - loss: 0.6717
Epoch 131/500
32/32 [==============================] - 0s 438us/step - loss: 0.5950
Epoch 132/500
32/32 [==============================] - 0s 406us/step - loss: 0.5308
Epoch 133/500
32/32 [==============================] - 0s 375us/step - loss: 0.4774
Epoch 134/500
32/32 [==============================] - 0s 406us/step - loss: 0.4326
Epoch 135/500
32/32 [==============================] - 0s 406us/step - loss: 0.3948
Epoch 136/500
32/32 [==============================] - 0s 469us/step - loss: 0.3639
Epoch 137/500
32/32 [==============================] - 0s 406us/step - loss: 0.3379
Epoch 138/500
32/32 [==============================] - 0s 500us/step - loss: 0.3166
Epoch 139/500
32/32 [==============================] - 0s 406us/step - loss: 0.2986
Epoch 140/500
32/32 [==============================] - 0s 469us/step - loss: 0.2841
Epoch 141/500
32/32 [==============================] - 0s 375us/step - loss: 0.2718
Epoch 142/500
32/32 [==============================] - 0s 469us/step - loss: 0.2622
Epoch 143/500
32/32 [==============================] - 0s 406us/step - loss: 0.2544
Epoch 144/500
32/32 [==============================] - 0s 469us/step - loss: 0.2480
Epoch 145/500
32/32 [==============================] - 0s 406us/step - loss: 0.2427
Epoch 146/500
32/32 [==============================] - 0s 469us/step - loss: 0.2385
Epoch 147/500
32/32 [==============================] - 0s 375us/step - loss: 0.2352
Epoch 148/500
32/32 [==============================] - 0s 469us/step - loss: 0.2325
Epoch 149/500
32/32 [==============================] - 0s 407us/step - loss: 0.2303
Epoch 150/500
32/32 [==============================] - 0s 500us/step - loss: 0.2284
Epoch 151/500
32/32 [==============================] - 0s 437us/step - loss: 0.2269
Epoch 152/500
32/32 [==============================] - 0s 500us/step - loss: 0.2257
Epoch 153/500
32/32 [==============================] - 0s 906us/step - loss: 0.2247
Epoch 154/500
32/32 [==============================] - 0s 812us/step - loss: 0.2238
Epoch 155/500
32/32 [==============================] - 0s 749us/step - loss: 0.2231
Epoch 156/500
32/32 [==============================] - 0s 781us/step - loss: 0.2225
Epoch 157/500
32/32 [==============================] - 0s 749us/step - loss: 0.2220
Epoch 158/500
32/32 [==============================] - 0s 687us/step - loss: 0.2215
Epoch 159/500
32/32 [==============================] - 0s 656us/step - loss: 0.2210
Epoch 160/500
32/32 [==============================] - 0s 406us/step - loss: 0.2206
Epoch 161/500
32/32 [==============================] - 0s 500us/step - loss: 0.2202
Epoch 162/500
32/32 [==============================] - 0s 406us/step - loss: 0.2199
Epoch 163/500
32/32 [==============================] - 0s 531us/step - loss: 0.2195
Epoch 164/500
32/32 [==============================] - 0s 438us/step - loss: 0.2191
Epoch 165/500
32/32 [==============================] - 0s 500us/step - loss: 0.2188
Epoch 166/500
32/32 [==============================] - 0s 438us/step - loss: 0.2185
Epoch 167/500
32/32 [==============================] - 0s 531us/step - loss: 0.2182
Epoch 168/500
32/32 [==============================] - 0s 469us/step - loss: 0.2178
Epoch 169/500
32/32 [==============================] - 0s 531us/step - loss: 0.2175
Epoch 170/500
32/32 [==============================] - 0s 563us/step - loss: 0.2172
Epoch 171/500
32/32 [==============================] - 0s 531us/step - loss: 0.2168
Epoch 172/500
32/32 [==============================] - 0s 563us/step - loss: 0.2165
Epoch 173/500
32/32 [==============================] - 0s 500us/step - loss: 0.2161
Epoch 174/500
32/32 [==============================] - 0s 562us/step - loss: 0.2158
Epoch 175/500
32/32 [==============================] - 0s 562us/step - loss: 0.2154
Epoch 176/500
32/32 [==============================] - 0s 531us/step - loss: 0.2150
Epoch 177/500
32/32 [==============================] - 0s 625us/step - loss: 0.2146
Epoch 178/500
32/32 [==============================] - 0s 594us/step - loss: 0.2143
Epoch 179/500
32/32 [==============================] - 0s 500us/step - loss: 0.2139
Epoch 180/500
32/32 [==============================] - 0s 594us/step - loss: 0.2135
Epoch 181/500
32/32 [==============================] - 0s 531us/step - loss: 0.2131
Epoch 182/500
32/32 [==============================] - 0s 562us/step - loss: 0.2127
Epoch 183/500
32/32 [==============================] - 0s 625us/step - loss: 0.2123
Epoch 184/500
32/32 [==============================] - 0s 500us/step - loss: 0.2119
Epoch 185/500
32/32 [==============================] - 0s 594us/step - loss: 0.2115
Epoch 186/500
32/32 [==============================] - 0s 625us/step - loss: 0.2111
Epoch 187/500
32/32 [==============================] - 0s 531us/step - loss: 0.2106
Epoch 188/500
32/32 [==============================] - 0s 625us/step - loss: 0.2102
Epoch 189/500
32/32 [==============================] - 0s 562us/step - loss: 0.2098
Epoch 190/500
32/32 [==============================] - 0s 531us/step - loss: 0.2093
Epoch 191/500
32/32 [==============================] - 0s 625us/step - loss: 0.2089
Epoch 192/500
32/32 [==============================] - 0s 562us/step - loss: 0.2084
Epoch 193/500
32/32 [==============================] - 0s 656us/step - loss: 0.2079
Epoch 194/500
32/32 [==============================] - 0s 625us/step - loss: 0.2074
Epoch 195/500
32/32 [==============================] - 0s 500us/step - loss: 0.2070
Epoch 196/500
32/32 [==============================] - 0s 594us/step - loss: 0.2065
Epoch 197/500
32/32 [==============================] - 0s 625us/step - loss: 0.2060
Epoch 198/500
32/32 [==============================] - 0s 531us/step - loss: 0.2055
Epoch 199/500
32/32 [==============================] - 0s 594us/step - loss: 0.2050
Epoch 200/500
32/32 [==============================] - 0s 594us/step - loss: 0.2045
Epoch 201/500
32/32 [==============================] - 0s 688us/step - loss: 0.2040
Epoch 202/500
32/32 [==============================] - 0s 937us/step - loss: 0.2034
Epoch 203/500
32/32 [==============================] - 0s 813us/step - loss: 0.2029
Epoch 204/500
32/32 [==============================] - 0s 812us/step - loss: 0.2024
Epoch 205/500
32/32 [==============================] - 0s 844us/step - loss: 0.2018
Epoch 206/500
32/32 [==============================] - 0s 1ms/step - loss: 0.2013
Epoch 207/500
32/32 [==============================] - 0s 844us/step - loss: 0.2007
Epoch 208/500
32/32 [==============================] - 0s 907us/step - loss: 0.2001
Epoch 209/500
32/32 [==============================] - 0s 941us/step - loss: 0.1996
Epoch 210/500
32/32 [==============================] - 0s 843us/step - loss: 0.1990
Epoch 211/500
32/32 [==============================] - 0s 906us/step - loss: 0.1984
Epoch 212/500
32/32 [==============================] - 0s 656us/step - loss: 0.1978
Epoch 213/500
32/32 [==============================] - 0s 656us/step - loss: 0.1972
Epoch 214/500
32/32 [==============================] - 0s 625us/step - loss: 0.1966
Epoch 215/500
32/32 [==============================] - 0s 750us/step - loss: 0.1959
Epoch 216/500
32/32 [==============================] - 0s 719us/step - loss: 0.1953
Epoch 217/500
32/32 [==============================] - 0s 625us/step - loss: 0.1947
Epoch 218/500
32/32 [==============================] - 0s 656us/step - loss: 0.1940
Epoch 219/500
32/32 [==============================] - 0s 750us/step - loss: 0.1934
Epoch 220/500
32/32 [==============================] - 0s 688us/step - loss: 0.1927
Epoch 221/500
32/32 [==============================] - 0s 886us/step - loss: 0.1920
Epoch 222/500
32/32 [==============================] - 0s 907us/step - loss: 0.1914
Epoch 223/500
32/32 [==============================] - 0s 938us/step - loss: 0.1907
Epoch 224/500
32/32 [==============================] - 0s 781us/step - loss: 0.1900
Epoch 225/500
32/32 [==============================] - 0s 914us/step - loss: 0.1892
Epoch 226/500
32/32 [==============================] - 0s 939us/step - loss: 0.1885
Epoch 227/500
32/32 [==============================] - 0s 939us/step - loss: 0.1878
Epoch 228/500
32/32 [==============================] - 0s 875us/step - loss: 0.1871
Epoch 229/500
32/32 [==============================] - 0s 594us/step - loss: 0.1864
Epoch 230/500
32/32 [==============================] - 0s 780us/step - loss: 0.1856
Epoch 231/500
32/32 [==============================] - 0s 813us/step - loss: 0.1848
Epoch 232/500
32/32 [==============================] - 0s 719us/step - loss: 0.1841
Epoch 233/500
32/32 [==============================] - 0s 782us/step - loss: 0.1833
Epoch 234/500
32/32 [==============================] - 0s 696us/step - loss: 0.1825
Epoch 235/500
32/32 [==============================] - 0s 750us/step - loss: 0.1817
Epoch 236/500
32/32 [==============================] - 0s 844us/step - loss: 0.1809
Epoch 237/500
32/32 [==============================] - 0s 719us/step - loss: 0.1801
Epoch 238/500
32/32 [==============================] - 0s 719us/step - loss: 0.1793
Epoch 239/500
32/32 [==============================] - 0s 906us/step - loss: 0.1784
Epoch 240/500
32/32 [==============================] - 0s 890us/step - loss: 0.1776
Epoch 241/500
32/32 [==============================] - 0s 906us/step - loss: 0.1767
Epoch 242/500
32/32 [==============================] - 0s 782us/step - loss: 0.1759
Epoch 243/500
32/32 [==============================] - 0s 792us/step - loss: 0.1750
Epoch 244/500
32/32 [==============================] - 0s 813us/step - loss: 0.1741
Epoch 245/500
32/32 [==============================] - 0s 813us/step - loss: 0.1733
Epoch 246/500
32/32 [==============================] - 0s 718us/step - loss: 0.1723
Epoch 247/500
32/32 [==============================] - 0s 750us/step - loss: 0.1714
Epoch 248/500
32/32 [==============================] - 0s 656us/step - loss: 0.1705
Epoch 249/500
32/32 [==============================] - 0s 594us/step - loss: 0.1696
Epoch 250/500
32/32 [==============================] - 0s 656us/step - loss: 0.1686
Epoch 251/500
32/32 [==============================] - 0s 719us/step - loss: 0.1677
Epoch 252/500
32/32 [==============================] - 0s 594us/step - loss: 0.1667
Epoch 253/500
32/32 [==============================] - 0s 687us/step - loss: 0.1658
Epoch 254/500
32/32 [==============================] - 0s 843us/step - loss: 0.1648
Epoch 255/500
32/32 [==============================] - 0s 906us/step - loss: 0.1639
Epoch 256/500
32/32 [==============================] - 0s 906us/step - loss: 0.1628
Epoch 257/500
32/32 [==============================] - 0s 781us/step - loss: 0.1618
Epoch 258/500
32/32 [==============================] - 0s 906us/step - loss: 0.1608
Epoch 259/500
32/32 [==============================] - 0s 906us/step - loss: 0.1598
Epoch 260/500
32/32 [==============================] - 0s 781us/step - loss: 0.1588
Epoch 261/500
32/32 [==============================] - 0s 813us/step - loss: 0.1577
Epoch 262/500
32/32 [==============================] - 0s 594us/step - loss: 0.1567
Epoch 263/500
32/32 [==============================] - 0s 656us/step - loss: 0.1556
Epoch 264/500
32/32 [==============================] - 0s 625us/step - loss: 0.1545
Epoch 265/500
32/32 [==============================] - 0s 563us/step - loss: 0.1534
Epoch 266/500
32/32 [==============================] - 0s 594us/step - loss: 0.1523
Epoch 267/500
32/32 [==============================] - 0s 625us/step - loss: 0.1512
Epoch 268/500
32/32 [==============================] - 0s 562us/step - loss: 0.1501
Epoch 269/500
32/32 [==============================] - 0s 594us/step - loss: 0.1490
Epoch 270/500
32/32 [==============================] - 0s 656us/step - loss: 0.1479
Epoch 271/500
32/32 [==============================] - 0s 562us/step - loss: 0.1467
Epoch 272/500
32/32 [==============================] - 0s 625us/step - loss: 0.1455
Epoch 273/500
32/32 [==============================] - 0s 688us/step - loss: 0.1444
Epoch 274/500
32/32 [==============================] - 0s 562us/step - loss: 0.1432
Epoch 275/500
32/32 [==============================] - 0s 625us/step - loss: 0.1420
Epoch 276/500
32/32 [==============================] - 0s 656us/step - loss: 0.1408
Epoch 277/500
32/32 [==============================] - 0s 562us/step - loss: 0.1396
Epoch 278/500
32/32 [==============================] - 0s 594us/step - loss: 0.1384
Epoch 279/500
32/32 [==============================] - 0s 564us/step - loss: 0.1372
Epoch 280/500
32/32 [==============================] - 0s 593us/step - loss: 0.1360
Epoch 281/500
32/32 [==============================] - 0s 625us/step - loss: 0.1347
Epoch 282/500
32/32 [==============================] - 0s 500us/step - loss: 0.1335
Epoch 283/500
32/32 [==============================] - 0s 594us/step - loss: 0.1322
Epoch 284/500
32/32 [==============================] - 0s 625us/step - loss: 0.1310
Epoch 285/500
32/32 [==============================] - 0s 562us/step - loss: 0.1298
Epoch 286/500
32/32 [==============================] - 0s 593us/step - loss: 0.1285
Epoch 287/500
32/32 [==============================] - 0s 594us/step - loss: 0.1271
Epoch 288/500
32/32 [==============================] - 0s 531us/step - loss: 0.1260
Epoch 289/500
32/32 [==============================] - 0s 628us/step - loss: 0.1246
Epoch 290/500
32/32 [==============================] - 0s 593us/step - loss: 0.1233
Epoch 291/500
32/32 [==============================] - 0s 531us/step - loss: 0.1220
Epoch 292/500
32/32 [==============================] - 0s 625us/step - loss: 0.1207
Epoch 293/500
32/32 [==============================] - 0s 594us/step - loss: 0.1194
Epoch 294/500
32/32 [==============================] - 0s 531us/step - loss: 0.1180
Epoch 295/500
32/32 [==============================] - 0s 594us/step - loss: 0.1168
Epoch 296/500
32/32 [==============================] - 0s 531us/step - loss: 0.1154
Epoch 297/500
32/32 [==============================] - 0s 593us/step - loss: 0.1141
Epoch 298/500
32/32 [==============================] - 0s 625us/step - loss: 0.1128
Epoch 299/500
32/32 [==============================] - 0s 531us/step - loss: 0.1114
Epoch 300/500
32/32 [==============================] - 0s 594us/step - loss: 0.1101
Epoch 301/500
32/32 [==============================] - 0s 594us/step - loss: 0.1087
Epoch 302/500
32/32 [==============================] - 0s 531us/step - loss: 0.1073
Epoch 303/500
32/32 [==============================] - 0s 625us/step - loss: 0.1059
Epoch 304/500
32/32 [==============================] - 0s 563us/step - loss: 0.1046
Epoch 305/500
32/32 [==============================] - 0s 562us/step - loss: 0.1032
Epoch 306/500
32/32 [==============================] - 0s 625us/step - loss: 0.1018
Epoch 307/500
32/32 [==============================] - 0s 531us/step - loss: 0.1004
Epoch 308/500
32/32 [==============================] - 0s 594us/step - loss: 0.0990
Epoch 309/500
32/32 [==============================] - 0s 562us/step - loss: 0.0976
Epoch 310/500
32/32 [==============================] - 0s 469us/step - loss: 0.0962
Epoch 311/500
32/32 [==============================] - 0s 594us/step - loss: 0.0948
Epoch 312/500
32/32 [==============================] - 0s 531us/step - loss: 0.0934
Epoch 313/500
32/32 [==============================] - 0s 562us/step - loss: 0.0920
Epoch 314/500
32/32 [==============================] - 0s 594us/step - loss: 0.0907
Epoch 315/500
32/32 [==============================] - 0s 531us/step - loss: 0.0893
Epoch 316/500
32/32 [==============================] - 0s 625us/step - loss: 0.0880
Epoch 317/500
32/32 [==============================] - 0s 562us/step - loss: 0.0865
Epoch 318/500
32/32 [==============================] - 0s 531us/step - loss: 0.0851
Epoch 319/500
32/32 [==============================] - 0s 594us/step - loss: 0.0837
Epoch 320/500
32/32 [==============================] - 0s 562us/step - loss: 0.0823
Epoch 321/500
32/32 [==============================] - 0s 531us/step - loss: 0.0809
Epoch 322/500
32/32 [==============================] - 0s 594us/step - loss: 0.0795
Epoch 323/500
32/32 [==============================] - 0s 531us/step - loss: 0.0782
Epoch 324/500
32/32 [==============================] - 0s 594us/step - loss: 0.0768
Epoch 325/500
32/32 [==============================] - 0s 563us/step - loss: 0.0754
Epoch 326/500
32/32 [==============================] - 0s 500us/step - loss: 0.0740
Epoch 327/500
32/32 [==============================] - 0s 594us/step - loss: 0.0727
Epoch 328/500
32/32 [==============================] - 0s 500us/step - loss: 0.0712
Epoch 329/500
32/32 [==============================] - 0s 563us/step - loss: 0.0700
Epoch 330/500
32/32 [==============================] - 0s 656us/step - loss: 0.0686
Epoch 331/500
32/32 [==============================] - 0s 531us/step - loss: 0.0672
Epoch 332/500
32/32 [==============================] - 0s 625us/step - loss: 0.0658
Epoch 333/500
32/32 [==============================] - 0s 563us/step - loss: 0.0644
Epoch 334/500
32/32 [==============================] - 0s 531us/step - loss: 0.0631
Epoch 335/500
32/32 [==============================] - 0s 594us/step - loss: 0.0618
Epoch 336/500
32/32 [==============================] - 0s 500us/step - loss: 0.0605
Epoch 337/500
32/32 [==============================] - 0s 626us/step - loss: 0.0592
Epoch 338/500
32/32 [==============================] - 0s 719us/step - loss: 0.0579
Epoch 339/500
32/32 [==============================] - 0s 812us/step - loss: 0.0566
Epoch 340/500
32/32 [==============================] - 0s 782us/step - loss: 0.0554
Epoch 341/500
32/32 [==============================] - 0s 686us/step - loss: 0.0540
Epoch 342/500
32/32 [==============================] - 0s 812us/step - loss: 0.0528
Epoch 343/500
32/32 [==============================] - 0s 854us/step - loss: 0.0515
Epoch 344/500
32/32 [==============================] - 0s 781us/step - loss: 0.0503
Epoch 345/500
32/32 [==============================] - 0s 594us/step - loss: 0.0491
Epoch 346/500
32/32 [==============================] - 0s 563us/step - loss: 0.0479
Epoch 347/500
32/32 [==============================] - 0s 594us/step - loss: 0.0467
Epoch 348/500
32/32 [==============================] - 0s 594us/step - loss: 0.0455
Epoch 349/500
32/32 [==============================] - 0s 594us/step - loss: 0.0443
Epoch 350/500
32/32 [==============================] - 0s 656us/step - loss: 0.0431
Epoch 351/500
32/32 [==============================] - 0s 625us/step - loss: 0.0419
Epoch 352/500
32/32 [==============================] - 0s 531us/step - loss: 0.0408
Epoch 353/500
32/32 [==============================] - 0s 750us/step - loss: 0.0397
Epoch 354/500
32/32 [==============================] - 0s 749us/step - loss: 0.0385
Epoch 355/500
32/32 [==============================] - 0s 967us/step - loss: 0.0375
Epoch 356/500
32/32 [==============================] - 0s 937us/step - loss: 0.0364
Epoch 357/500
32/32 [==============================] - 0s 875us/step - loss: 0.0353
Epoch 358/500
32/32 [==============================] - 0s 1000us/step - loss: 0.0342
Epoch 359/500
32/32 [==============================] - 0s 1ms/step - loss: 0.0332
Epoch 360/500
32/32 [==============================] - 0s 1000us/step - loss: 0.0322
Epoch 361/500
32/32 [==============================] - 0s 874us/step - loss: 0.0311
Epoch 362/500
32/32 [==============================] - 0s 969us/step - loss: 0.0302
Epoch 363/500
32/32 [==============================] - 0s 1ms/step - loss: 0.0292
Epoch 364/500
32/32 [==============================] - 0s 844us/step - loss: 0.0282
Epoch 365/500
32/32 [==============================] - 0s 687us/step - loss: 0.0273
Epoch 366/500
32/32 [==============================] - 0s 688us/step - loss: 0.0264
Epoch 367/500
32/32 [==============================] - 0s 688us/step - loss: 0.0255
Epoch 368/500
32/32 [==============================] - 0s 625us/step - loss: 0.0246
Epoch 369/500
32/32 [==============================] - 0s 719us/step - loss: 0.0237
Epoch 370/500
32/32 [==============================] - 0s 688us/step - loss: 0.0229
Epoch 371/500
32/32 [==============================] - 0s 594us/step - loss: 0.0221
Epoch 372/500
32/32 [==============================] - 0s 625us/step - loss: 0.0212
Epoch 373/500
32/32 [==============================] - 0s 719us/step - loss: 0.0204
Epoch 374/500
32/32 [==============================] - 0s 875us/step - loss: 0.0197
Epoch 375/500
32/32 [==============================] - 0s 875us/step - loss: 0.0189
Epoch 376/500
32/32 [==============================] - 0s 843us/step - loss: 0.0181
Epoch 377/500
32/32 [==============================] - 0s 844us/step - loss: 0.0174
Epoch 378/500
32/32 [==============================] - 0s 813us/step - loss: 0.0167
Epoch 379/500
32/32 [==============================] - 0s 750us/step - loss: 0.0160
Epoch 380/500
32/32 [==============================] - 0s 938us/step - loss: 0.0154
Epoch 381/500
32/32 [==============================] - 0s 969us/step - loss: 0.0147
Epoch 382/500
32/32 [==============================] - ETA: 0s - loss: 0.008 - 0s 1ms/step - loss: 0.0141
Epoch 383/500
32/32 [==============================] - 0s 813us/step - loss: 0.0134
Epoch 384/500
32/32 [==============================] - 0s 688us/step - loss: 0.0128
Epoch 385/500
32/32 [==============================] - 0s 781us/step - loss: 0.0123
Epoch 386/500
32/32 [==============================] - 0s 687us/step - loss: 0.0117
Epoch 387/500
32/32 [==============================] - 0s 687us/step - loss: 0.0112
Epoch 388/500
32/32 [==============================] - 0s 687us/step - loss: 0.0106
Epoch 389/500
32/32 [==============================] - 0s 687us/step - loss: 0.0101
Epoch 390/500
32/32 [==============================] - 0s 688us/step - loss: 0.0096
Epoch 391/500
32/32 [==============================] - 0s 719us/step - loss: 0.0092
Epoch 392/500
32/32 [==============================] - 0s 595us/step - loss: 0.0087
Epoch 393/500
32/32 [==============================] - 0s 656us/step - loss: 0.0083
Epoch 394/500
32/32 [==============================] - 0s 687us/step - loss: 0.0078
Epoch 395/500
32/32 [==============================] - 0s 687us/step - loss: 0.0074
Epoch 396/500
32/32 [==============================] - 0s 593us/step - loss: 0.0070
Epoch 397/500
32/32 [==============================] - 0s 656us/step - loss: 0.0067
Epoch 398/500
32/32 [==============================] - 0s 656us/step - loss: 0.0063
Epoch 399/500
32/32 [==============================] - 0s 656us/step - loss: 0.0059
Epoch 400/500
32/32 [==============================] - 0s 656us/step - loss: 0.0056
Epoch 401/500
32/32 [==============================] - 0s 750us/step - loss: 0.0053
Epoch 402/500
32/32 [==============================] - 0s 688us/step - loss: 0.0050
Epoch 403/500
32/32 [==============================] - 0s 594us/step - loss: 0.0047
Epoch 404/500
32/32 [==============================] - 0s 625us/step - loss: 0.0044
Epoch 405/500
32/32 [==============================] - 0s 719us/step - loss: 0.0041
Epoch 406/500
32/32 [==============================] - 0s 625us/step - loss: 0.0039
Epoch 407/500
32/32 [==============================] - 0s 625us/step - loss: 0.0036
Epoch 408/500
32/32 [==============================] - 0s 656us/step - loss: 0.0034
Epoch 409/500
32/32 [==============================] - 0s 688us/step - loss: 0.0032
Epoch 410/500
32/32 [==============================] - 0s 625us/step - loss: 0.0030
Epoch 411/500
32/32 [==============================] - 0s 625us/step - loss: 0.0028
Epoch 412/500
32/32 [==============================] - 0s 719us/step - loss: 0.0026
Epoch 413/500
32/32 [==============================] - 0s 656us/step - loss: 0.0024
Epoch 414/500
32/32 [==============================] - 0s 593us/step - loss: 0.0022
Epoch 415/500
32/32 [==============================] - 0s 687us/step - loss: 0.0021
Epoch 416/500
32/32 [==============================] - 0s 656us/step - loss: 0.0019
Epoch 417/500
32/32 [==============================] - 0s 656us/step - loss: 0.0018
Epoch 418/500
32/32 [==============================] - 0s 625us/step - loss: 0.0016
Epoch 419/500
32/32 [==============================] - 0s 719us/step - loss: 0.0015
Epoch 420/500
32/32 [==============================] - 0s 656us/step - loss: 0.0014
Epoch 421/500
32/32 [==============================] - 0s 594us/step - loss: 0.0013
Epoch 422/500
32/32 [==============================] - 0s 624us/step - loss: 0.0012
Epoch 423/500
32/32 [==============================] - 0s 656us/step - loss: 0.0011
Epoch 424/500
32/32 [==============================] - 0s 625us/step - loss: 0.0010
Epoch 425/500
32/32 [==============================] - 0s 625us/step - loss: 9.2519e-04
Epoch 426/500
32/32 [==============================] - 0s 719us/step - loss: 8.5018e-04
Epoch 427/500
32/32 [==============================] - 0s 656us/step - loss: 7.7497e-04
Epoch 428/500
32/32 [==============================] - 0s 594us/step - loss: 7.0766e-04
Epoch 429/500
32/32 [==============================] - 0s 687us/step - loss: 6.4768e-04
Epoch 430/500
32/32 [==============================] - 0s 656us/step - loss: 5.8868e-04
Epoch 431/500
32/32 [==============================] - 0s 594us/step - loss: 5.3381e-04
Epoch 432/500
32/32 [==============================] - 0s 625us/step - loss: 4.8580e-04
Epoch 433/500
32/32 [==============================] - 0s 656us/step - loss: 4.3956e-04
Epoch 434/500
32/32 [==============================] - 0s 625us/step - loss: 3.9810e-04
Epoch 435/500
32/32 [==============================] - 0s 656us/step - loss: 3.6015e-04
Epoch 436/500
32/32 [==============================] - 0s 719us/step - loss: 3.2390e-04
Epoch 437/500
32/32 [==============================] - 0s 688us/step - loss: 2.9103e-04
Epoch 438/500
32/32 [==============================] - 0s 687us/step - loss: 2.6144e-04
Epoch 439/500
32/32 [==============================] - 0s 625us/step - loss: 2.3450e-04
Epoch 440/500
32/32 [==============================] - 0s 719us/step - loss: 2.1079e-04
Epoch 441/500
32/32 [==============================] - 0s 656us/step - loss: 1.8812e-04
Epoch 442/500
32/32 [==============================] - 0s 657us/step - loss: 1.6712e-04
Epoch 443/500
32/32 [==============================] - 0s 656us/step - loss: 1.4931e-04
Epoch 444/500
32/32 [==============================] - 0s 656us/step - loss: 1.3229e-04
Epoch 445/500
32/32 [==============================] - 0s 594us/step - loss: 1.1736e-04
Epoch 446/500
32/32 [==============================] - 0s 625us/step - loss: 1.0365e-04
Epoch 447/500
32/32 [==============================] - 0s 750us/step - loss: 9.2456e-05
Epoch 448/500
32/32 [==============================] - 0s 687us/step - loss: 8.1252e-05
Epoch 449/500
32/32 [==============================] - 0s 562us/step - loss: 7.1477e-05
Epoch 450/500
32/32 [==============================] - 0s 625us/step - loss: 6.2452e-05
Epoch 451/500
32/32 [==============================] - 0s 687us/step - loss: 5.4642e-05
Epoch 452/500
32/32 [==============================] - 0s 594us/step - loss: 4.7631e-05
Epoch 453/500
32/32 [==============================] - 0s 625us/step - loss: 4.1519e-05
Epoch 454/500
32/32 [==============================] - 0s 687us/step - loss: 3.6142e-05
Epoch 455/500
32/32 [==============================] - 0s 656us/step - loss: 3.1736e-05
Epoch 456/500
32/32 [==============================] - 0s 594us/step - loss: 2.7382e-05
Epoch 457/500
32/32 [==============================] - 0s 719us/step - loss: 2.3468e-05
Epoch 458/500
32/32 [==============================] - 0s 656us/step - loss: 2.0264e-05
Epoch 459/500
32/32 [==============================] - 0s 625us/step - loss: 1.7398e-05
Epoch 460/500
32/32 [==============================] - 0s 594us/step - loss: 1.5046e-05
Epoch 461/500
32/32 [==============================] - 0s 750us/step - loss: 1.2858e-05
Epoch 462/500
32/32 [==============================] - 0s 656us/step - loss: 1.1060e-05
Epoch 463/500
32/32 [==============================] - 0s 594us/step - loss: 9.4013e-06
Epoch 464/500
32/32 [==============================] - 0s 656us/step - loss: 7.9602e-06
Epoch 465/500
32/32 [==============================] - 0s 719us/step - loss: 6.7101e-06
Epoch 466/500
32/32 [==============================] - 0s 687us/step - loss: 5.6653e-06
Epoch 467/500
32/32 [==============================] - 0s 625us/step - loss: 4.7921e-06
Epoch 468/500
32/32 [==============================] - 0s 718us/step - loss: 4.0118e-06
Epoch 469/500
32/32 [==============================] - 0s 687us/step - loss: 3.3891e-06
Epoch 470/500
32/32 [==============================] - 0s 625us/step - loss: 2.7998e-06
Epoch 471/500
32/32 [==============================] - 0s 656us/step - loss: 2.3335e-06
Epoch 472/500
32/32 [==============================] - 0s 718us/step - loss: 1.9301e-06
Epoch 473/500
32/32 [==============================] - 0s 687us/step - loss: 1.6212e-06
Epoch 474/500
32/32 [==============================] - 0s 657us/step - loss: 1.3169e-06
Epoch 475/500
32/32 [==============================] - 0s 625us/step - loss: 1.0783e-06
Epoch 476/500
32/32 [==============================] - 0s 719us/step - loss: 8.8126e-07
Epoch 477/500
32/32 [==============================] - 0s 625us/step - loss: 7.1912e-07
Epoch 478/500
32/32 [==============================] - 0s 625us/step - loss: 5.8689e-07
Epoch 479/500
32/32 [==============================] - 0s 687us/step - loss: 4.7973e-07
Epoch 480/500
32/32 [==============================] - 0s 656us/step - loss: 3.8493e-07
Epoch 481/500
32/32 [==============================] - 0s 687us/step - loss: 3.1008e-07
Epoch 482/500
32/32 [==============================] - 0s 656us/step - loss: 2.4894e-07
Epoch 483/500
32/32 [==============================] - 0s 687us/step - loss: 1.9867e-07
Epoch 484/500
32/32 [==============================] - 0s 688us/step - loss: 1.5981e-07
Epoch 485/500
32/32 [==============================] - 0s 625us/step - loss: 1.2880e-07
Epoch 486/500
32/32 [==============================] - 0s 625us/step - loss: 9.9260e-08
Epoch 487/500
32/32 [==============================] - 0s 687us/step - loss: 7.8582e-08
Epoch 488/500
32/32 [==============================] - 0s 687us/step - loss: 6.3832e-08
Epoch 489/500
32/32 [==============================] - 0s 594us/step - loss: 4.8021e-08
Epoch 490/500
32/32 [==============================] - 0s 624us/step - loss: 3.7999e-08
Epoch 491/500
32/32 [==============================] - 0s 656us/step - loss: 2.9637e-08
Epoch 492/500
32/32 [==============================] - 0s 594us/step - loss: 2.2672e-08
Epoch 493/500
32/32 [==============================] - 0s 624us/step - loss: 1.7604e-08
Epoch 494/500
32/32 [==============================] - 0s 687us/step - loss: 1.3296e-08
Epoch 495/500
32/32 [==============================] - 0s 656us/step - loss: 1.0214e-08
Epoch 496/500
32/32 [==============================] - 0s 625us/step - loss: 8.1630e-09
Epoch 497/500
32/32 [==============================] - 0s 719us/step - loss: 6.1859e-09
Epoch 498/500
32/32 [==============================] - 0s 657us/step - loss: 4.5115e-09
Epoch 499/500
32/32 [==============================] - 0s 594us/step - loss: 3.3944e-09
Epoch 500/500
32/32 [==============================] - 0s 656us/step - loss: 2.7302e-09
Out[7]:
<tensorflow.python.keras.callbacks.History at 0x1ded502de50>
In [8]:
# Take four hand-picked values and see their predictions.
model.predict([1.0,2.0,3.0,100.0])
Out[8]:
array([[  4.000095 ],
       [  7.0000935],
       [ 10.0000925],
       [300.99994  ]], dtype=float32)
In [9]:
# See what f says they are.
np.array([[f(i)] for i in [1.0, 2.0, 3.0, 100.0]])
Out[9]:
array([[  4.],
       [  7.],
       [ 10.],
       [301.]])
In [10]:
# Let's plot our predictions of the x values we trained on
plt.plot(test['x'], test['y'], label='actual')
plt.plot(test['x'], model.predict(test['x']), label='prediction')
plt.legend();
In [11]:
# Evaluate the neural network on the test data.
model.evaluate(test['x'], test['y'])
4/4 [==============================] - 0s 754us/step - loss: 2.7449e-09
Out[11]:
2.7449078565666696e-09


Polynomial


$$ ax^2 + bx + c $$


In [12]:
# Let's set f to a polynomial instead.
f = lambda x: 2.0 * x**2 + 3.0 * x + 4.0

poly = pd.DataFrame()
poly['x'] = np.linspace(-10.0, 10.0, 1000)
poly['y'] = poly['x'].apply(f)
In [13]:
# Have a look.
plt.plot(poly['x'], poly['y']);
In [14]:
# Re-build our model.
model = kr.models.Sequential()
model.add(kr.layers.Dense(1, input_shape=(1,), activation='linear', kernel_initializer="ones", bias_initializer="zeros"))
model.compile('adam', loss='mean_squared_error')
In [15]:
# Fit the data.
model.fit(poly['x'], poly['y'], epochs=500)
Epoch 1/500
32/32 [==============================] - 0s 556us/step - loss: 8713.3330
Epoch 2/500
32/32 [==============================] - 0s 805us/step - loss: 8707.0674
Epoch 3/500
32/32 [==============================] - 0s 660us/step - loss: 8701.1631
Epoch 4/500
32/32 [==============================] - 0s 579us/step - loss: 8694.9092
Epoch 5/500
32/32 [==============================] - 0s 793us/step - loss: 8688.7188
Epoch 6/500
32/32 [==============================] - 0s 923us/step - loss: 8682.5615
Epoch 7/500
32/32 [==============================] - 0s 656us/step - loss: 8676.6826
Epoch 8/500
32/32 [==============================] - 0s 790us/step - loss: 8670.6836
Epoch 9/500
32/32 [==============================] - 0s 688us/step - loss: 8664.3730
Epoch 10/500
32/32 [==============================] - 0s 687us/step - loss: 8658.4512
Epoch 11/500
32/32 [==============================] - 0s 937us/step - loss: 8652.3740
Epoch 12/500
32/32 [==============================] - 0s 656us/step - loss: 8646.1445
Epoch 13/500
32/32 [==============================] - 0s 719us/step - loss: 8640.2480
Epoch 14/500
32/32 [==============================] - 0s 875us/step - loss: 8634.5293
Epoch 15/500
32/32 [==============================] - 0s 625us/step - loss: 8628.7842
Epoch 16/500
32/32 [==============================] - 0s 781us/step - loss: 8623.1387
Epoch 17/500
32/32 [==============================] - 0s 875us/step - loss: 8617.2285
Epoch 18/500
32/32 [==============================] - 0s 781us/step - loss: 8611.2285
Epoch 19/500
32/32 [==============================] - 0s 750us/step - loss: 8605.6113
Epoch 20/500
32/32 [==============================] - 0s 906us/step - loss: 8599.6514
Epoch 21/500
32/32 [==============================] - 0s 750us/step - loss: 8594.0098
Epoch 22/500
32/32 [==============================] - 0s 594us/step - loss: 8588.2207
Epoch 23/500
32/32 [==============================] - 0s 844us/step - loss: 8582.5312
Epoch 24/500
32/32 [==============================] - 0s 875us/step - loss: 8576.9473
Epoch 25/500
32/32 [==============================] - 0s 875us/step - loss: 8571.1797
Epoch 26/500
32/32 [==============================] - 0s 906us/step - loss: 8564.9736
Epoch 27/500
32/32 [==============================] - 0s 1ms/step - loss: 8559.2354
Epoch 28/500
32/32 [==============================] - 0s 906us/step - loss: 8553.5107
Epoch 29/500
32/32 [==============================] - 0s 1ms/step - loss: 8547.8799
Epoch 30/500
32/32 [==============================] - 0s 969us/step - loss: 8542.2656
Epoch 31/500
32/32 [==============================] - 0s 813us/step - loss: 8536.7812
Epoch 32/500
32/32 [==============================] - 0s 844us/step - loss: 8531.3945
Epoch 33/500
32/32 [==============================] - 0s 906us/step - loss: 8525.7373
Epoch 34/500
32/32 [==============================] - 0s 844us/step - loss: 8520.2441
Epoch 35/500
32/32 [==============================] - 0s 812us/step - loss: 8514.8887
Epoch 36/500
32/32 [==============================] - 0s 843us/step - loss: 8509.5938
Epoch 37/500
32/32 [==============================] - 0s 844us/step - loss: 8504.0752
Epoch 38/500
32/32 [==============================] - 0s 656us/step - loss: 8498.5996
Epoch 39/500
32/32 [==============================] - 0s 875us/step - loss: 8493.2100
Epoch 40/500
32/32 [==============================] - 0s 656us/step - loss: 8487.8232
Epoch 41/500
32/32 [==============================] - 0s 812us/step - loss: 8482.6152
Epoch 42/500
32/32 [==============================] - 0s 941us/step - loss: 8476.9990
Epoch 43/500
32/32 [==============================] - 0s 907us/step - loss: 8471.6826
Epoch 44/500
32/32 [==============================] - 0s 938us/step - loss: 8466.4219
Epoch 45/500
32/32 [==============================] - 0s 938us/step - loss: 8461.0781
Epoch 46/500
32/32 [==============================] - 0s 875us/step - loss: 8455.8096
Epoch 47/500
32/32 [==============================] - 0s 1ms/step - loss: 8450.5107
Epoch 48/500
32/32 [==============================] - 0s 1ms/step - loss: 8445.4121
Epoch 49/500
32/32 [==============================] - 0s 1000us/step - loss: 8440.2900
Epoch 50/500
32/32 [==============================] - 0s 906us/step - loss: 8434.8330
Epoch 51/500
32/32 [==============================] - 0s 844us/step - loss: 8429.7969
Epoch 52/500
32/32 [==============================] - 0s 875us/step - loss: 8424.6963
Epoch 53/500
32/32 [==============================] - 0s 906us/step - loss: 8419.5234
Epoch 54/500
32/32 [==============================] - 0s 906us/step - loss: 8414.3066
Epoch 55/500
32/32 [==============================] - 0s 687us/step - loss: 8409.1006
Epoch 56/500
32/32 [==============================] - 0s 594us/step - loss: 8404.0762
Epoch 57/500
32/32 [==============================] - 0s 656us/step - loss: 8398.9922
Epoch 58/500
32/32 [==============================] - 0s 656us/step - loss: 8393.8721
Epoch 59/500
32/32 [==============================] - 0s 562us/step - loss: 8388.7520
Epoch 60/500
32/32 [==============================] - 0s 594us/step - loss: 8383.6787
Epoch 61/500
32/32 [==============================] - 0s 656us/step - loss: 8378.6338
Epoch 62/500
32/32 [==============================] - 0s 594us/step - loss: 8373.4268
Epoch 63/500
32/32 [==============================] - 0s 594us/step - loss: 8368.1514
Epoch 64/500
32/32 [==============================] - 0s 750us/step - loss: 8363.1377
Epoch 65/500
32/32 [==============================] - 0s 875us/step - loss: 8357.9150
Epoch 66/500
32/32 [==============================] - 0s 1ms/step - loss: 8352.5654
Epoch 67/500
32/32 [==============================] - 0s 1ms/step - loss: 8347.3174
Epoch 68/500
32/32 [==============================] - 0s 1ms/step - loss: 8342.2666
Epoch 69/500
32/32 [==============================] - 0s 968us/step - loss: 8337.1592
Epoch 70/500
32/32 [==============================] - 0s 938us/step - loss: 8332.1748
Epoch 71/500
32/32 [==============================] - 0s 593us/step - loss: 8327.1113
Epoch 72/500
32/32 [==============================] - 0s 625us/step - loss: 8322.1436
Epoch 73/500
32/32 [==============================] - 0s 625us/step - loss: 8317.4639
Epoch 74/500
32/32 [==============================] - 0s 563us/step - loss: 8312.3613
Epoch 75/500
32/32 [==============================] - 0s 688us/step - loss: 8307.4023
Epoch 76/500
32/32 [==============================] - 0s 656us/step - loss: 8302.4258
Epoch 77/500
32/32 [==============================] - 0s 562us/step - loss: 8297.5684
Epoch 78/500
32/32 [==============================] - 0s 625us/step - loss: 8292.6553
Epoch 79/500
32/32 [==============================] - 0s 656us/step - loss: 8287.5859
Epoch 80/500
32/32 [==============================] - 0s 563us/step - loss: 8282.6719
Epoch 81/500
32/32 [==============================] - 0s 656us/step - loss: 8277.7842
Epoch 82/500
32/32 [==============================] - 0s 624us/step - loss: 8272.9971
Epoch 83/500
32/32 [==============================] - 0s 531us/step - loss: 8268.1465
Epoch 84/500
32/32 [==============================] - 0s 656us/step - loss: 8263.3135
Epoch 85/500
32/32 [==============================] - 0s 688us/step - loss: 8258.3760
Epoch 86/500
32/32 [==============================] - 0s 875us/step - loss: 8253.5068
Epoch 87/500
32/32 [==============================] - 0s 1000us/step - loss: 8248.7832
Epoch 88/500
32/32 [==============================] - 0s 969us/step - loss: 8244.0898
Epoch 89/500
32/32 [==============================] - 0s 969us/step - loss: 8239.4385
Epoch 90/500
32/32 [==============================] - 0s 844us/step - loss: 8234.4395
Epoch 91/500
32/32 [==============================] - 0s 782us/step - loss: 8229.7275
Epoch 92/500
32/32 [==============================] - 0s 750us/step - loss: 8224.8770
Epoch 93/500
32/32 [==============================] - 0s 875us/step - loss: 8220.2266
Epoch 94/500
32/32 [==============================] - 0s 750us/step - loss: 8215.1113
Epoch 95/500
32/32 [==============================] - 0s 719us/step - loss: 8210.3486
Epoch 96/500
32/32 [==============================] - 0s 707us/step - loss: 8205.5762
Epoch 97/500
32/32 [==============================] - 0s 688us/step - loss: 8200.8164
Epoch 98/500
32/32 [==============================] - 0s 656us/step - loss: 8196.0781
Epoch 99/500
32/32 [==============================] - 0s 625us/step - loss: 8191.2007
Epoch 100/500
32/32 [==============================] - 0s 687us/step - loss: 8186.2979
Epoch 101/500
32/32 [==============================] - 0s 689us/step - loss: 8181.4185
Epoch 102/500
32/32 [==============================] - 0s 625us/step - loss: 8176.7065
Epoch 103/500
32/32 [==============================] - 0s 687us/step - loss: 8172.0811
Epoch 104/500
32/32 [==============================] - 0s 656us/step - loss: 8167.5498
Epoch 105/500
32/32 [==============================] - 0s 702us/step - loss: 8162.6743
Epoch 106/500
32/32 [==============================] - 0s 862us/step - loss: 8158.2007
Epoch 107/500
32/32 [==============================] - 0s 719us/step - loss: 8153.4097
Epoch 108/500
32/32 [==============================] - 0s 906us/step - loss: 8148.7905
Epoch 109/500
32/32 [==============================] - 0s 812us/step - loss: 8144.2432
Epoch 110/500
32/32 [==============================] - 0s 937us/step - loss: 8139.5581
Epoch 111/500
32/32 [==============================] - 0s 907us/step - loss: 8134.6416
Epoch 112/500
32/32 [==============================] - 0s 875us/step - loss: 8130.0376
Epoch 113/500
32/32 [==============================] - 0s 718us/step - loss: 8125.4048
Epoch 114/500
32/32 [==============================] - 0s 607us/step - loss: 8120.6841
Epoch 115/500
32/32 [==============================] - 0s 719us/step - loss: 8116.0952
Epoch 116/500
32/32 [==============================] - 0s 687us/step - loss: 8111.4736
Epoch 117/500
32/32 [==============================] - 0s 781us/step - loss: 8107.0576
Epoch 118/500
32/32 [==============================] - 0s 656us/step - loss: 8102.2700
Epoch 119/500
32/32 [==============================] - 0s 713us/step - loss: 8097.6714
Epoch 120/500
32/32 [==============================] - 0s 727us/step - loss: 8092.9429
Epoch 121/500
32/32 [==============================] - 0s 781us/step - loss: 8088.4180
Epoch 122/500
32/32 [==============================] - 0s 781us/step - loss: 8083.8804
Epoch 123/500
32/32 [==============================] - 0s 719us/step - loss: 8079.2661
Epoch 124/500
32/32 [==============================] - 0s 656us/step - loss: 8074.7510
Epoch 125/500
32/32 [==============================] - 0s 691us/step - loss: 8070.3193
Epoch 126/500
32/32 [==============================] - 0s 750us/step - loss: 8065.7471
Epoch 127/500
32/32 [==============================] - 0s 687us/step - loss: 8061.2041
Epoch 128/500
32/32 [==============================] - 0s 687us/step - loss: 8056.6377
Epoch 129/500
32/32 [==============================] - 0s 721us/step - loss: 8052.0928
Epoch 130/500
32/32 [==============================] - 0s 688us/step - loss: 8047.4443
Epoch 131/500
32/32 [==============================] - 0s 719us/step - loss: 8042.9502
Epoch 132/500
32/32 [==============================] - 0s 687us/step - loss: 8038.5591
Epoch 133/500
32/32 [==============================] - 0s 720us/step - loss: 8033.9731
Epoch 134/500
32/32 [==============================] - 0s 656us/step - loss: 8029.6226
Epoch 135/500
32/32 [==============================] - 0s 781us/step - loss: 8025.0894
Epoch 136/500
32/32 [==============================] - 0s 719us/step - loss: 8020.6445
Epoch 137/500
32/32 [==============================] - 0s 594us/step - loss: 8016.3169
Epoch 138/500
32/32 [==============================] - 0s 673us/step - loss: 8011.7256
Epoch 139/500
32/32 [==============================] - 0s 750us/step - loss: 8007.3906
Epoch 140/500
32/32 [==============================] - 0s 688us/step - loss: 8002.9790
Epoch 141/500
32/32 [==============================] - 0s 688us/step - loss: 7998.5684
Epoch 142/500
32/32 [==============================] - 0s 844us/step - loss: 7994.2007
Epoch 143/500
32/32 [==============================] - 0s 813us/step - loss: 7989.7563
Epoch 144/500
32/32 [==============================] - 0s 781us/step - loss: 7985.3682
Epoch 145/500
32/32 [==============================] - 0s 782us/step - loss: 7980.8867
Epoch 146/500
32/32 [==============================] - 0s 875us/step - loss: 7976.6982
Epoch 147/500
32/32 [==============================] - 0s 969us/step - loss: 7971.9800
Epoch 148/500
32/32 [==============================] - 0s 906us/step - loss: 7967.6929
Epoch 149/500
32/32 [==============================] - 0s 750us/step - loss: 7963.3687
Epoch 150/500
32/32 [==============================] - 0s 750us/step - loss: 7958.9780
Epoch 151/500
32/32 [==============================] - 0s 937us/step - loss: 7954.7378
Epoch 152/500
32/32 [==============================] - 0s 912us/step - loss: 7950.3467
Epoch 153/500
32/32 [==============================] - 0s 906us/step - loss: 7946.0957
Epoch 154/500
32/32 [==============================] - 0s 750us/step - loss: 7941.7715
Epoch 155/500
32/32 [==============================] - 0s 750us/step - loss: 7937.4209
Epoch 156/500
32/32 [==============================] - 0s 750us/step - loss: 7932.9536
Epoch 157/500
32/32 [==============================] - 0s 719us/step - loss: 7928.5586
Epoch 158/500
32/32 [==============================] - 0s 719us/step - loss: 7924.2139
Epoch 159/500
32/32 [==============================] - 0s 625us/step - loss: 7919.9058
Epoch 160/500
32/32 [==============================] - 0s 656us/step - loss: 7915.5420
Epoch 161/500
32/32 [==============================] - 0s 688us/step - loss: 7911.3633
Epoch 162/500
32/32 [==============================] - 0s 688us/step - loss: 7907.1416
Epoch 163/500
32/32 [==============================] - 0s 875us/step - loss: 7902.8252
Epoch 164/500
32/32 [==============================] - 0s 812us/step - loss: 7898.4780
Epoch 165/500
32/32 [==============================] - 0s 750us/step - loss: 7894.2100
Epoch 166/500
32/32 [==============================] - 0s 749us/step - loss: 7889.9316
Epoch 167/500
32/32 [==============================] - 0s 1ms/step - loss: 7885.4863
Epoch 168/500
32/32 [==============================] - 0s 969us/step - loss: 7881.1904
Epoch 169/500
32/32 [==============================] - 0s 1ms/step - loss: 7876.7354
Epoch 170/500
32/32 [==============================] - 0s 1ms/step - loss: 7872.7598
Epoch 171/500
32/32 [==============================] - 0s 875us/step - loss: 7868.1450
Epoch 172/500
32/32 [==============================] - 0s 906us/step - loss: 7864.0166
Epoch 173/500
32/32 [==============================] - 0s 656us/step - loss: 7859.6499
Epoch 174/500
32/32 [==============================] - 0s 812us/step - loss: 7855.3604
Epoch 175/500
32/32 [==============================] - 0s 781us/step - loss: 7851.0732
Epoch 176/500
32/32 [==============================] - 0s 693us/step - loss: 7846.8442
Epoch 177/500
32/32 [==============================] - 0s 781us/step - loss: 7842.6929
Epoch 178/500
32/32 [==============================] - 0s 656us/step - loss: 7838.5112
Epoch 179/500
32/32 [==============================] - 0s 655us/step - loss: 7834.2178
Epoch 180/500
32/32 [==============================] - 0s 687us/step - loss: 7830.2461
Epoch 181/500
32/32 [==============================] - 0s 719us/step - loss: 7825.6880
Epoch 182/500
32/32 [==============================] - 0s 781us/step - loss: 7821.5166
Epoch 183/500
32/32 [==============================] - 0s 719us/step - loss: 7817.2363
Epoch 184/500
32/32 [==============================] - 0s 719us/step - loss: 7812.9214
Epoch 185/500
32/32 [==============================] - 0s 908us/step - loss: 7808.9399
Epoch 186/500
32/32 [==============================] - 0s 1ms/step - loss: 7804.7261
Epoch 187/500
32/32 [==============================] - 0s 1ms/step - loss: 7800.5605
Epoch 188/500
32/32 [==============================] - 0s 906us/step - loss: 7796.4097
Epoch 189/500
32/32 [==============================] - 0s 1000us/step - loss: 7792.1855
Epoch 190/500
32/32 [==============================] - 0s 1ms/step - loss: 7787.9346
Epoch 191/500
32/32 [==============================] - 0s 1ms/step - loss: 7783.7437
Epoch 192/500
32/32 [==============================] - 0s 969us/step - loss: 7779.6348
Epoch 193/500
32/32 [==============================] - 0s 937us/step - loss: 7775.4243
Epoch 194/500
32/32 [==============================] - 0s 937us/step - loss: 7771.2109
Epoch 195/500
32/32 [==============================] - 0s 937us/step - loss: 7767.1436
Epoch 196/500
32/32 [==============================] - 0s 891us/step - loss: 7762.9502
Epoch 197/500
32/32 [==============================] - 0s 751us/step - loss: 7758.7612
Epoch 198/500
32/32 [==============================] - 0s 750us/step - loss: 7754.6460
Epoch 199/500
32/32 [==============================] - 0s 736us/step - loss: 7750.4648
Epoch 200/500
32/32 [==============================] - 0s 625us/step - loss: 7746.3042
Epoch 201/500
32/32 [==============================] - 0s 719us/step - loss: 7742.2588
Epoch 202/500
32/32 [==============================] - 0s 705us/step - loss: 7738.0591
Epoch 203/500
32/32 [==============================] - 0s 719us/step - loss: 7733.9380
Epoch 204/500
32/32 [==============================] - 0s 625us/step - loss: 7729.9580
Epoch 205/500
32/32 [==============================] - 0s 781us/step - loss: 7725.7495
Epoch 206/500
32/32 [==============================] - 0s 719us/step - loss: 7721.6260
Epoch 207/500
32/32 [==============================] - 0s 688us/step - loss: 7717.3721
Epoch 208/500
32/32 [==============================] - 0s 594us/step - loss: 7713.3066
Epoch 209/500
32/32 [==============================] - 0s 625us/step - loss: 7708.9678
Epoch 210/500
32/32 [==============================] - 0s 688us/step - loss: 7704.7769
Epoch 211/500
32/32 [==============================] - 0s 688us/step - loss: 7700.9736
Epoch 212/500
32/32 [==============================] - 0s 594us/step - loss: 7696.4795
Epoch 213/500
32/32 [==============================] - 0s 688us/step - loss: 7692.4111
Epoch 214/500
32/32 [==============================] - 0s 625us/step - loss: 7688.3911
Epoch 215/500
32/32 [==============================] - 0s 594us/step - loss: 7684.3003
Epoch 216/500
32/32 [==============================] - 0s 656us/step - loss: 7680.1855
Epoch 217/500
32/32 [==============================] - 0s 656us/step - loss: 7676.0527
Epoch 218/500
32/32 [==============================] - 0s 656us/step - loss: 7671.9937
Epoch 219/500
32/32 [==============================] - 0s 594us/step - loss: 7667.8564
Epoch 220/500
32/32 [==============================] - 0s 688us/step - loss: 7663.7856
Epoch 221/500
32/32 [==============================] - 0s 656us/step - loss: 7659.8013
Epoch 222/500
32/32 [==============================] - 0s 594us/step - loss: 7655.6187
Epoch 223/500
32/32 [==============================] - 0s 625us/step - loss: 7651.7041
Epoch 224/500
32/32 [==============================] - 0s 688us/step - loss: 7647.6284
Epoch 225/500
32/32 [==============================] - 0s 688us/step - loss: 7643.6455
Epoch 226/500
32/32 [==============================] - 0s 563us/step - loss: 7639.6450
Epoch 227/500
32/32 [==============================] - 0s 696us/step - loss: 7635.8906
Epoch 228/500
32/32 [==============================] - 0s 656us/step - loss: 7631.7114
Epoch 229/500
32/32 [==============================] - 0s 594us/step - loss: 7627.6768
Epoch 230/500
32/32 [==============================] - 0s 670us/step - loss: 7623.5190
Epoch 231/500
32/32 [==============================] - 0s 665us/step - loss: 7619.5859
Epoch 232/500
32/32 [==============================] - 0s 531us/step - loss: 7615.4365
Epoch 233/500
32/32 [==============================] - 0s 625us/step - loss: 7611.4951
Epoch 234/500
32/32 [==============================] - 0s 627us/step - loss: 7607.4507
Epoch 235/500
32/32 [==============================] - 0s 656us/step - loss: 7603.5234
Epoch 236/500
32/32 [==============================] - 0s 563us/step - loss: 7599.4746
Epoch 237/500
32/32 [==============================] - 0s 656us/step - loss: 7595.5356
Epoch 238/500
32/32 [==============================] - 0s 637us/step - loss: 7591.5029
Epoch 239/500
32/32 [==============================] - 0s 562us/step - loss: 7587.4858
Epoch 240/500
32/32 [==============================] - 0s 625us/step - loss: 7583.5220
Epoch 241/500
32/32 [==============================] - 0s 627us/step - loss: 7579.4819
Epoch 242/500
32/32 [==============================] - 0s 562us/step - loss: 7575.4580
Epoch 243/500
32/32 [==============================] - 0s 625us/step - loss: 7571.5322
Epoch 244/500
32/32 [==============================] - 0s 688us/step - loss: 7567.5098
Epoch 245/500
32/32 [==============================] - 0s 563us/step - loss: 7563.5967
Epoch 246/500
32/32 [==============================] - 0s 656us/step - loss: 7559.6260
Epoch 247/500
32/32 [==============================] - 0s 687us/step - loss: 7555.6724
Epoch 248/500
32/32 [==============================] - 0s 562us/step - loss: 7551.5430
Epoch 249/500
32/32 [==============================] - 0s 656us/step - loss: 7547.6709
Epoch 250/500
32/32 [==============================] - 0s 656us/step - loss: 7543.6953
Epoch 251/500
32/32 [==============================] - 0s 660us/step - loss: 7539.7373
Epoch 252/500
32/32 [==============================] - 0s 625us/step - loss: 7535.8071
Epoch 253/500
32/32 [==============================] - 0s 688us/step - loss: 7531.8159
Epoch 254/500
32/32 [==============================] - 0s 661us/step - loss: 7527.8398
Epoch 255/500
32/32 [==============================] - 0s 562us/step - loss: 7523.8623
Epoch 256/500
32/32 [==============================] - 0s 694us/step - loss: 7520.0542
Epoch 257/500
32/32 [==============================] - 0s 688us/step - loss: 7515.9902
Epoch 258/500
32/32 [==============================] - 0s 625us/step - loss: 7512.0908
Epoch 259/500
32/32 [==============================] - 0s 573us/step - loss: 7508.3242
Epoch 260/500
32/32 [==============================] - 0s 663us/step - loss: 7504.1758
Epoch 261/500
32/32 [==============================] - 0s 688us/step - loss: 7500.3003
Epoch 262/500
32/32 [==============================] - 0s 750us/step - loss: 7496.3320
Epoch 263/500
32/32 [==============================] - 0s 844us/step - loss: 7492.4800
Epoch 264/500
32/32 [==============================] - 0s 719us/step - loss: 7488.5215
Epoch 265/500
32/32 [==============================] - 0s 718us/step - loss: 7484.5972
Epoch 266/500
32/32 [==============================] - 0s 906us/step - loss: 7480.6318
Epoch 267/500
32/32 [==============================] - 0s 937us/step - loss: 7476.7061
Epoch 268/500
32/32 [==============================] - 0s 969us/step - loss: 7472.7485
Epoch 269/500
32/32 [==============================] - 0s 938us/step - loss: 7468.8188
Epoch 270/500
32/32 [==============================] - 0s 969us/step - loss: 7464.8726
Epoch 271/500
32/32 [==============================] - 0s 1ms/step - loss: 7461.0049
Epoch 272/500
32/32 [==============================] - 0s 718us/step - loss: 7457.0562
Epoch 273/500
32/32 [==============================] - 0s 781us/step - loss: 7453.2144
Epoch 274/500
32/32 [==============================] - 0s 667us/step - loss: 7449.3364
Epoch 275/500
32/32 [==============================] - 0s 625us/step - loss: 7445.3843
Epoch 276/500
32/32 [==============================] - 0s 687us/step - loss: 7441.4375
Epoch 277/500
32/32 [==============================] - 0s 719us/step - loss: 7437.5093
Epoch 278/500
32/32 [==============================] - 0s 656us/step - loss: 7433.5669
Epoch 279/500
32/32 [==============================] - 0s 687us/step - loss: 7429.6782
Epoch 280/500
32/32 [==============================] - 0s 687us/step - loss: 7425.8027
Epoch 281/500
32/32 [==============================] - 0s 687us/step - loss: 7421.8154
Epoch 282/500
32/32 [==============================] - 0s 656us/step - loss: 7417.9775
Epoch 283/500
32/32 [==============================] - 0s 843us/step - loss: 7414.0576
Epoch 284/500
32/32 [==============================] - 0s 844us/step - loss: 7410.2178
Epoch 285/500
32/32 [==============================] - 0s 1ms/step - loss: 7406.3062
Epoch 286/500
32/32 [==============================] - 0s 1000us/step - loss: 7402.4854
Epoch 287/500
32/32 [==============================] - 0s 1ms/step - loss: 7398.7100
Epoch 288/500
32/32 [==============================] - 0s 1ms/step - loss: 7394.8101
Epoch 289/500
32/32 [==============================] - 0s 968us/step - loss: 7390.9175
Epoch 290/500
32/32 [==============================] - 0s 750us/step - loss: 7387.1064
Epoch 291/500
32/32 [==============================] - 0s 813us/step - loss: 7383.2681
Epoch 292/500
32/32 [==============================] - 0s 750us/step - loss: 7379.3813
Epoch 293/500
32/32 [==============================] - 0s 625us/step - loss: 7375.5107
Epoch 294/500
32/32 [==============================] - 0s 813us/step - loss: 7371.6904
Epoch 295/500
32/32 [==============================] - 0s 719us/step - loss: 7367.8589
Epoch 296/500
32/32 [==============================] - 0s 829us/step - loss: 7363.9614
Epoch 297/500
32/32 [==============================] - 0s 813us/step - loss: 7360.1758
Epoch 298/500
32/32 [==============================] - 0s 594us/step - loss: 7356.3340
Epoch 299/500
32/32 [==============================] - 0s 719us/step - loss: 7352.4355
Epoch 300/500
32/32 [==============================] - 0s 687us/step - loss: 7348.5908
Epoch 301/500
32/32 [==============================] - 0s 766us/step - loss: 7344.8550
Epoch 302/500
32/32 [==============================] - 0s 657us/step - loss: 7340.8379
Epoch 303/500
32/32 [==============================] - 0s 625us/step - loss: 7337.0757
Epoch 304/500
32/32 [==============================] - 0s 688us/step - loss: 7333.2344
Epoch 305/500
32/32 [==============================] - 0s 781us/step - loss: 7329.3628
Epoch 306/500
32/32 [==============================] - 0s 750us/step - loss: 7325.4800
Epoch 307/500
32/32 [==============================] - 0s 594us/step - loss: 7321.6826
Epoch 308/500
32/32 [==============================] - 0s 656us/step - loss: 7317.9395
Epoch 309/500
32/32 [==============================] - 0s 766us/step - loss: 7314.0835
Epoch 310/500
32/32 [==============================] - 0s 719us/step - loss: 7310.0977
Epoch 311/500
32/32 [==============================] - 0s 562us/step - loss: 7306.3315
Epoch 312/500
32/32 [==============================] - 0s 656us/step - loss: 7302.7451
Epoch 313/500
32/32 [==============================] - 0s 813us/step - loss: 7298.7437
Epoch 314/500
32/32 [==============================] - 0s 719us/step - loss: 7294.9575
Epoch 315/500
32/32 [==============================] - 0s 594us/step - loss: 7291.1489
Epoch 316/500
32/32 [==============================] - 0s 656us/step - loss: 7287.3423
Epoch 317/500
32/32 [==============================] - 0s 750us/step - loss: 7283.6079
Epoch 318/500
32/32 [==============================] - 0s 625us/step - loss: 7279.7778
Epoch 319/500
32/32 [==============================] - 0s 656us/step - loss: 7276.0107
Epoch 320/500
32/32 [==============================] - 0s 688us/step - loss: 7272.1284
Epoch 321/500
32/32 [==============================] - 0s 781us/step - loss: 7268.3999
Epoch 322/500
32/32 [==============================] - 0s 656us/step - loss: 7264.5962
Epoch 323/500
32/32 [==============================] - 0s 593us/step - loss: 7260.7686
Epoch 324/500
32/32 [==============================] - 0s 687us/step - loss: 7257.0459
Epoch 325/500
32/32 [==============================] - 0s 811us/step - loss: 7253.1553
Epoch 326/500
32/32 [==============================] - 0s 688us/step - loss: 7249.5107
Epoch 327/500
32/32 [==============================] - 0s 562us/step - loss: 7245.6494
Epoch 328/500
32/32 [==============================] - 0s 656us/step - loss: 7241.9341
Epoch 329/500
32/32 [==============================] - 0s 719us/step - loss: 7238.1323
Epoch 330/500
32/32 [==============================] - 0s 656us/step - loss: 7234.2720
Epoch 331/500
32/32 [==============================] - 0s 594us/step - loss: 7230.5107
Epoch 332/500
32/32 [==============================] - 0s 688us/step - loss: 7226.7437
Epoch 333/500
32/32 [==============================] - 0s 781us/step - loss: 7222.9800
Epoch 334/500
32/32 [==============================] - 0s 750us/step - loss: 7219.2202
Epoch 335/500
32/32 [==============================] - 0s 594us/step - loss: 7215.5151
Epoch 336/500
32/32 [==============================] - 0s 656us/step - loss: 7211.7490
Epoch 337/500
32/32 [==============================] - 0s 781us/step - loss: 7208.0010
Epoch 338/500
32/32 [==============================] - 0s 751us/step - loss: 7204.3110
Epoch 339/500
32/32 [==============================] - 0s 562us/step - loss: 7200.4609
Epoch 340/500
32/32 [==============================] - 0s 656us/step - loss: 7196.7354
Epoch 341/500
32/32 [==============================] - 0s 750us/step - loss: 7193.0942
Epoch 342/500
32/32 [==============================] - 0s 656us/step - loss: 7189.3159
Epoch 343/500
32/32 [==============================] - 0s 593us/step - loss: 7185.5508
Epoch 344/500
32/32 [==============================] - 0s 656us/step - loss: 7181.7866
Epoch 345/500
32/32 [==============================] - 0s 787us/step - loss: 7178.0996
Epoch 346/500
32/32 [==============================] - 0s 687us/step - loss: 7174.4136
Epoch 347/500
32/32 [==============================] - 0s 594us/step - loss: 7170.6489
Epoch 348/500
32/32 [==============================] - 0s 687us/step - loss: 7166.9316
Epoch 349/500
32/32 [==============================] - 0s 750us/step - loss: 7163.0981
Epoch 350/500
32/32 [==============================] - 0s 656us/step - loss: 7159.3398
Epoch 351/500
32/32 [==============================] - 0s 594us/step - loss: 7155.6777
Epoch 352/500
32/32 [==============================] - 0s 688us/step - loss: 7151.9331
Epoch 353/500
32/32 [==============================] - 0s 750us/step - loss: 7148.2490
Epoch 354/500
32/32 [==============================] - 0s 531us/step - loss: 7144.4526
Epoch 355/500
32/32 [==============================] - 0s 625us/step - loss: 7140.7886
Epoch 356/500
32/32 [==============================] - 0s 750us/step - loss: 7137.0918
Epoch 357/500
32/32 [==============================] - 0s 625us/step - loss: 7133.3394
Epoch 358/500
32/32 [==============================] - 0s 593us/step - loss: 7129.6519
Epoch 359/500
32/32 [==============================] - 0s 656us/step - loss: 7126.0210
Epoch 360/500
32/32 [==============================] - 0s 719us/step - loss: 7122.2588
Epoch 361/500
32/32 [==============================] - 0s 578us/step - loss: 7118.5518
Epoch 362/500
32/32 [==============================] - 0s 625us/step - loss: 7114.9014
Epoch 363/500
32/32 [==============================] - 0s 719us/step - loss: 7111.1069
Epoch 364/500
32/32 [==============================] - 0s 656us/step - loss: 7107.4258
Epoch 365/500
32/32 [==============================] - 0s 625us/step - loss: 7103.6992
Epoch 366/500
32/32 [==============================] - 0s 719us/step - loss: 7100.0439
Epoch 367/500
32/32 [==============================] - 0s 750us/step - loss: 7096.3730
Epoch 368/500
32/32 [==============================] - 0s 625us/step - loss: 7092.7114
Epoch 369/500
32/32 [==============================] - 0s 625us/step - loss: 7089.2495
Epoch 370/500
32/32 [==============================] - 0s 688us/step - loss: 7085.3447
Epoch 371/500
32/32 [==============================] - 0s 750us/step - loss: 7081.6270
Epoch 372/500
32/32 [==============================] - 0s 531us/step - loss: 7077.9287
Epoch 373/500
32/32 [==============================] - 0s 656us/step - loss: 7074.2876
Epoch 374/500
32/32 [==============================] - 0s 750us/step - loss: 7070.5845
Epoch 375/500
32/32 [==============================] - 0s 625us/step - loss: 7066.9429
Epoch 376/500
32/32 [==============================] - 0s 562us/step - loss: 7063.2671
Epoch 377/500
32/32 [==============================] - 0s 688us/step - loss: 7059.5000
Epoch 378/500
32/32 [==============================] - 0s 750us/step - loss: 7055.8027
Epoch 379/500
32/32 [==============================] - 0s 687us/step - loss: 7052.1343
Epoch 380/500
32/32 [==============================] - 0s 625us/step - loss: 7048.5259
Epoch 381/500
32/32 [==============================] - 0s 656us/step - loss: 7044.7095
Epoch 382/500
32/32 [==============================] - 0s 750us/step - loss: 7041.0957
Epoch 383/500
32/32 [==============================] - 0s 656us/step - loss: 7037.4956
Epoch 384/500
32/32 [==============================] - 0s 688us/step - loss: 7033.8354
Epoch 385/500
32/32 [==============================] - 0s 625us/step - loss: 7030.1089
Epoch 386/500
32/32 [==============================] - 0s 782us/step - loss: 7026.5322
Epoch 387/500
32/32 [==============================] - 0s 563us/step - loss: 7022.8081
Epoch 388/500
32/32 [==============================] - 0s 656us/step - loss: 7019.1279
Epoch 389/500
32/32 [==============================] - 0s 750us/step - loss: 7015.5137
Epoch 390/500
32/32 [==============================] - 0s 656us/step - loss: 7011.9321
Epoch 391/500
32/32 [==============================] - 0s 562us/step - loss: 7008.2505
Epoch 392/500
32/32 [==============================] - 0s 656us/step - loss: 7004.5435
Epoch 393/500
32/32 [==============================] - 0s 750us/step - loss: 7000.9448
Epoch 394/500
32/32 [==============================] - 0s 562us/step - loss: 6997.3315
Epoch 395/500
32/32 [==============================] - 0s 687us/step - loss: 6993.7368
Epoch 396/500
32/32 [==============================] - 0s 687us/step - loss: 6990.1904
Epoch 397/500
32/32 [==============================] - 0s 688us/step - loss: 6986.5649
Epoch 398/500
32/32 [==============================] - 0s 562us/step - loss: 6982.9780
Epoch 399/500
32/32 [==============================] - 0s 625us/step - loss: 6979.3721
Epoch 400/500
32/32 [==============================] - 0s 750us/step - loss: 6975.8286
Epoch 401/500
32/32 [==============================] - 0s 563us/step - loss: 6972.1313
Epoch 402/500
32/32 [==============================] - 0s 688us/step - loss: 6968.5786
Epoch 403/500
32/32 [==============================] - 0s 719us/step - loss: 6964.8750
Epoch 404/500
32/32 [==============================] - 0s 688us/step - loss: 6961.2788
Epoch 405/500
32/32 [==============================] - 0s 563us/step - loss: 6957.5693
Epoch 406/500
32/32 [==============================] - 0s 688us/step - loss: 6953.9507
Epoch 407/500
32/32 [==============================] - 0s 750us/step - loss: 6950.3394
Epoch 408/500
32/32 [==============================] - 0s 719us/step - loss: 6946.7568
Epoch 409/500
32/32 [==============================] - 0s 562us/step - loss: 6943.1924
Epoch 410/500
32/32 [==============================] - 0s 656us/step - loss: 6939.5454
Epoch 411/500
32/32 [==============================] - 0s 719us/step - loss: 6936.0527
Epoch 412/500
32/32 [==============================] - 0s 656us/step - loss: 6932.3677
Epoch 413/500
32/32 [==============================] - 0s 594us/step - loss: 6928.8066
Epoch 414/500
32/32 [==============================] - 0s 688us/step - loss: 6925.2695
Epoch 415/500
32/32 [==============================] - 0s 750us/step - loss: 6921.5986
Epoch 416/500
32/32 [==============================] - 0s 562us/step - loss: 6918.0439
Epoch 417/500
32/32 [==============================] - 0s 656us/step - loss: 6914.4375
Epoch 418/500
32/32 [==============================] - 0s 750us/step - loss: 6910.9644
Epoch 419/500
32/32 [==============================] - 0s 656us/step - loss: 6907.3379
Epoch 420/500
32/32 [==============================] - 0s 563us/step - loss: 6903.6938
Epoch 421/500
32/32 [==============================] - 0s 719us/step - loss: 6900.1919
Epoch 422/500
32/32 [==============================] - 0s 719us/step - loss: 6896.4902
Epoch 423/500
32/32 [==============================] - 0s 562us/step - loss: 6892.8999
Epoch 424/500
32/32 [==============================] - 0s 656us/step - loss: 6889.2593
Epoch 425/500
32/32 [==============================] - 0s 719us/step - loss: 6885.8291
Epoch 426/500
32/32 [==============================] - 0s 625us/step - loss: 6882.0864
Epoch 427/500
32/32 [==============================] - 0s 594us/step - loss: 6878.4829
Epoch 428/500
32/32 [==============================] - 0s 688us/step - loss: 6874.9888
Epoch 429/500
32/32 [==============================] - 0s 719us/step - loss: 6871.4771
Epoch 430/500
32/32 [==============================] - 0s 562us/step - loss: 6867.9365
Epoch 431/500
32/32 [==============================] - 0s 625us/step - loss: 6864.3521
Epoch 432/500
32/32 [==============================] - 0s 719us/step - loss: 6860.8076
Epoch 433/500
32/32 [==============================] - 0s 531us/step - loss: 6857.2690
Epoch 434/500
32/32 [==============================] - 0s 625us/step - loss: 6853.7310
Epoch 435/500
32/32 [==============================] - 0s 719us/step - loss: 6850.1631
Epoch 436/500
32/32 [==============================] - 0s 688us/step - loss: 6846.5879
Epoch 437/500
32/32 [==============================] - 0s 562us/step - loss: 6843.1304
Epoch 438/500
32/32 [==============================] - 0s 688us/step - loss: 6839.4893
Epoch 439/500
32/32 [==============================] - 0s 750us/step - loss: 6835.9917
Epoch 440/500
32/32 [==============================] - 0s 562us/step - loss: 6832.5449
Epoch 441/500
32/32 [==============================] - 0s 656us/step - loss: 6828.9541
Epoch 442/500
32/32 [==============================] - 0s 719us/step - loss: 6825.4907
Epoch 443/500
32/32 [==============================] - 0s 656us/step - loss: 6821.9512
Epoch 444/500
32/32 [==============================] - 0s 594us/step - loss: 6818.5820
Epoch 445/500
32/32 [==============================] - 0s 656us/step - loss: 6814.8403
Epoch 446/500
32/32 [==============================] - 0s 750us/step - loss: 6811.3721
Epoch 447/500
32/32 [==============================] - 0s 531us/step - loss: 6807.8569
Epoch 448/500
32/32 [==============================] - 0s 625us/step - loss: 6804.3511
Epoch 449/500
32/32 [==============================] - 0s 750us/step - loss: 6800.8521
Epoch 450/500
32/32 [==============================] - 0s 563us/step - loss: 6797.3276
Epoch 451/500
32/32 [==============================] - 0s 656us/step - loss: 6793.7817
Epoch 452/500
32/32 [==============================] - 0s 781us/step - loss: 6790.3354
Epoch 453/500
32/32 [==============================] - 0s 688us/step - loss: 6786.7231
Epoch 454/500
32/32 [==============================] - 0s 531us/step - loss: 6783.2300
Epoch 455/500
32/32 [==============================] - 0s 687us/step - loss: 6779.7363
Epoch 456/500
32/32 [==============================] - 0s 750us/step - loss: 6776.2236
Epoch 457/500
32/32 [==============================] - 0s 688us/step - loss: 6772.7368
Epoch 458/500
32/32 [==============================] - 0s 562us/step - loss: 6769.2681
Epoch 459/500
32/32 [==============================] - 0s 625us/step - loss: 6765.7012
Epoch 460/500
32/32 [==============================] - 0s 750us/step - loss: 6762.3223
Epoch 461/500
32/32 [==============================] - 0s 563us/step - loss: 6758.7129
Epoch 462/500
32/32 [==============================] - 0s 656us/step - loss: 6755.2407
Epoch 463/500
32/32 [==============================] - 0s 750us/step - loss: 6751.8179
Epoch 464/500
32/32 [==============================] - 0s 688us/step - loss: 6748.3481
Epoch 465/500
32/32 [==============================] - 0s 562us/step - loss: 6744.8716
Epoch 466/500
32/32 [==============================] - 0s 688us/step - loss: 6741.2954
Epoch 467/500
32/32 [==============================] - 0s 781us/step - loss: 6737.8145
Epoch 468/500
32/32 [==============================] - 0s 782us/step - loss: 6734.3726
Epoch 469/500
32/32 [==============================] - 0s 531us/step - loss: 6730.8618
Epoch 470/500
32/32 [==============================] - 0s 687us/step - loss: 6727.5552
Epoch 471/500
32/32 [==============================] - 0s 781us/step - loss: 6723.8525
Epoch 472/500
32/32 [==============================] - 0s 813us/step - loss: 6720.4175
Epoch 473/500
32/32 [==============================] - 0s 875us/step - loss: 6716.9683
Epoch 474/500
32/32 [==============================] - 0s 750us/step - loss: 6713.5356
Epoch 475/500
32/32 [==============================] - 0s 969us/step - loss: 6710.0112
Epoch 476/500
32/32 [==============================] - 0s 688us/step - loss: 6706.6392
Epoch 477/500
32/32 [==============================] - 0s 781us/step - loss: 6703.1938
Epoch 478/500
32/32 [==============================] - 0s 844us/step - loss: 6699.6294
Epoch 479/500
32/32 [==============================] - 0s 906us/step - loss: 6696.1934
Epoch 480/500
32/32 [==============================] - 0s 750us/step - loss: 6692.7681
Epoch 481/500
32/32 [==============================] - 0s 657us/step - loss: 6689.3599
Epoch 482/500
32/32 [==============================] - 0s 656us/step - loss: 6685.8833
Epoch 483/500
32/32 [==============================] - 0s 781us/step - loss: 6682.3818
Epoch 484/500
32/32 [==============================] - 0s 656us/step - loss: 6678.9937
Epoch 485/500
32/32 [==============================] - 0s 688us/step - loss: 6675.6006
Epoch 486/500
32/32 [==============================] - 0s 656us/step - loss: 6672.0952
Epoch 487/500
32/32 [==============================] - 0s 750us/step - loss: 6668.6089
Epoch 488/500
32/32 [==============================] - 0s 656us/step - loss: 6665.2705
Epoch 489/500
32/32 [==============================] - 0s 594us/step - loss: 6661.8779
Epoch 490/500
32/32 [==============================] - 0s 687us/step - loss: 6658.3960
Epoch 491/500
32/32 [==============================] - 0s 781us/step - loss: 6655.1748
Epoch 492/500
32/32 [==============================] - 0s 687us/step - loss: 6651.6528
Epoch 493/500
32/32 [==============================] - 0s 562us/step - loss: 6648.3403
Epoch 494/500
32/32 [==============================] - 0s 750us/step - loss: 6644.8472
Epoch 495/500
32/32 [==============================] - 0s 875us/step - loss: 6641.3950
Epoch 496/500
32/32 [==============================] - 0s 812us/step - loss: 6637.9453
Epoch 497/500
32/32 [==============================] - 0s 781us/step - loss: 6634.5176
Epoch 498/500
32/32 [==============================] - 0s 813us/step - loss: 6631.0566
Epoch 499/500
32/32 [==============================] - 0s 969us/step - loss: 6627.6553
Epoch 500/500
32/32 [==============================] - 0s 656us/step - loss: 6624.2134
Out[15]:
<tensorflow.python.keras.callbacks.History at 0x1ded8598c70>
In [16]:
# Plot the predictions (on the training set itself).
plt.plot(poly['x'], poly['y'], label='actual')
plt.plot(poly['x'], model.predict(poly['x']), label='prediction')
plt.legend();


Sigmoids


In [17]:
# Change the activation function.
model = kr.models.Sequential()
model.add(kr.layers.Dense(1, input_shape=(1,), activation='sigmoid', kernel_initializer="ones", bias_initializer="zeros"))
model.compile('adam', loss='mean_squared_error')
In [18]:
# Without training, let's have a look at the output.
sigdata = pd.DataFrame()
sigdata['x'] = np.linspace(-10.0, 10.0, 1000)
sigdata['y'] = model.predict(sigdata['x'])
In [19]:
# Let's see what that looks like.
plt.plot(sigdata['x'], sigdata['y']);


Back to the polynomial


In [20]:
# Same polynomial.
f = lambda x: 2.0 * x**2 + 3.0 * x + 4.0

poly = pd.DataFrame()
poly['x'] = np.linspace(-10.0, 10.0, 1000)
poly['y'] = poly['x'].apply(f)
In [21]:
# Train a different model.
model = kr.models.Sequential()
model.add(kr.layers.Dense(50, input_shape=(1,), activation='sigmoid', kernel_initializer="glorot_uniform", bias_initializer="glorot_uniform"))
model.add(kr.layers.Dense(1, activation='linear', kernel_initializer="glorot_uniform", bias_initializer="glorot_uniform"))
model.compile(kr.optimizers.Adam(lr=0.001), loss='mean_squared_error')
In [22]:
# Fit the data.
model.fit(poly['x'], poly['y'], epochs=500, batch_size=10)
Epoch 1/500
100/100 [==============================] - 0s 587us/step - loss: 8406.7930
Epoch 2/500
100/100 [==============================] - 0s 570us/step - loss: 8034.9907
Epoch 3/500
100/100 [==============================] - 0s 560us/step - loss: 7658.4663
Epoch 4/500
100/100 [==============================] - 0s 560us/step - loss: 7281.9727
Epoch 5/500
100/100 [==============================] - 0s 604us/step - loss: 6905.7373
Epoch 6/500
100/100 [==============================] - 0s 612us/step - loss: 6524.1694
Epoch 7/500
100/100 [==============================] - 0s 941us/step - loss: 6147.7598
Epoch 8/500
100/100 [==============================] - 0s 1ms/step - loss: 5789.1157
Epoch 9/500
100/100 [==============================] - 0s 900us/step - loss: 5456.7529
Epoch 10/500
100/100 [==============================] - 0s 740us/step - loss: 5149.8589
Epoch 11/500
100/100 [==============================] - 0s 650us/step - loss: 4886.7017
Epoch 12/500
100/100 [==============================] - 0s 650us/step - loss: 4664.0332
Epoch 13/500
100/100 [==============================] - 0s 680us/step - loss: 4478.5845
Epoch 14/500
100/100 [==============================] - 0s 730us/step - loss: 4322.8916
Epoch 15/500
100/100 [==============================] - 0s 900us/step - loss: 4194.0215
Epoch 16/500
100/100 [==============================] - 0s 860us/step - loss: 4089.2563
Epoch 17/500
100/100 [==============================] - 0s 810us/step - loss: 4004.9253
Epoch 18/500
100/100 [==============================] - 0s 820us/step - loss: 3937.5520
Epoch 19/500
100/100 [==============================] - 0s 690us/step - loss: 3884.6658
Epoch 20/500
100/100 [==============================] - 0s 630us/step - loss: 3842.8428
Epoch 21/500
100/100 [==============================] - 0s 650us/step - loss: 3811.3918
Epoch 22/500
100/100 [==============================] - 0s 740us/step - loss: 3784.9277
Epoch 23/500
100/100 [==============================] - 0s 850us/step - loss: 3763.7393
Epoch 24/500
100/100 [==============================] - 0s 810us/step - loss: 3746.8179
Epoch 25/500
100/100 [==============================] - 0s 840us/step - loss: 3733.4148
Epoch 26/500
100/100 [==============================] - 0s 820us/step - loss: 3720.9695
Epoch 27/500
100/100 [==============================] - 0s 740us/step - loss: 3710.3608
Epoch 28/500
100/100 [==============================] - 0s 690us/step - loss: 3700.8484
Epoch 29/500
100/100 [==============================] - 0s 700us/step - loss: 3690.6313
Epoch 30/500
100/100 [==============================] - 0s 670us/step - loss: 3682.0713
Epoch 31/500
100/100 [==============================] - 0s 650us/step - loss: 3672.0137
Epoch 32/500
100/100 [==============================] - 0s 660us/step - loss: 3663.2170
Epoch 33/500
100/100 [==============================] - 0s 670us/step - loss: 3653.9160
Epoch 34/500
100/100 [==============================] - 0s 740us/step - loss: 3644.8230
Epoch 35/500
100/100 [==============================] - 0s 680us/step - loss: 3636.0273
Epoch 36/500
100/100 [==============================] - 0s 712us/step - loss: 3626.3652
Epoch 37/500
100/100 [==============================] - 0s 670us/step - loss: 3618.3013
Epoch 38/500
100/100 [==============================] - 0s 650us/step - loss: 3608.5818
Epoch 39/500
100/100 [==============================] - 0s 700us/step - loss: 3601.0894
Epoch 40/500
100/100 [==============================] - 0s 720us/step - loss: 3591.5159
Epoch 41/500
100/100 [==============================] - 0s 680us/step - loss: 3581.6321
Epoch 42/500
100/100 [==============================] - 0s 668us/step - loss: 3572.9509
Epoch 43/500
100/100 [==============================] - 0s 680us/step - loss: 3562.3677
Epoch 44/500
100/100 [==============================] - 0s 680us/step - loss: 3553.0962
Epoch 45/500
100/100 [==============================] - 0s 640us/step - loss: 3542.7966
Epoch 46/500
100/100 [==============================] - 0s 660us/step - loss: 3533.0608
Epoch 47/500
100/100 [==============================] - 0s 680us/step - loss: 3523.2715
Epoch 48/500
100/100 [==============================] - 0s 720us/step - loss: 3512.2395
Epoch 49/500
100/100 [==============================] - 0s 730us/step - loss: 3502.9905
Epoch 50/500
100/100 [==============================] - 0s 820us/step - loss: 3489.5527
Epoch 51/500
100/100 [==============================] - 0s 750us/step - loss: 3478.8730
Epoch 52/500
100/100 [==============================] - 0s 920us/step - loss: 3467.5183
Epoch 53/500
100/100 [==============================] - 0s 780us/step - loss: 3455.6687
Epoch 54/500
100/100 [==============================] - 0s 611us/step - loss: 3445.0610
Epoch 55/500
100/100 [==============================] - 0s 590us/step - loss: 3431.9719
Epoch 56/500
100/100 [==============================] - 0s 630us/step - loss: 3421.6274
Epoch 57/500
100/100 [==============================] - 0s 600us/step - loss: 3408.4307
Epoch 58/500
100/100 [==============================] - 0s 600us/step - loss: 3395.8105
Epoch 59/500
100/100 [==============================] - 0s 620us/step - loss: 3384.6282
Epoch 60/500
100/100 [==============================] - 0s 600us/step - loss: 3371.6152
Epoch 61/500
100/100 [==============================] - 0s 600us/step - loss: 3358.4075
Epoch 62/500
100/100 [==============================] - 0s 600us/step - loss: 3346.2773
Epoch 63/500
100/100 [==============================] - 0s 630us/step - loss: 3332.0703
Epoch 64/500
100/100 [==============================] - 0s 590us/step - loss: 3319.1643
Epoch 65/500
100/100 [==============================] - 0s 550us/step - loss: 3306.0784
Epoch 66/500
100/100 [==============================] - 0s 590us/step - loss: 3294.3591
Epoch 67/500
100/100 [==============================] - 0s 600us/step - loss: 3279.6987
Epoch 68/500
100/100 [==============================] - 0s 690us/step - loss: 3267.1792
Epoch 69/500
100/100 [==============================] - 0s 630us/step - loss: 3253.7646
Epoch 70/500
100/100 [==============================] - 0s 630us/step - loss: 3240.3108
Epoch 71/500
100/100 [==============================] - 0s 620us/step - loss: 3227.0200
Epoch 72/500
100/100 [==============================] - 0s 620us/step - loss: 3212.7471
Epoch 73/500
100/100 [==============================] - 0s 610us/step - loss: 3199.0669
Epoch 74/500
100/100 [==============================] - 0s 610us/step - loss: 3185.2566
Epoch 75/500
100/100 [==============================] - 0s 590us/step - loss: 3171.0378
Epoch 76/500
100/100 [==============================] - 0s 705us/step - loss: 3157.0063
Epoch 77/500
100/100 [==============================] - 0s 630us/step - loss: 3142.5896
Epoch 78/500
100/100 [==============================] - 0s 620us/step - loss: 3128.8574
Epoch 79/500
100/100 [==============================] - 0s 650us/step - loss: 3116.0496
Epoch 80/500
100/100 [==============================] - 0s 630us/step - loss: 3100.7212
Epoch 81/500
100/100 [==============================] - 0s 640us/step - loss: 3086.9329
Epoch 82/500
100/100 [==============================] - 0s 630us/step - loss: 3073.1235
Epoch 83/500
100/100 [==============================] - 0s 620us/step - loss: 3059.0854
Epoch 84/500
100/100 [==============================] - 0s 640us/step - loss: 3046.0471
Epoch 85/500
100/100 [==============================] - 0s 640us/step - loss: 3032.2812
Epoch 86/500
100/100 [==============================] - 0s 654us/step - loss: 3019.2742
Epoch 87/500
100/100 [==============================] - 0s 630us/step - loss: 3005.7527
Epoch 88/500
100/100 [==============================] - 0s 595us/step - loss: 2991.6187
Epoch 89/500
100/100 [==============================] - 0s 570us/step - loss: 2978.3599
Epoch 90/500
100/100 [==============================] - 0s 640us/step - loss: 2964.2063
Epoch 91/500
100/100 [==============================] - 0s 610us/step - loss: 2951.0325
Epoch 92/500
100/100 [==============================] - 0s 630us/step - loss: 2937.5479
Epoch 93/500
100/100 [==============================] - 0s 620us/step - loss: 2925.1436
Epoch 94/500
100/100 [==============================] - 0s 640us/step - loss: 2911.4128
Epoch 95/500
100/100 [==============================] - 0s 600us/step - loss: 2899.1082
Epoch 96/500
100/100 [==============================] - 0s 580us/step - loss: 2886.8037
Epoch 97/500
100/100 [==============================] - 0s 610us/step - loss: 2873.6155
Epoch 98/500
100/100 [==============================] - 0s 590us/step - loss: 2859.4001
Epoch 99/500
100/100 [==============================] - 0s 600us/step - loss: 2847.7937
Epoch 100/500
100/100 [==============================] - 0s 560us/step - loss: 2835.4595
Epoch 101/500
100/100 [==============================] - 0s 580us/step - loss: 2821.8120
Epoch 102/500
100/100 [==============================] - 0s 610us/step - loss: 2808.9675
Epoch 103/500
100/100 [==============================] - 0s 600us/step - loss: 2796.7104
Epoch 104/500
100/100 [==============================] - 0s 560us/step - loss: 2783.7854
Epoch 105/500
100/100 [==============================] - 0s 520us/step - loss: 2771.6394
Epoch 106/500
100/100 [==============================] - 0s 571us/step - loss: 2760.2510
Epoch 107/500
100/100 [==============================] - 0s 600us/step - loss: 2747.9722
Epoch 108/500
100/100 [==============================] - 0s 620us/step - loss: 2735.8464
Epoch 109/500
100/100 [==============================] - 0s 590us/step - loss: 2722.8391
Epoch 110/500
100/100 [==============================] - 0s 610us/step - loss: 2711.7773
Epoch 111/500
100/100 [==============================] - 0s 580us/step - loss: 2699.0081
Epoch 112/500
100/100 [==============================] - 0s 520us/step - loss: 2686.8052
Epoch 113/500
100/100 [==============================] - 0s 565us/step - loss: 2675.2195
Epoch 114/500
100/100 [==============================] - 0s 566us/step - loss: 2664.7432
Epoch 115/500
100/100 [==============================] - 0s 600us/step - loss: 2652.0408
Epoch 116/500
100/100 [==============================] - 0s 561us/step - loss: 2640.8838
Epoch 117/500
100/100 [==============================] - 0s 583us/step - loss: 2628.8865
Epoch 118/500
100/100 [==============================] - 0s 600us/step - loss: 2618.0925
Epoch 119/500
100/100 [==============================] - 0s 600us/step - loss: 2605.8420
Epoch 120/500
100/100 [==============================] - 0s 600us/step - loss: 2594.9463
Epoch 121/500
100/100 [==============================] - 0s 726us/step - loss: 2583.6919
Epoch 122/500
100/100 [==============================] - 0s 850us/step - loss: 2573.0093
Epoch 123/500
100/100 [==============================] - 0s 655us/step - loss: 2563.3564
Epoch 124/500
100/100 [==============================] - 0s 640us/step - loss: 2551.1692
Epoch 125/500
100/100 [==============================] - 0s 643us/step - loss: 2539.4197
Epoch 126/500
100/100 [==============================] - 0s 654us/step - loss: 2528.7974
Epoch 127/500
100/100 [==============================] - 0s 620us/step - loss: 2518.1843
Epoch 128/500
100/100 [==============================] - 0s 652us/step - loss: 2508.3259
Epoch 129/500
100/100 [==============================] - 0s 622us/step - loss: 2497.0425
Epoch 130/500
100/100 [==============================] - 0s 628us/step - loss: 2489.1694
Epoch 131/500
100/100 [==============================] - 0s 684us/step - loss: 2476.1042
Epoch 132/500
100/100 [==============================] - 0s 643us/step - loss: 2465.7212
Epoch 133/500
100/100 [==============================] - 0s 669us/step - loss: 2455.7161
Epoch 134/500
100/100 [==============================] - 0s 741us/step - loss: 2445.5198
Epoch 135/500
100/100 [==============================] - 0s 723us/step - loss: 2435.3984
Epoch 136/500
100/100 [==============================] - 0s 615us/step - loss: 2425.5208
Epoch 137/500
100/100 [==============================] - 0s 631us/step - loss: 2415.1628
Epoch 138/500
100/100 [==============================] - 0s 600us/step - loss: 2405.3369
Epoch 139/500
100/100 [==============================] - 0s 650us/step - loss: 2395.7661
Epoch 140/500
100/100 [==============================] - 0s 590us/step - loss: 2385.0234
Epoch 141/500
100/100 [==============================] - 0s 570us/step - loss: 2375.4180
Epoch 142/500
100/100 [==============================] - 0s 610us/step - loss: 2367.7695
Epoch 143/500
100/100 [==============================] - 0s 654us/step - loss: 2356.5784
Epoch 144/500
100/100 [==============================] - 0s 607us/step - loss: 2346.8579
Epoch 145/500
100/100 [==============================] - 0s 590us/step - loss: 2337.3567
Epoch 146/500
100/100 [==============================] - 0s 645us/step - loss: 2328.2407
Epoch 147/500
100/100 [==============================] - 0s 610us/step - loss: 2319.7646
Epoch 148/500
100/100 [==============================] - 0s 669us/step - loss: 2309.8862
Epoch 149/500
100/100 [==============================] - 0s 671us/step - loss: 2300.6267
Epoch 150/500
100/100 [==============================] - 0s 673us/step - loss: 2290.9712
Epoch 151/500
100/100 [==============================] - 0s 679us/step - loss: 2281.8149
Epoch 152/500
100/100 [==============================] - 0s 643us/step - loss: 2272.8201
Epoch 153/500
100/100 [==============================] - 0s 690us/step - loss: 2264.4119
Epoch 154/500
100/100 [==============================] - 0s 671us/step - loss: 2255.9836
Epoch 155/500
100/100 [==============================] - 0s 741us/step - loss: 2245.6584
Epoch 156/500
100/100 [==============================] - 0s 740us/step - loss: 2236.9771
Epoch 157/500
100/100 [==============================] - 0s 770us/step - loss: 2227.9993
Epoch 158/500
100/100 [==============================] - 0s 811us/step - loss: 2218.6279
Epoch 159/500
100/100 [==============================] - 0s 693us/step - loss: 2209.7734
Epoch 160/500
100/100 [==============================] - 0s 677us/step - loss: 2200.1990
Epoch 161/500
100/100 [==============================] - 0s 678us/step - loss: 2190.6838
Epoch 162/500
100/100 [==============================] - 0s 682us/step - loss: 2181.8462
Epoch 163/500
100/100 [==============================] - 0s 665us/step - loss: 2172.5442
Epoch 164/500
100/100 [==============================] - 0s 680us/step - loss: 2163.6440
Epoch 165/500
100/100 [==============================] - 0s 910us/step - loss: 2154.9680
Epoch 166/500
100/100 [==============================] - 0s 706us/step - loss: 2145.3872
Epoch 167/500
100/100 [==============================] - 0s 581us/step - loss: 2137.7632
Epoch 168/500
100/100 [==============================] - 0s 563us/step - loss: 2127.9553
Epoch 169/500
100/100 [==============================] - 0s 548us/step - loss: 2119.2058
Epoch 170/500
100/100 [==============================] - 0s 538us/step - loss: 2111.1235
Epoch 171/500
100/100 [==============================] - 0s 562us/step - loss: 2102.0784
Epoch 172/500
100/100 [==============================] - 0s 552us/step - loss: 2093.7898
Epoch 173/500
100/100 [==============================] - 0s 540us/step - loss: 2084.8970
Epoch 174/500
100/100 [==============================] - 0s 571us/step - loss: 2077.6267
Epoch 175/500
100/100 [==============================] - 0s 550us/step - loss: 2068.8945
Epoch 176/500
100/100 [==============================] - 0s 513us/step - loss: 2061.2876
Epoch 177/500
100/100 [==============================] - 0s 523us/step - loss: 2052.6814
Epoch 178/500
100/100 [==============================] - 0s 520us/step - loss: 2043.7861
Epoch 179/500
100/100 [==============================] - 0s 491us/step - loss: 2035.9341
Epoch 180/500
100/100 [==============================] - 0s 570us/step - loss: 2028.3456
Epoch 181/500
100/100 [==============================] - 0s 560us/step - loss: 2019.8577
Epoch 182/500
100/100 [==============================] - 0s 553us/step - loss: 2012.1025
Epoch 183/500
100/100 [==============================] - 0s 498us/step - loss: 2003.8882
Epoch 184/500
100/100 [==============================] - 0s 535us/step - loss: 1998.1168
Epoch 185/500
100/100 [==============================] - 0s 483us/step - loss: 1988.5083
Epoch 186/500
100/100 [==============================] - 0s 512us/step - loss: 1982.0416
Epoch 187/500
100/100 [==============================] - 0s 552us/step - loss: 1973.4919
Epoch 188/500
100/100 [==============================] - 0s 493us/step - loss: 1966.3995
Epoch 189/500
100/100 [==============================] - 0s 524us/step - loss: 1957.8893
Epoch 190/500
100/100 [==============================] - 0s 500us/step - loss: 1950.2944
Epoch 191/500
100/100 [==============================] - 0s 544us/step - loss: 1942.1133
Epoch 192/500
100/100 [==============================] - 0s 540us/step - loss: 1935.3716
Epoch 193/500
100/100 [==============================] - 0s 490us/step - loss: 1926.7341
Epoch 194/500
100/100 [==============================] - 0s 560us/step - loss: 1918.2802
Epoch 195/500
100/100 [==============================] - 0s 535us/step - loss: 1910.6598
Epoch 196/500
100/100 [==============================] - 0s 485us/step - loss: 1902.6924
Epoch 197/500
100/100 [==============================] - 0s 500us/step - loss: 1894.3600
Epoch 198/500
100/100 [==============================] - 0s 472us/step - loss: 1887.1858
Epoch 199/500
100/100 [==============================] - 0s 513us/step - loss: 1878.7340
Epoch 200/500
100/100 [==============================] - 0s 470us/step - loss: 1872.0421
Epoch 201/500
100/100 [==============================] - 0s 520us/step - loss: 1863.1088
Epoch 202/500
100/100 [==============================] - 0s 550us/step - loss: 1855.3226
Epoch 203/500
100/100 [==============================] - 0s 490us/step - loss: 1847.6179
Epoch 204/500
100/100 [==============================] - 0s 533us/step - loss: 1839.4690
Epoch 205/500
100/100 [==============================] - 0s 530us/step - loss: 1832.0309
Epoch 206/500
100/100 [==============================] - 0s 490us/step - loss: 1824.4868
Epoch 207/500
100/100 [==============================] - 0s 541us/step - loss: 1816.8145
Epoch 208/500
100/100 [==============================] - 0s 480us/step - loss: 1808.9758
Epoch 209/500
100/100 [==============================] - 0s 493us/step - loss: 1802.6658
Epoch 210/500
100/100 [==============================] - 0s 512us/step - loss: 1794.2003
Epoch 211/500
100/100 [==============================] - 0s 514us/step - loss: 1787.4070
Epoch 212/500
100/100 [==============================] - 0s 544us/step - loss: 1779.2148
Epoch 213/500
100/100 [==============================] - 0s 556us/step - loss: 1770.9768
Epoch 214/500
100/100 [==============================] - 0s 500us/step - loss: 1764.6671
Epoch 215/500
100/100 [==============================] - 0s 542us/step - loss: 1755.9924
Epoch 216/500
100/100 [==============================] - 0s 521us/step - loss: 1748.7468
Epoch 217/500
100/100 [==============================] - 0s 511us/step - loss: 1741.6775
Epoch 218/500
100/100 [==============================] - 0s 530us/step - loss: 1733.6353
Epoch 219/500
100/100 [==============================] - 0s 490us/step - loss: 1726.9139
Epoch 220/500
100/100 [==============================] - 0s 520us/step - loss: 1719.0731
Epoch 221/500
100/100 [==============================] - 0s 530us/step - loss: 1710.7507
Epoch 222/500
100/100 [==============================] - 0s 497us/step - loss: 1703.3826
Epoch 223/500
100/100 [==============================] - 0s 545us/step - loss: 1695.2811
Epoch 224/500
100/100 [==============================] - 0s 550us/step - loss: 1687.1899
Epoch 225/500
100/100 [==============================] - 0s 520us/step - loss: 1679.6121
Epoch 226/500
100/100 [==============================] - 0s 539us/step - loss: 1670.5864
Epoch 227/500
100/100 [==============================] - 0s 540us/step - loss: 1662.1449
Epoch 228/500
100/100 [==============================] - 0s 480us/step - loss: 1653.5986
Epoch 229/500
100/100 [==============================] - 0s 540us/step - loss: 1644.7386
Epoch 230/500
100/100 [==============================] - 0s 532us/step - loss: 1635.5969
Epoch 231/500
100/100 [==============================] - 0s 515us/step - loss: 1626.1292
Epoch 232/500
100/100 [==============================] - 0s 543us/step - loss: 1616.8406
Epoch 233/500
100/100 [==============================] - 0s 490us/step - loss: 1607.3746
Epoch 234/500
100/100 [==============================] - 0s 490us/step - loss: 1596.8065
Epoch 235/500
100/100 [==============================] - 0s 520us/step - loss: 1586.8231
Epoch 236/500
100/100 [==============================] - 0s 500us/step - loss: 1576.6910
Epoch 237/500
100/100 [==============================] - 0s 531us/step - loss: 1565.9897
Epoch 238/500
100/100 [==============================] - 0s 494us/step - loss: 1555.5680
Epoch 239/500
100/100 [==============================] - 0s 540us/step - loss: 1544.1771
Epoch 240/500
100/100 [==============================] - 0s 584us/step - loss: 1533.7097
Epoch 241/500
100/100 [==============================] - 0s 670us/step - loss: 1520.5920
Epoch 242/500
100/100 [==============================] - 0s 1ms/step - loss: 1509.2278
Epoch 243/500
100/100 [==============================] - 0s 760us/step - loss: 1496.1097
Epoch 244/500
100/100 [==============================] - 0s 640us/step - loss: 1482.7712
Epoch 245/500
100/100 [==============================] - 0s 630us/step - loss: 1469.5511
Epoch 246/500
100/100 [==============================] - 0s 630us/step - loss: 1455.8671
Epoch 247/500
100/100 [==============================] - 0s 640us/step - loss: 1442.3164
Epoch 248/500
100/100 [==============================] - 0s 620us/step - loss: 1428.1835
Epoch 249/500
100/100 [==============================] - 0s 610us/step - loss: 1413.6304
Epoch 250/500
100/100 [==============================] - 0s 630us/step - loss: 1399.2766
Epoch 251/500
100/100 [==============================] - 0s 630us/step - loss: 1384.5674
Epoch 252/500
100/100 [==============================] - 0s 620us/step - loss: 1369.0695
Epoch 253/500
100/100 [==============================] - 0s 620us/step - loss: 1354.0446
Epoch 254/500
100/100 [==============================] - 0s 620us/step - loss: 1338.5027
Epoch 255/500
100/100 [==============================] - 0s 621us/step - loss: 1322.6936
Epoch 256/500
100/100 [==============================] - 0s 640us/step - loss: 1307.3038
Epoch 257/500
100/100 [==============================] - 0s 650us/step - loss: 1291.8492
Epoch 258/500
100/100 [==============================] - 0s 630us/step - loss: 1275.6927
Epoch 259/500
100/100 [==============================] - 0s 640us/step - loss: 1261.6591
Epoch 260/500
100/100 [==============================] - 0s 630us/step - loss: 1244.7932
Epoch 261/500
100/100 [==============================] - 0s 630us/step - loss: 1229.0870
Epoch 262/500
100/100 [==============================] - 0s 642us/step - loss: 1212.8514
Epoch 263/500
100/100 [==============================] - 0s 610us/step - loss: 1197.9855
Epoch 264/500
100/100 [==============================] - 0s 784us/step - loss: 1181.3008
Epoch 265/500
100/100 [==============================] - 0s 790us/step - loss: 1166.1116
Epoch 266/500
100/100 [==============================] - 0s 560us/step - loss: 1149.9489
Epoch 267/500
100/100 [==============================] - 0s 600us/step - loss: 1134.4208
Epoch 268/500
100/100 [==============================] - 0s 621us/step - loss: 1119.2052
Epoch 269/500
100/100 [==============================] - 0s 690us/step - loss: 1103.5399
Epoch 270/500
100/100 [==============================] - 0s 620us/step - loss: 1087.4109
Epoch 271/500
100/100 [==============================] - 0s 630us/step - loss: 1072.3574
Epoch 272/500
100/100 [==============================] - 0s 590us/step - loss: 1056.9464
Epoch 273/500
100/100 [==============================] - 0s 570us/step - loss: 1041.2964
Epoch 274/500
100/100 [==============================] - 0s 570us/step - loss: 1026.1165
Epoch 275/500
100/100 [==============================] - 0s 560us/step - loss: 1010.5861
Epoch 276/500
100/100 [==============================] - 0s 570us/step - loss: 995.2079
Epoch 277/500
100/100 [==============================] - 0s 600us/step - loss: 980.2415
Epoch 278/500
100/100 [==============================] - 0s 610us/step - loss: 965.3373
Epoch 279/500
100/100 [==============================] - 0s 610us/step - loss: 950.1522
Epoch 280/500
100/100 [==============================] - 0s 590us/step - loss: 935.1249
Epoch 281/500
100/100 [==============================] - 0s 540us/step - loss: 919.9279
Epoch 282/500
100/100 [==============================] - 0s 565us/step - loss: 905.1863
Epoch 283/500
100/100 [==============================] - 0s 580us/step - loss: 890.1756
Epoch 284/500
100/100 [==============================] - 0s 550us/step - loss: 875.4293
Epoch 285/500
100/100 [==============================] - 0s 580us/step - loss: 860.6857
Epoch 286/500
100/100 [==============================] - 0s 530us/step - loss: 846.0100
Epoch 287/500
100/100 [==============================] - 0s 570us/step - loss: 830.8466
Epoch 288/500
100/100 [==============================] - 0s 570us/step - loss: 816.0717
Epoch 289/500
100/100 [==============================] - 0s 570us/step - loss: 801.8853
Epoch 290/500
100/100 [==============================] - 0s 540us/step - loss: 787.4023
Epoch 291/500
100/100 [==============================] - 0s 530us/step - loss: 772.4633
Epoch 292/500
100/100 [==============================] - 0s 550us/step - loss: 758.3254
Epoch 293/500
100/100 [==============================] - 0s 540us/step - loss: 744.4703
Epoch 294/500
100/100 [==============================] - 0s 520us/step - loss: 729.8803
Epoch 295/500
100/100 [==============================] - 0s 560us/step - loss: 715.5155
Epoch 296/500
100/100 [==============================] - 0s 580us/step - loss: 701.6392
Epoch 297/500
100/100 [==============================] - 0s 580us/step - loss: 687.9767
Epoch 298/500
100/100 [==============================] - 0s 570us/step - loss: 674.7376
Epoch 299/500
100/100 [==============================] - 0s 580us/step - loss: 660.9853
Epoch 300/500
100/100 [==============================] - 0s 550us/step - loss: 647.4138
Epoch 301/500
100/100 [==============================] - 0s 560us/step - loss: 634.7412
Epoch 302/500
100/100 [==============================] - 0s 530us/step - loss: 621.5762
Epoch 303/500
100/100 [==============================] - 0s 560us/step - loss: 608.8066
Epoch 304/500
100/100 [==============================] - 0s 560us/step - loss: 595.8708
Epoch 305/500
100/100 [==============================] - 0s 600us/step - loss: 583.7885
Epoch 306/500
100/100 [==============================] - 0s 590us/step - loss: 571.4786
Epoch 307/500
100/100 [==============================] - 0s 570us/step - loss: 559.0168
Epoch 308/500
100/100 [==============================] - 0s 570us/step - loss: 547.1802
Epoch 309/500
100/100 [==============================] - 0s 550us/step - loss: 535.5780
Epoch 310/500
100/100 [==============================] - 0s 550us/step - loss: 523.6338
Epoch 311/500
100/100 [==============================] - 0s 520us/step - loss: 512.2648
Epoch 312/500
100/100 [==============================] - 0s 580us/step - loss: 500.6879
Epoch 313/500
100/100 [==============================] - 0s 570us/step - loss: 489.4662
Epoch 314/500
100/100 [==============================] - 0s 575us/step - loss: 478.3378
Epoch 315/500
100/100 [==============================] - 0s 530us/step - loss: 467.7027
Epoch 316/500
100/100 [==============================] - 0s 560us/step - loss: 456.7994
Epoch 317/500
100/100 [==============================] - 0s 560us/step - loss: 446.1938
Epoch 318/500
100/100 [==============================] - 0s 550us/step - loss: 435.7972
Epoch 319/500
100/100 [==============================] - 0s 530us/step - loss: 425.5213
Epoch 320/500
100/100 [==============================] - 0s 560us/step - loss: 415.4666
Epoch 321/500
100/100 [==============================] - 0s 550us/step - loss: 405.5734
Epoch 322/500
100/100 [==============================] - 0s 550us/step - loss: 395.8138
Epoch 323/500
100/100 [==============================] - 0s 560us/step - loss: 386.4092
Epoch 324/500
100/100 [==============================] - 0s 570us/step - loss: 376.7786
Epoch 325/500
100/100 [==============================] - 0s 560us/step - loss: 367.5353
Epoch 326/500
100/100 [==============================] - 0s 510us/step - loss: 358.8135
Epoch 327/500
100/100 [==============================] - 0s 540us/step - loss: 349.4059
Epoch 328/500
100/100 [==============================] - 0s 540us/step - loss: 340.8319
Epoch 329/500
100/100 [==============================] - 0s 540us/step - loss: 332.1058
Epoch 330/500
100/100 [==============================] - 0s 570us/step - loss: 323.5275
Epoch 331/500
100/100 [==============================] - 0s 580us/step - loss: 315.3309
Epoch 332/500
100/100 [==============================] - 0s 590us/step - loss: 307.2072
Epoch 333/500
100/100 [==============================] - 0s 600us/step - loss: 299.3743
Epoch 334/500
100/100 [==============================] - 0s 590us/step - loss: 291.4962
Epoch 335/500
100/100 [==============================] - 0s 540us/step - loss: 283.9941
Epoch 336/500
100/100 [==============================] - 0s 550us/step - loss: 276.5427
Epoch 337/500
100/100 [==============================] - 0s 560us/step - loss: 269.0028
Epoch 338/500
100/100 [==============================] - 0s 580us/step - loss: 262.0714
Epoch 339/500
100/100 [==============================] - 0s 590us/step - loss: 255.0128
Epoch 340/500
100/100 [==============================] - 0s 580us/step - loss: 248.1300
Epoch 341/500
100/100 [==============================] - 0s 580us/step - loss: 241.4786
Epoch 342/500
100/100 [==============================] - 0s 580us/step - loss: 235.1471
Epoch 343/500
100/100 [==============================] - 0s 765us/step - loss: 228.7225
Epoch 344/500
100/100 [==============================] - 0s 622us/step - loss: 222.4509
Epoch 345/500
100/100 [==============================] - 0s 590us/step - loss: 216.4196
Epoch 346/500
100/100 [==============================] - 0s 615us/step - loss: 210.6857
Epoch 347/500
100/100 [==============================] - 0s 570us/step - loss: 204.8449
Epoch 348/500
100/100 [==============================] - 0s 550us/step - loss: 199.1320
Epoch 349/500
100/100 [==============================] - 0s 520us/step - loss: 193.5737
Epoch 350/500
100/100 [==============================] - 0s 550us/step - loss: 188.2038
Epoch 351/500
100/100 [==============================] - 0s 540us/step - loss: 183.1385
Epoch 352/500
100/100 [==============================] - 0s 510us/step - loss: 177.7799
Epoch 353/500
100/100 [==============================] - 0s 540us/step - loss: 172.7594
Epoch 354/500
100/100 [==============================] - 0s 548us/step - loss: 167.6997
Epoch 355/500
100/100 [==============================] - 0s 500us/step - loss: 162.8331
Epoch 356/500
100/100 [==============================] - 0s 550us/step - loss: 158.0408
Epoch 357/500
100/100 [==============================] - 0s 530us/step - loss: 153.3532
Epoch 358/500
100/100 [==============================] - 0s 500us/step - loss: 148.9230
Epoch 359/500
100/100 [==============================] - 0s 540us/step - loss: 144.5065
Epoch 360/500
100/100 [==============================] - 0s 520us/step - loss: 140.2482
Epoch 361/500
100/100 [==============================] - 0s 570us/step - loss: 136.0407
Epoch 362/500
100/100 [==============================] - 0s 589us/step - loss: 131.9154
Epoch 363/500
100/100 [==============================] - 0s 628us/step - loss: 128.2090
Epoch 364/500
100/100 [==============================] - 0s 652us/step - loss: 124.0060
Epoch 365/500
100/100 [==============================] - 0s 767us/step - loss: 120.4167
Epoch 366/500
100/100 [==============================] - 0s 740us/step - loss: 116.8746
Epoch 367/500
100/100 [==============================] - 0s 660us/step - loss: 113.5136
Epoch 368/500
100/100 [==============================] - 0s 680us/step - loss: 109.7033
Epoch 369/500
100/100 [==============================] - 0s 640us/step - loss: 106.4990
Epoch 370/500
100/100 [==============================] - 0s 660us/step - loss: 103.2396
Epoch 371/500
100/100 [==============================] - 0s 630us/step - loss: 100.1801
Epoch 372/500
100/100 [==============================] - 0s 620us/step - loss: 97.2501
Epoch 373/500
100/100 [==============================] - 0s 610us/step - loss: 94.1523
Epoch 374/500
100/100 [==============================] - 0s 600us/step - loss: 91.3594
Epoch 375/500
100/100 [==============================] - 0s 601us/step - loss: 88.4707
Epoch 376/500
100/100 [==============================] - 0s 577us/step - loss: 85.8054
Epoch 377/500
100/100 [==============================] - 0s 560us/step - loss: 83.1599
Epoch 378/500
100/100 [==============================] - 0s 590us/step - loss: 80.6529
Epoch 379/500
100/100 [==============================] - 0s 600us/step - loss: 78.1968
Epoch 380/500
100/100 [==============================] - 0s 600us/step - loss: 75.7905
Epoch 381/500
100/100 [==============================] - 0s 590us/step - loss: 73.4070
Epoch 382/500
100/100 [==============================] - 0s 570us/step - loss: 71.3039
Epoch 383/500
100/100 [==============================] - 0s 540us/step - loss: 68.9134
Epoch 384/500
100/100 [==============================] - 0s 560us/step - loss: 66.8832
Epoch 385/500
100/100 [==============================] - 0s 570us/step - loss: 64.6990
Epoch 386/500
100/100 [==============================] - 0s 560us/step - loss: 62.5761
Epoch 387/500
100/100 [==============================] - 0s 540us/step - loss: 60.6141
Epoch 388/500
100/100 [==============================] - 0s 570us/step - loss: 58.6702
Epoch 389/500
100/100 [==============================] - 0s 580us/step - loss: 56.7080
Epoch 390/500
100/100 [==============================] - 0s 590us/step - loss: 54.8682
Epoch 391/500
100/100 [==============================] - 0s 610us/step - loss: 53.0552
Epoch 392/500
100/100 [==============================] - 0s 560us/step - loss: 51.2600
Epoch 393/500
100/100 [==============================] - 0s 570us/step - loss: 49.5855
Epoch 394/500
100/100 [==============================] - 0s 715us/step - loss: 47.8953
Epoch 395/500
100/100 [==============================] - 0s 900us/step - loss: 46.2629
Epoch 396/500
100/100 [==============================] - 0s 920us/step - loss: 44.7420
Epoch 397/500
100/100 [==============================] - 0s 740us/step - loss: 43.1839
Epoch 398/500
100/100 [==============================] - 0s 780us/step - loss: 41.6652
Epoch 399/500
100/100 [==============================] - 0s 770us/step - loss: 40.1801
Epoch 400/500
100/100 [==============================] - 0s 713us/step - loss: 38.7397
Epoch 401/500
100/100 [==============================] - 0s 690us/step - loss: 37.3631
Epoch 402/500
100/100 [==============================] - 0s 720us/step - loss: 36.0652
Epoch 403/500
100/100 [==============================] - 0s 700us/step - loss: 34.8088
Epoch 404/500
100/100 [==============================] - 0s 658us/step - loss: 33.5303
Epoch 405/500
100/100 [==============================] - 0s 671us/step - loss: 32.2329
Epoch 406/500
100/100 [==============================] - 0s 610us/step - loss: 31.2478
Epoch 407/500
100/100 [==============================] - 0s 600us/step - loss: 29.9280
Epoch 408/500
100/100 [==============================] - 0s 610us/step - loss: 28.9309
Epoch 409/500
100/100 [==============================] - 0s 610us/step - loss: 27.9233
Epoch 410/500
100/100 [==============================] - 0s 580us/step - loss: 26.8792
Epoch 411/500
100/100 [==============================] - 0s 590us/step - loss: 25.9500
Epoch 412/500
100/100 [==============================] - 0s 550us/step - loss: 24.9445
Epoch 413/500
100/100 [==============================] - 0s 560us/step - loss: 24.1239
Epoch 414/500
100/100 [==============================] - 0s 590us/step - loss: 23.2598
Epoch 415/500
100/100 [==============================] - 0s 580us/step - loss: 22.4235
Epoch 416/500
100/100 [==============================] - 0s 580us/step - loss: 21.6950
Epoch 417/500
100/100 [==============================] - 0s 552us/step - loss: 20.9039
Epoch 418/500
100/100 [==============================] - 0s 560us/step - loss: 20.1584
Epoch 419/500
100/100 [==============================] - 0s 570us/step - loss: 19.5324
Epoch 420/500
100/100 [==============================] - 0s 580us/step - loss: 18.7685
Epoch 421/500
100/100 [==============================] - 0s 580us/step - loss: 18.0776
Epoch 422/500
100/100 [==============================] - 0s 530us/step - loss: 17.4931
Epoch 423/500
100/100 [==============================] - 0s 550us/step - loss: 16.8570
Epoch 424/500
100/100 [==============================] - 0s 580us/step - loss: 16.2943
Epoch 425/500
100/100 [==============================] - 0s 590us/step - loss: 15.7104
Epoch 426/500
100/100 [==============================] - 0s 570us/step - loss: 15.3520
Epoch 427/500
100/100 [==============================] - 0s 570us/step - loss: 14.7047
Epoch 428/500
100/100 [==============================] - 0s 580us/step - loss: 14.3041
Epoch 429/500
100/100 [==============================] - 0s 610us/step - loss: 13.8071
Epoch 430/500
100/100 [==============================] - 0s 580us/step - loss: 13.4377
Epoch 431/500
100/100 [==============================] - 0s 550us/step - loss: 12.9659
Epoch 432/500
100/100 [==============================] - 0s 500us/step - loss: 12.4885
Epoch 433/500
100/100 [==============================] - 0s 570us/step - loss: 12.0611
Epoch 434/500
100/100 [==============================] - 0s 600us/step - loss: 11.8021
Epoch 435/500
100/100 [==============================] - 0s 590us/step - loss: 11.3978
Epoch 436/500
100/100 [==============================] - 0s 533us/step - loss: 11.0433
Epoch 437/500
100/100 [==============================] - 0s 555us/step - loss: 10.6561
Epoch 438/500
100/100 [==============================] - 0s 560us/step - loss: 10.3676
Epoch 439/500
100/100 [==============================] - 0s 550us/step - loss: 10.0731
Epoch 440/500
100/100 [==============================] - 0s 523us/step - loss: 9.7165
Epoch 441/500
100/100 [==============================] - 0s 565us/step - loss: 9.5415
Epoch 442/500
100/100 [==============================] - 0s 570us/step - loss: 9.1625
Epoch 443/500
100/100 [==============================] - 0s 570us/step - loss: 8.9425
Epoch 444/500
100/100 [==============================] - 0s 532us/step - loss: 8.7028
Epoch 445/500
100/100 [==============================] - 0s 550us/step - loss: 8.4038
Epoch 446/500
100/100 [==============================] - 0s 550us/step - loss: 8.2304
Epoch 447/500
100/100 [==============================] - 0s 524us/step - loss: 7.9745
Epoch 448/500
100/100 [==============================] - 0s 540us/step - loss: 7.8538
Epoch 449/500
100/100 [==============================] - 0s 560us/step - loss: 7.6105
Epoch 450/500
100/100 [==============================] - 0s 560us/step - loss: 7.3385
Epoch 451/500
100/100 [==============================] - 0s 530us/step - loss: 7.1845
Epoch 452/500
100/100 [==============================] - 0s 560us/step - loss: 6.9905
Epoch 453/500
100/100 [==============================] - 0s 560us/step - loss: 6.8172
Epoch 454/500
100/100 [==============================] - 0s 510us/step - loss: 6.7036
Epoch 455/500
100/100 [==============================] - 0s 560us/step - loss: 6.5074
Epoch 456/500
100/100 [==============================] - 0s 580us/step - loss: 6.4057
Epoch 457/500
100/100 [==============================] - 0s 570us/step - loss: 6.1575
Epoch 458/500
100/100 [==============================] - 0s 510us/step - loss: 6.0938
Epoch 459/500
100/100 [==============================] - 0s 560us/step - loss: 5.9198
Epoch 460/500
100/100 [==============================] - 0s 570us/step - loss: 5.8285
Epoch 461/500
100/100 [==============================] - 0s 590us/step - loss: 5.6882
Epoch 462/500
100/100 [==============================] - 0s 530us/step - loss: 5.5365
Epoch 463/500
100/100 [==============================] - 0s 572us/step - loss: 5.4678
Epoch 464/500
100/100 [==============================] - 0s 550us/step - loss: 5.3239
Epoch 465/500
100/100 [==============================] - 0s 540us/step - loss: 5.2163
Epoch 466/500
100/100 [==============================] - 0s 530us/step - loss: 5.0910
Epoch 467/500
100/100 [==============================] - 0s 560us/step - loss: 5.0621
Epoch 468/500
100/100 [==============================] - 0s 550us/step - loss: 4.9171
Epoch 469/500
100/100 [==============================] - 0s 521us/step - loss: 4.7671
Epoch 470/500
100/100 [==============================] - 0s 535us/step - loss: 4.7191
Epoch 471/500
100/100 [==============================] - 0s 550us/step - loss: 4.6347
Epoch 472/500
100/100 [==============================] - 0s 521us/step - loss: 4.4269
Epoch 473/500
100/100 [==============================] - 0s 544us/step - loss: 4.3540
Epoch 474/500
100/100 [==============================] - 0s 590us/step - loss: 4.2588
Epoch 475/500
100/100 [==============================] - 0s 585us/step - loss: 4.1269
Epoch 476/500
100/100 [==============================] - 0s 532us/step - loss: 4.1333
Epoch 477/500
100/100 [==============================] - 0s 540us/step - loss: 4.0745
Epoch 478/500
100/100 [==============================] - 0s 560us/step - loss: 3.8488
Epoch 479/500
100/100 [==============================] - 0s 663us/step - loss: 3.7463
Epoch 480/500
100/100 [==============================] - 0s 570us/step - loss: 3.7268
Epoch 481/500
100/100 [==============================] - 0s 550us/step - loss: 3.5408
Epoch 482/500
100/100 [==============================] - 0s 562us/step - loss: 3.5190
Epoch 483/500
100/100 [==============================] - 0s 600us/step - loss: 3.3652
Epoch 484/500
100/100 [==============================] - 0s 591us/step - loss: 3.2505
Epoch 485/500
100/100 [==============================] - 0s 584us/step - loss: 3.2003
Epoch 486/500
100/100 [==============================] - 0s 560us/step - loss: 3.0614
Epoch 487/500
100/100 [==============================] - 0s 550us/step - loss: 2.9399
Epoch 488/500
100/100 [==============================] - 0s 590us/step - loss: 2.9349
Epoch 489/500
100/100 [==============================] - 0s 592us/step - loss: 2.8223
Epoch 490/500
100/100 [==============================] - 0s 601us/step - loss: 2.7234
Epoch 491/500
100/100 [==============================] - 0s 603us/step - loss: 2.6667
Epoch 492/500
100/100 [==============================] - 0s 551us/step - loss: 2.6610
Epoch 493/500
100/100 [==============================] - 0s 560us/step - loss: 2.4771
Epoch 494/500
100/100 [==============================] - 0s 605us/step - loss: 2.4251
Epoch 495/500
100/100 [==============================] - 0s 593us/step - loss: 2.3276
Epoch 496/500
100/100 [==============================] - 0s 593us/step - loss: 2.2505
Epoch 497/500
100/100 [==============================] - 0s 607us/step - loss: 2.2908
Epoch 498/500
100/100 [==============================] - 0s 550us/step - loss: 2.1442
Epoch 499/500
100/100 [==============================] - 0s 560us/step - loss: 2.0850
Epoch 500/500
100/100 [==============================] - 0s 595us/step - loss: 2.0279
Out[22]:
<tensorflow.python.keras.callbacks.History at 0x1ded9c81be0>
In [23]:
# Now let's see.
plt.plot(poly['x'], poly['y'], label='actual')
plt.plot(poly['x'], model.predict(poly['x']), label='prediction')
plt.legend();

Note that re-running the fitting code will generally give different results.


End