Loss and val loss too big I have a random vector with known pdf x and i'm trying to predict some behaviour y. I created a dataset containing (X,y), where X is a vector of D realizations of the VA X and y = (y1,y2). That is, for each instance I have a vector D of input and the vector y for output. I tried:

 from tensorflow import keras
 model = keras.models.Sequential([
 keras.layers.Dense(300, input_shape=(D,), activation="relu"),
 keras.layers.Dense(300, input_shape=(D,), activation="relu"),
 keras.layers.Dense(100, input_shape=(D,), activation="relu"),
 #keras.layers.Dense(10, activation="relu")
 keras.layers.Dense(2)
 ])

 model.summary()
 model.compile(loss='mean_squared_error', optimizer="adam")
 history = model.fit(X_train, y_train, epochs=30, validation_data=     (X_val, y_val))


And in training:

 Epoch 2/252 \\
 252/252 [==============================] - 0s 965us/sample - loss: 67222078.7937 - val_loss: 99721252.0000
 Epoch 2/252
 252/252 [==============================] - 0s 325us/sample - loss: 66736292.6984 - val_loss: 99545232.0000
 Epoch 3/252
 252/252 [==============================] - 0s 246us/sample - loss: 64592091.8095 - val_loss: 99156788.0000
 ...
 Epoch 252/252
 252/252 [==============================] - 0s 305us/sample - loss: 23.6345 - val_loss: 92329540.0000
 80/80 [==============================] - 0s 143us/sample - loss: 29423635.9000


Loss and val_loss is too bad. Can anyone give me an insight?
It could be normal to have such large loss value if your predicted values are far from the ground truth values (because of the square in the mean squared error loss).
Try to print the predicted values and ground truth with tf.Print to check that.
You can normalize your ground truth values so that their range is not too big. For example it should be easier for the network to predict values between 0 and 10 than values between 0 and 1000.