Reputation: 67
Need help as I am new to Keras and was reading on dropout and how using dropout can have an impact on loss calculation during training and validation phase. This is because dropout is only present at training time and not validation time, so comparing two losses can be misleading.
Question is
Upvotes: 1
Views: 158
Reputation: 2440
It's not only Dropout
but BatchNormalization
as well that need to be changed or it'll affect validation performance.
If you use keras and just want to get validation loss (and or accuracy or other metrics) then you better use model.evaluate()
or add validation_data
while model.fit
and don't do anything with learning_phase_scope
.
The learning_phase_scope(1)
means it's for training, 0 is for predict/validate.
Personally I use learning_phase_scope
only when I want to train something that not end with simply model.fit
(visualize CNN filter) but only once so far in past 3 years.
Upvotes: 2