-
Hi, Can you remind me, when we do put (x) on the outside vs on the inside as in: x = layers.GlobalAveragePooling2D(name="pooling_layer")(x) ### Use 2D b/c our shapes are 2 Dimensional (height * Width) vs. something with x inside (can't think of an example but like this (x) ) Curious when (x) goes on the outside/inside and why. Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
InsideIf it's a model ( For example, import tensorflow as tf
model = tf.keras.applications.EfficientNetB0(include_top=False) # <- this is a model
model.trainable = False
x = tf.keras.layers.Input(shape=(224, 224, 3), name="input_layer")
x = model(x) # <- inside OutsideIf it's a layer ( For exmaple, import tensorflow as tf
model = tf.keras.applications.EfficientNetB0(include_top=False)
model.trainable = False
inputs = tf.keras.layers.Input(shape=(224, 224, 3), name="input_layer")
x = model(inputs)
x = tf.keras.layers.GlobalAveragePooling2D()(x) # <- outside, since it's a layer |
Beta Was this translation helpful? Give feedback.
Inside
If it's a model (
tf.keras.Model
), thex
goes on the inside.For example,
Outside
If it's a layer (
tf.keras.layers.Layer
), thex
goes on the outside.For exmaple,