-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revises handling of quantization offsets.
- The quantization offset for DeepFactorized is now determined numerically instead of assuming zero. - For batched entropy models, the `non_integer_offset` argument controls whether the quantization offset heuristic is used or not (as before). - For location-scale family entropy models, always quantize to integers modulo location parameter of the prior distribution. - For general indexed entropy models, do not use quantization offset heuristic, and always quantize to integers. - Universal entropy models use their own logic, as before. The above is accomplished by some refactoring: - The logic for creating the range coding tables is moved from the initializer of the base class in continuous_base.py to the initializers of the subclasses. This makes it possible to streamline the building of the range coding tables and make that logic available as a private method to be called by subclasses instead. - Models in in universal.py now depend directly on the base class. This way, they don't need to inherit the quantization offset logic and can implement their own. Both of these changes make it possible to remove indirection. They also free parent classes from having to implement functionality they don't need, and child classes from inheriting functionality that doesn't make sense for them. PiperOrigin-RevId: 420564225 Change-Id: I57cdd9627b83db3a2455a23d9481ccb23309f957
- Loading branch information
1 parent
c60a5a9
commit edb8df5
Showing
24 changed files
with
826 additions
and
516 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
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
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
Oops, something went wrong.