I have build a custom model. In my model, I added 2 fully connected layers after the Flatten layer. One of those layer has 128 nuerons and other has 64 neurons. After adding those layers, I included a layer with the same number of neurons as the classes in the dataset.
Now, I want to check if my model is better than Keras application's model. So, I implemented some keras models. After the flatten layer of those model, I used the same stucture of fully connected layers which I used after the Flatten layer in my custom model. So, I want to know that is it the correct way to implement those models of the Keras application to compare a model is better than those models by checking the models's accuracies? Or, do I have to use the exact numbers of nuron in fully connected layers that have been used when the model is founded to implement those Keras application models to find out the best models among them? I am providing a code of implementing one of the keras model:
input_tensor = Input(shape=(224, 224, 3))
base_model = ResNet50V2(input_tensor=input_tensor, weights='imagenet',
include_top=False )
x = base_model.output
x=Flatten()(x)
x=Dense(128,activation='relu')(x)
x=Dense(64,activation='relu')(x)
x= Dense(5, activation='softmax')(x)
model= Model(inputs=input_tensor, outputs=x)
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
for layer in model.layers:
layer.trainable = True
model.summary()