Skip to content

Commit

Permalink
Updated model.summary() for ep. 3 (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinvis authored Jan 14, 2025
1 parent 69d0940 commit 3015aab
Showing 1 changed file with 59 additions and 44 deletions.
103 changes: 59 additions & 44 deletions episodes/3-monitor-the-model.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,24 @@ model.summary()
```
```output
Model: "weather_prediction_model"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input (InputLayer) [(None, 89)] 0
_________________________________________________________________
dense (Dense) (None, 100) 9000
_________________________________________________________________
dense_1 (Dense) (None, 50) 5050
_________________________________________________________________
dense_2 (Dense) (None, 1) 51
=================================================================
Total params: 14,101
Trainable params: 14,101
Non-trainable params: 0
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type) ┃ Output Shape ┃ Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ input (InputLayer) │ (None, 89) │ 0 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense (Dense) │ (None, 100) │ 9,000 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_1 (Dense) │ (None, 50) │ 5,050 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_2 (Dense) │ (None, 1) │ 51 │
└─────────────────────────────┴─────────────────────┴───────────────┘
Total params: 14,101 (55.08 KB)
Trainable params: 14,101 (55.08 KB)
Non-trainable params: 0 (0.00 B)
```


Expand Down Expand Up @@ -640,20 +644,26 @@ model.summary()
```
```
Model: "model_small"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input (InputLayer) [(None, 89)] 0
_________________________________________________________________
dense_9 (Dense) (None, 10) 900
_________________________________________________________________
dense_10 (Dense) (None, 5) 55
_________________________________________________________________
dense_11 (Dense) (None, 1) 6
=================================================================
Total params: 961
Trainable params: 961
Non-trainable params: 0
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type) ┃ Output Shape ┃ Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ input (InputLayer) │ (None, 89) │ 0 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_9 (Dense) │ (None, 10) │ 900 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_10 (Dense) │ (None, 5) │ 55 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_11 (Dense) │ (None, 1) │ 6 │
└─────────────────────────────┴─────────────────────┴───────────────┘
Total params: 961 (3.75 KB)
Trainable params: 961 (3.75 KB)
Non-trainable params: 0 (0.00 B)
```

Let's compile and train this network:
Expand Down Expand Up @@ -762,22 +772,27 @@ This new layer appears in the model summary as well.

```output
Model: "model_batchnorm"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_1 (InputLayer) [(None, 89)] 0
_________________________________________________________________
batch_normalization (BatchNo (None, 89) 356
_________________________________________________________________
dense (Dense) (None, 100) 9000
_________________________________________________________________
dense_1 (Dense) (None, 50) 5050
_________________________________________________________________
dense_2 (Dense) (None, 1) 51
=================================================================
Total params: 14,457
Trainable params: 14,279
Non-trainable params: 178
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Layer (type) ┃ Output Shape ┃ Param # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ input (InputLayer) │ (None, 89) │ 0 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ batch_normalization_1 │ (None, 89) │ 356 │
│ (BatchNormalization) │ │ │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_6 (Dense) │ (None, 100) │ 9,000 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_7 (Dense) │ (None, 50) │ 5,050 │
├─────────────────────────────┼─────────────────────┼───────────────┤
│ dense_8 (Dense) │ (None, 1) │ 51 │
└─────────────────────────────┴─────────────────────┴───────────────┘
Total params: 14,457 (56.47 KB)
Trainable params: 14,279 (55.78 KB)
Non-trainable params: 178 (712.00 B)
```

We can train the model again as follows:
Expand Down

0 comments on commit 3015aab

Please sign in to comment.