Skip to content

Commit 01602f8

Browse files
Update README.md
1 parent c5c1e89 commit 01602f8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,3 +510,23 @@ Trainable params: 111,451
510510
Non-trainable params: 0
511511
```
512512

513+
Once we have defined the model, we need to specify the metrics we want to use to track how well our model is behaving and also the kind of optimizer we want to use for our training. I have also defined the patience I want my model to have and what is the rule defined for it.
514+
515+
```python
516+
defined_metrics = [
517+
tf.keras.metrics.MeanSquaredError(name='MSE')
518+
]
519+
520+
callback = tf.keras.callbacks.EarlyStopping(monitor='val_loss', patience=3, mode='min', verbose=1)
521+
522+
model.compile(optimizer='adam', loss='mean_squared_error', metrics=defined_metrics)
523+
history = model.fit(x_train, y_train, epochs=epochs, batch_size=batch_size, validation_data=(x_test, y_test),
524+
callbacks=[callback])
525+
```
526+
527+
528+
### 3.5) Making predictions happen
529+
530+
Now it is time to prepare our testing data and send it through our deep-learning model to obtain the predictions we are trying to get.
531+
532+
First we need to import the test data:

0 commit comments

Comments
 (0)