Exponentiated gradient implementation for bounded group loss#442
Conversation
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…rolutz/exponentiated_gradient_tests Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…rolutz/exponentiated_gradient_tests
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
gamma and eps + test codes in BGL
Rolutz/exponentiated gradient tests
Lauren dev
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…davide/exponentiated_gradient-BGL
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
|
CHANGES.md has this already from the previous PR, documentation (user guide) exists now for the moment, although we still need to write the expgrad user guide (separate PR), eps removed from lagrangian constructor, but tests for BGL still missing. |
…c format Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…davide/exponentiated_gradient-BGL
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…davide/exponentiated_gradient-BGL
…all moments Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…davide/exponentiated_gradient-BGL
riedgar-ms
left a comment
There was a problem hiding this comment.
I'm not sure there aren't two separate changesets here, but I'm not sure it's worth the trouble to separate them.
…davide/exponentiated_gradient-BGL
| y = self.flipped_y | ||
| else: | ||
| y = self.y | ||
| smoke_test_data_regression = [ |
There was a problem hiding this comment.
Two issues with the current tests:
- you also need to check
expgrad.weights_not justexpgrad.predictors_ - it would be good to try setting
upper_boundto a value that's different fromepsand something that would make the problem feasible--currently all your examples have infeasible constraints... so you could maybe tryupper_bound=0.05, which would make some of the examples feasible and some infeasible; i'd also suggest settingnu=1e-6or1e-3andmax_iter=20in these runs (since the automatic setting ofnuneeds to be double-checked and might change in the future)
There was a problem hiding this comment.
- yes! Updated.
- Good point. I thought that's an issue since the gap doesn't go to 0. Will add a few more tests, although I'll leave the existing ones there as well. In practice that can happen, too, and we should have tests covering that. I'm adding the tests for
upper_bound=0.05withbest_gap=0.0. Regardingnuandmax_iterrestrictions: The number of iterations is never larger than 5 or 6 so that wouldn't do anything, and that applies even when I setnuto 1e-6. I've added it anyway for now, but just so you're aware.
| labels = [int(x) for x in '0110100' '0010111' '001111'] # noqa: E222 | ||
| X1 = [int(x) for x in '0110101' '0111101' '001011'] # noqa: E222 | ||
| X2 = [int(x) for x in '0000100' '0000011' '111111'] # noqa: E222 | ||
| X3 = [int(x) for x in '1111111' '1111111' '111111'] # noqa: E222 |
There was a problem hiding this comment.
this looks buggy, you probably mean float(x)/10 or int(x)/10.0?
| labels = [int(x) for x in '0110100' '0010111' '001111'] # noqa: E222 | ||
| X1 = [int(x) for x in '0110101' '0111101' '001011'] # noqa: E222 | ||
| X2 = [int(x) for x in '0000100' '0000011' '111111'] # noqa: E222 | ||
| X3 = [int(x) for x in '1111111' '1111111' '111111'] # noqa: E222 |
There was a problem hiding this comment.
I don't love this calling convention. The issue is that if you sat y_as_scores to True, it's not just a matter of returning y as real values, you are actually returning a completely different y. But... I don't necessarily want to be overly pedantic here... so okay to leave as is.
There was a problem hiding this comment.
Yeah, just a test utility, not an API that we expect anyone to use.
…davide/exponentiated_gradient-BGL
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Summary of contributions:
closes #380