Skip to content

Commit

Permalink
added batchsize arg to fit and explained how num train obs is calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
erinmgraham committed Nov 14, 2023
1 parent a03ed1e commit ee4dea1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions episodes/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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.

:::::::::::::::::::::::::::::::::::::::::

Expand Down

0 comments on commit ee4dea1

Please sign in to comment.