-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, serialization / deserialization would fail if: - the layer was saved / restored before `adapt` was called - the layer was saved / restored after `adapt` was called, but the dataset was such that the number of bins learned was fewer than `num_bins` The fix consists in adding a `from_config` to handle `bin_boundaries` separately. This is because at initial creation, `bin_boundaries` and `num_bins` cannot be both set, but when restoring the layer after `adapt`, they are both set. Tightened the error checking: - never allow `num_bins` and `bin_boundaries` to be specified at the same time, even if they match (same as `tf_keras`) - don't allow `num_bins` and `bin_boundaries` to be `None` at the same time - verify that `adapt` has been called in `call` Also removed `init_bin_boundaries` as the value was never used and its presence can be inferred.
- Loading branch information
Showing
2 changed files
with
81 additions
and
15 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