title: Can someone explain how the head of ResNet50 changing in this code snippet?
body: <pre><code>headModel = baseModel.output
  headModel = AveragePooling2D(pool_size=(7, 7))(headModel)
  headModel = Flatten(name=&quot;flatten&quot;)(headModel)
  headModel = Dense(512, activation=&quot;relu&quot;)(headModel)
  headModel = Dropout(0.5)(headModel)
  headModel = Dense(len(lb.classes_), activation=&quot;softmax&quot;)(headModel)
  </code></pre>
  <p>I can see 2 activation functions are being used here. Is it using relu for the hidden layers and then softmax for the output layer? Also does it mean input layer = 512?</p>