-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fixed all the bugs of save_resume #1917
Closed
Closed
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5783622
first version of the KT algorithm
bremen79 07a7e04
changed from 'kt' to 'approximate cocob' and implemented normalizatio…
bremen79 9430ede
variant that works with squared loss
bremen79 9fba67d
fixed all bugs: works great in binary classification, slightly worse …
bremen79 83633b8
cleaned version, no bias used
bremen79 d31cef3
bias and fix bug
bremen79 49bccd5
another bug fix
bremen79 12f6a84
removed bias and added default params for logistic
bremen79 2591f6b
prediction is now stateless
bremen79 7540eca
added comments
bremen79 048c0f7
Merge branch 'master' into coin_pr_version
bremen79 a8bc3a5
added tests
bremen79 b19a82e
fix to ftrl state saving
bremen79 c13457d
merge
bremen79 14ae4ae
moved ftrl_size to a parameter of save_load_online_state
bremen79 39512b8
Merge branch 'master' into fix_save_ftrl
JohnLangford 75a0db1
fixed all the bugs related to resume models
bremen79 d07d6c3
merge
bremen79 43a43c3
removed comments
bremen79 91cd2c1
Merge branch 'master' into fix_save_ftrl
JohnLangford a9f5361
Merge branch 'master' into fix_save_ftrl
JohnLangford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why prefer a global?
The general rule of thumb is to use variables which are as local as possible to minimize context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear to me how to solve this, I am open to suggestions.
From one side, the struct vw already contains similar quantities: power_t, invariant_updates, normalized_sum_norm_x, and similar ones are specific to gd, still they are in a global place.
Also, the problem comes from using GD::save_load_online_state in ftrl. We don't have access to ftrl data in this way. We could duplicate and customize the entire save state function in ftrl? It seems painful... Or hack the GD::save_load_online_state with even more optional inputs, but it also seems a bad idea...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of the three options, an extra argument seems preferred to either a global or code duplication.
Code duplication seems particularly bad---it's a recipe for non-maintainability.
The global variable is moving in the wrong direction---we are working towards atomizing the reductions so they can be composed with other learning algorithms.
The extra arguments approach seems the best. In the long term, we'd probably want to adjust the arguments so they are semantic rather than algorithm-specific. Basically, instead of having ftrl, we'd have "the number of floats per weight to store", etc... But this is a minor refactoring consistent with the extra arguments approach.