From ee4dea183a2507243a1a88e58e18bd7cb3c2a673 Mon Sep 17 00:00:00 2001 From: Vlad Dracula Date: Wed, 15 Nov 2023 09:58:23 +1000 Subject: [PATCH] added batchsize arg to fit and explained how num train obs is calculated --- episodes/01-introduction.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/episodes/01-introduction.md b/episodes/01-introduction.md index 0340f32a..f4677b8e 100644 --- a/episodes/01-introduction.md +++ b/episodes/01-introduction.md @@ -207,7 +207,8 @@ We can now go ahead and start training our neural network. We will probably keep ```python # fit the model history_intro = model_intro.fit(train_images, train_labels, epochs = 10, - validation_data = (val_images, val_labels)) + validation_data = (val_images, val_labels), + batch_size=32) # save the model model_intro.save('fit_outputs/model_intro.h5') @@ -222,13 +223,13 @@ Epoch 1/10 **What does this output mean?** -This output printed during the fit phase i.e. training the model against known image labels, can be broken down as follows: +This output printed during the fit phase, i.e. training the model against known image labels, can be broken down as follows: -- `Epoch` descibes the number of full passes over all *training data*. In the Output above there are **1563 training observations**. An epoch will conclude and move to the next epoch after a training pass over all 1563 observations. +- `Epoch` describes the number of full passes over all *training data*. In the output above there are **1563 training observations**. This number is calculated as the total number of images used as input divided by the batch size (50000/32). An epoch will conclude and move to the next epoch after a training pass over all 1563 observations. - `loss` and `val_loss` can be considered as related. Where `loss` is a value the model will attempt to minimise, and is the distance between the true label of an image and the models prediction. Minimising this distance is where *learning* occurs to adjust weights and bias which reduce `loss`. On the other hand `val_loss` is a value calculated against the validation data and is a measurement of the models performance against **unseen data**. Both values are a summation of errors made for each example when fitting to the training or validation sets. -- `accuracy` and `val_accuracy` can also be considered as related. Unlike `loss` and `val_loss`, these values are a percentage and are only revelent to **classification problems**. The `val_accuracy` score can be used to communicate a percentage value of model effectiveness on unseen data. +- `accuracy` and `val_accuracy` can also be considered as related. Unlike `loss` and `val_loss`, these values are a percentage and are only revelant to **classification problems**. The `val_accuracy` score can be used to communicate a percentage value of model effectiveness on unseen data. :::::::::::::::::::::::::::::::::::::::::