@@ -59,15 +59,15 @@ This is adapted from
5959
6060## Freezing layers: understanding the ` trainable ` attribute
6161
62- Layers & models have three weight attributes:
62+ Layers and models have three weight attributes:
6363
6464- ` weights ` is the list of all weights variables of the layer.
6565- ` trainable_weights ` is the list of those that are meant to be updated (via gradient
6666 descent) to minimize the loss during training.
6767- ` non_trainable_weights ` is the list of those that aren't meant to be trained.
6868 Typically they are updated by the model during the forward pass.
6969
70- ** Example: the ` Dense ` layer has 2 trainable weights (kernel & bias)**
70+ ** Example: the ` Dense ` layer has 2 trainable weights (kernel and bias)**
7171
7272``` {r, hold = TRUE}
7373layer <- layer_dense(units = 3)
@@ -138,7 +138,7 @@ final_layer1_weights_values <- get_weights(layer1)
138138stopifnot(all.equal(initial_layer1_weights_values, final_layer1_weights_values))
139139```
140140
141- Do not confuse the ` layer$trainable ` attribute with the ` training ` argument in a layer instances ` call ` signature
141+ Do not confuse the ` layer$trainable ` attribute with the ` training ` argument in a layer instance's ` call ` signature
142142` layer(training =) ` (which controls whether the layer should run its forward pass in
143143 inference mode or training mode). For more information, see the
144144[ Keras FAQ] (
@@ -271,7 +271,7 @@ base_model$trainable <- TRUE
271271
272272# It's important to recompile your model after you make any changes
273273# to the `trainable` attribute of any inner layer, so that your changes
274- # are take into account
274+ # are taken into account
275275model %>% compile(
276276 optimizer = optimizer_adam(1e-5), # Very low learning rate
277277 loss = loss_binary_crossentropy(from_logits = TRUE),
@@ -330,7 +330,7 @@ base_model = application_xception(
330330)
331331
332332# Freeze base model
333- base_model. trainable = FALSE
333+ base_model$ trainable = FALSE
334334
335335# Create new model on top.
336336inputs <- layer_input(shape = c(150, 150, 3))
@@ -523,7 +523,7 @@ plot_image(data_augmentation(first_image, training = TRUE), "augmented 3")
523523
524524## Build a model
525525
526- Now let's built a model that follows the blueprint we've explained earlier.
526+ Now let's build a model that follows the blueprint we've explained earlier.
527527
528528Note that:
529529
0 commit comments