Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the handling of IndexedSlices with repeated sparse indices in opt…
…imizers This changes the behavior of AdagradOptimizer and AdamOptimizer, among others, when dealing with sparse gradients (e.g. generated from embedding lookups), correcting it to be equivalent to the dense behavior. Previously sparse gradients with repeated indices would lead to sums of squares rather than a squared sum (AdagradOptimizer) or repeated momentum updates (AdamOptimizer), with related bugs in other optimizers which either do non-linear computations with gradients or apply momentum updates. Adds _apply_sparse_duplicate_indices which allows optimizers to manually deal with duplicate indices, but otherwise defaults them to first uniquifying the IndexedSlices. Future changes will add checks to C++ optimizer implementations to prevent repeated index bugs when called from outside the Python interface. Change: 146010483
- Loading branch information
1 parent
ab2f960
commit f9f56f9
Showing
4 changed files
with
110 additions
and
3 deletions.
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