C4W4 Assignment - model architecture

The closest thing to reproducibility in tensorflow 2.7 is to set the seed before building the model. Here’s an example:

tf.random.set_seed(2022)
model = tf.keras.Sequential([...])
model.compile(...)
model.fit(...)

So, when the passing criteria is 6 for MSE on validation set, your NN has to have a much lower error to ensure that the randomness doesn’t hurt your model performance by much. It’s a good idea of use an adaptive optimizer like adam instead of tuning learning rate from scratch for SGD.

Here’s a suggestion based on your notebook. It’s valid to specify a list of metrics to your model.compile function like this to give you a better picture of model performance over time:

model.compile(loss=None,
		metrics=['mse', 'mae'],
		optimizer=None)

You can also max pooling 1d layer to better summarize the inputs to lstm layer. Consider using bidirectional lstm to see if performance improves over lstm layers. Other than output layer, keep number of units a power of 2.

Consider using a custom callback to ensure that when the model achieves the MSE / MAE on the training set, you stop training any further. See tf.keras.callbacks.Callback.

With these hints, you should see MSE ~ 5.35 and MAE ~ 1.80 in the validation dataset with less than 40 epochs of training. 100 gives a lot more room to better understand training data.