

In this case, you would simply iterate over Here are two common transfer learning blueprint involving Sequential models.įirst, let's say that you have a Sequential model, and you want to freeze all If you aren't familiar with it, make sure to read our guide Transfer learning consists of freezing the bottom layers in a model and only training Transfer learning with a Sequential model ones (( 1, 250, 250, 3 )) features = feature_extractor ( x )

output, ) # Call feature extractor on test input. get_layer ( name = "my_intermediate_layer" ). Sequential ( ) feature_extractor = keras. These attributes can be used to do neat things, likeĬreating a model that extracts the outputs of all intermediate layers in a This means that every layer has an inputĪnd output attribute. Once a Sequential model has been built, it behaves like a Functional API Guide to multi-GPU and distributed training.įeature extraction with a Sequential model Speed up model training by leveraging multiple GPUs.Save your model to disk and restore it.Guide to training & evaluation with the built-in loops Train your model, evaluate it, and run inference.Once your model architecture is ready, you will want to: GlobalMaxPooling2D ()) # Finally, we add a classification layer. summary () # Now that we have 4x4 feature maps, time to apply global max pooling. Conv2D ( 32, 3, activation = "relu" )) model.

summary () # The answer was: (40, 40, 32), so we can keep downsampling. MaxPooling2D ( 3 )) # Can you guess what the current output shape is at this point? Probably not. Conv2D ( 32, 5, strides = 2, activation = "relu" )) model.
