Hello,
I am new to machine learning and was running some diagnostics.
When I do a model.predict:
myModel = Model(inputs = self.model_ori.input, outputs= self.model_ori.layers[1].output)
starttime = time.time()
myModelResult = myModel.predict(img)
endtime = time.time()
OR
myModel = Model(inputs = self.model_ori.input, outputs= self.model_ori.layers[4].output)
starttime = time.time()
myModelResult = myModel.predict(img)
endtime = time.time()
How is it that the 4th layer takes less time to predict than the first layer?
Layer Number | Layer Name | Size (Kilobytes) | Time to Process (Seconds) |
---|---|---|---|
1 | conv2d (Conv2D) | 977 | 0.0484 |
2 | batch_normalization (BatchNormalization) | 1230 | 0.0665 |
3 | leaky_re_lu (LeakyReLU) | 1020 | 0.0547 |
4 | max_pooling2d (MaxPooling2D) | 300 | 0.0353 |
Can someone explain this behaviour to me? I want to learn more about how these things work.