Commit c05e0c7
authored
Align subclassing guide with docstring of Layer.add_loss() (#1144)
* Align subclassing guide with docstring of Layer.add_loss()
which uses `reduce_mean()`, not `reduce_sum()`, to achieve independence of batch sizes, consistent with Keras' default loss reduction by SUM_OVER_BATCH_SIZE. Along the way, clarify the difference between `add_loss` and `Loss`.
* Update making_new_layers_and_models_via_subclassing.py
Addresses review comment.1 parent d3bec2e commit c05e0c7
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
244 | 247 | | |
245 | 248 | | |
246 | 249 | | |
| |||
0 commit comments