Closed andy920262 closed 4 years ago
That's designed on purpose. In my humble opinion, we seldom do regularization in the test phase, right?
I'm not really sure if regularization should be concerned in the test phase. I just notice this when I work on professor Lin's OPTDL course. I find keras.Model.fit will use the identical objective in the test phase.
If you think about it carefully, having the regularization term or not will not affect the test accuracy. You may refer to feedforward.m for details. I would suggest you discuss with Prof. Lin or TAs for their opinion.
Thank you for the answer. I think you're right, this can be designed by purpose. I'll close this issue.
In
train.py
, the variableloss
is passed to the predict function. But the actual objective isloss_with_reg
. I consider here should beloss_with_reg
in the predict function.