Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bias terms are also regularized. #11

Open
zgrkpnr opened this issue Jul 25, 2016 · 3 comments
Open

Bias terms are also regularized. #11

zgrkpnr opened this issue Jul 25, 2016 · 3 comments

Comments

@zgrkpnr
Copy link

zgrkpnr commented Jul 25, 2016

match r with
        | L1Reg l -> fun (w:DV) -> l * (DV.l1norm w)
        | L2Reg l -> fun w -> l * (DV.l2normSq w)
        | NoReg -> fun _ -> D 0.f

This regularization methods penalizes bias terms, as well. Bias terms should be excluded from being penalized.

@smoothdeveloper
Copy link
Contributor

@zgrkpnr the library doesn't have tests yet, could you write a bit of code along with expected and actual results showing the problem with regularization involving bias terms and it will be put under unit test.

@zgrkpnr
Copy link
Author

zgrkpnr commented Jul 26, 2016

@smoothdeveloper Are you asking for a code for fix or do you want me to show that regularizing bias terms causes weak performance? If latter, it is not necessary. Perceptron theory suggests that bias terms don't depend on input values and they have nothing to do with overfitting. Therefore, they are excluded from regularization. Moreover, regularization is done in order to obtain a "low bias" model.

@smoothdeveloper
Copy link
Contributor

@zgrkpnr I was looking for a complete code sample exercising regularization and including bias terms to look at.

From what you describe, the outcome of the test should be identical results but obtained faster.

When a bug is found in a library we tend to write "non-regression test" for it, tests are run any time a change is made to the library to make sure we didn't introduce known issues back.

With such sample I could maybe write a test which shows that the implementation is failing, and when the implementation gets fixed the test would be passing and adding some security for later releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants