In the Functional API, for something like:
inputs = tf.keras.Input(shape=(32,)) t = tf.keras.layers.Dense(10)(inputs) t = tf.keras.layers.Dropout(0.5)(t) outputs = tf.keras.layers.Dense(1)(t) model = tf.keras.Model(inputs, outputs)
I think in this case, the Dropout layer is active during
model.fit but is not active during ‘model.predict/evaluate’?
If so, how is
training = True passed into the Dropout layer’s call method during
training = False passed when calling
model.evaluate()? I assume that
train_step has invokes the call method (something like
self(input, training = True)) but I’m not sure how
training gets passed into the call method for each layer.