cjlin1 / simpleNN

BSD 3-Clause "New" or "Revised" License
48 stars 16 forks source link

The objective passing to the predict function #6

Closed andy920262 closed 4 years ago

andy920262 commented 4 years ago

In train.py, the variable loss is passed to the predict function. But the actual objective is loss_with_reg. I consider here should be loss_with_reg in the predict function.

註解 2020-04-06 105111 3

quanpr commented 4 years ago

That's designed on purpose. In my humble opinion, we seldom do regularization in the test phase, right?

andy920262 commented 4 years ago

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.

quanpr commented 4 years ago

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.

andy920262 commented 4 years ago

Thank you for the answer. I think you're right, this can be designed by purpose. I'll close this issue.