Just like this:
x = keras.layers.Input(shape=(3,))
y = keras.layers.Dense(5)(x)
G = keras.models.Model(x, y,name='G')
G.compile(optimizer='rmsprop', loss='mse')
data_x = np.random.random((10, 3))
data_y = np.random.random((10, 5))
G.fit(data_x,data_y,shuffle=False,validation_data=[data_x,data_y],verbose=1)
Result:
Train on 10 samples, validate on 10 samples
Epoch 1/1
10/10 [==============================] - 27s 3s/step - loss: 0.4482 - val_loss: 0.4389
The printed loss and val_loss are different.In some other test,I found the difference is significant. Why?