Skip to content
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

add missing get_config methods to layers #107

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

chjort
Copy link
Contributor

@chjort chjort commented Feb 7, 2022

Added missing get_config methods to CutMix and MixUp layers. Since CutMix serves as a sample for new layer contributions, it is important that get_config methods are also in place.

@LukeWood LukeWood merged commit efc5308 into keras-team:master Feb 7, 2022
@chjort chjort deleted the get_config branch February 7, 2022 19:52
LukeWood pushed a commit that referenced this pull request Feb 8, 2022
LukeWood added a commit that referenced this pull request Feb 14, 2022
* Introduces an Equalize preprocessing layer

* Remove fill utils import

* Update README.md

* Update README.md

* Update README.md

* Address Francois' comments

* Raise error when receives incorrect Tensor type

* Address Scott's comments

* Add a basic test case

* Reformat equalize and equalize_test

* Remove numpy

* Update ROADMAP.md

Fix the indentation in the roadmap.md

* Fix typo

* refactor arguments of fill_utils.rectangle_masks (#98)

* refactor arguments

* fix variable

* mask_shape argument and docstring

* add shape info to docstring returns

* Remove the `rate` argument from all KPLs. (#103)

* Remove the `rate` argument from all KPLs.

This will be replaced by a unified API

* format random cutout test

* add missing get_config methods (#107)

* Prepare to land COCORecall, refactoring, RaggedTensor inputs, etc (#99)

* Refactor COCORecall

COCOBase is not feasible due to the way COCOMaP
must be computed.  The good news that comes
with this is that I am able to drastically
simplify the COCORecall implementation, as well
as make it more specialized.

This PR also updates the way constants on the metric
are tracked in order to support the default `merge_state`
method, provides more thorough documentation, and
merges COCOBase and COCORecall's unit tests

* Update test cases per Scott's comments on #80

* Fix broken test case

* support ragged tensor inputs

* remove whitespace

* Begin addressing comments from Francois and Scott

- updates docstring
- changes some default parameters

* Reorganize, refactor, address all comments

* Reformat

* Update recall example script

* Run format.sh

* Remove recall demo

* Updated docstring example

* Update compute dtypes to be respected, allows users to use
float64

* Reformat

* Update to respect compute dtype

* Update bbox_test.py (#116)

* Added Solarize preprocessing layer. (#106)

* Added Invert preprocessing layer.

* Added Invert layer constructor params. Refactored Invert layer tests.

* Added get_config method to Invert layer.

* Modified Invert layer docstring.

* Renamed Invert layer to Solarization.

* Added optional threshold parameter to Solarization layer.

* Added input values clipping in Solarization layer.

* Added reference in the docstring for Solarization layer.

* Update Solarization per API design decision

* Update get_config

* Run black

Co-authored-by: Luke Wood <lukewood@google.com>

* Update equalize per Francois comments

* Run black

* Remove unused import

* Add API design guidelines for preprocessing layers (#129)

* Add API design guidelines for preprocessing layers

* Address bhack's comment

* Updated equilize to equalization

* Fix import issue

* add import aliases to layers

* Run black

* add grid_mask preprocessing layers (#92)

* add grid_mask

* add todo

* add todo

* add todo

* remove_gridmask_size_ratio param

* add_seed

* add_gridmask_rotation

* update_docstring_for_rotate_seed

* remove_rate_params

* support_3d_input

* update_docstring

* update_dockstring

* run_gridmask_test_ok

* add fill_value and fill_mode params

* format_code and add training none check

* fix_training2none and update get_config

* fix_typo

* rename gridmask rotation factor to ratation factor

* rename crop fn and mask fn

* add comment on length and update docstring for ratio=1

* support tf_uint8 update docs

* update_call_fn_on_notTraining

* fix_bug_multipy_by_zeor

* rename mask to _compute_mask

* update params

* explicit dtype/axis mention

* add input checker

* remove ratio 1 case

* ok_pytest

* add copyright str

* fix typo

* Update grad_mask  before merge

* Remove unneeded method

* last copy-edits

* Run format

* fix lint issues

Co-authored-by: Luke <lukewoodcs@gmail.com>

* Fix test for merge

* Introduces an Equalize preprocessing layer

* Remove fill utils import

* Address Francois' comments

* Raise error when receives incorrect Tensor type

* Address Scott's comments

* Add a basic test case

* Reformat equalize and equalize_test

* Remove numpy

* Fix typo

* Update equalize per Francois comments

* Run black

* Remove unused import

* Updated equilize to equalization

* Fix import issue

* Fix test for merge

Co-authored-by: Qianli Scott Zhu <scottzhu@google.com>
Co-authored-by: Christoffer Hjort <christofferhjort1@gmail.com>
Co-authored-by: Sebastian <mocart15@gmail.com>
Co-authored-by: Mohammed Innat <innat1994@gmail.com>
ianstenbit pushed a commit to ianstenbit/keras-cv that referenced this pull request Aug 6, 2022
ianstenbit pushed a commit to ianstenbit/keras-cv that referenced this pull request Aug 6, 2022
* Introduces an Equalize preprocessing layer

* Remove fill utils import

* Update README.md

* Update README.md

* Update README.md

* Address Francois' comments

* Raise error when receives incorrect Tensor type

* Address Scott's comments

* Add a basic test case

* Reformat equalize and equalize_test

* Remove numpy

* Update ROADMAP.md

Fix the indentation in the roadmap.md

* Fix typo

* refactor arguments of fill_utils.rectangle_masks (keras-team#98)

* refactor arguments

* fix variable

* mask_shape argument and docstring

* add shape info to docstring returns

* Remove the `rate` argument from all KPLs. (keras-team#103)

* Remove the `rate` argument from all KPLs.

This will be replaced by a unified API

* format random cutout test

* add missing get_config methods (keras-team#107)

* Prepare to land COCORecall, refactoring, RaggedTensor inputs, etc (keras-team#99)

* Refactor COCORecall

COCOBase is not feasible due to the way COCOMaP
must be computed.  The good news that comes
with this is that I am able to drastically
simplify the COCORecall implementation, as well
as make it more specialized.

This PR also updates the way constants on the metric
are tracked in order to support the default `merge_state`
method, provides more thorough documentation, and
merges COCOBase and COCORecall's unit tests

* Update test cases per Scott's comments on keras-team#80

* Fix broken test case

* support ragged tensor inputs

* remove whitespace

* Begin addressing comments from Francois and Scott

- updates docstring
- changes some default parameters

* Reorganize, refactor, address all comments

* Reformat

* Update recall example script

* Run format.sh

* Remove recall demo

* Updated docstring example

* Update compute dtypes to be respected, allows users to use
float64

* Reformat

* Update to respect compute dtype

* Update bbox_test.py (keras-team#116)

* Added Solarize preprocessing layer. (keras-team#106)

* Added Invert preprocessing layer.

* Added Invert layer constructor params. Refactored Invert layer tests.

* Added get_config method to Invert layer.

* Modified Invert layer docstring.

* Renamed Invert layer to Solarization.

* Added optional threshold parameter to Solarization layer.

* Added input values clipping in Solarization layer.

* Added reference in the docstring for Solarization layer.

* Update Solarization per API design decision

* Update get_config

* Run black

Co-authored-by: Luke Wood <lukewood@google.com>

* Update equalize per Francois comments

* Run black

* Remove unused import

* Add API design guidelines for preprocessing layers (keras-team#129)

* Add API design guidelines for preprocessing layers

* Address bhack's comment

* Updated equilize to equalization

* Fix import issue

* add import aliases to layers

* Run black

* add grid_mask preprocessing layers (keras-team#92)

* add grid_mask

* add todo

* add todo

* add todo

* remove_gridmask_size_ratio param

* add_seed

* add_gridmask_rotation

* update_docstring_for_rotate_seed

* remove_rate_params

* support_3d_input

* update_docstring

* update_dockstring

* run_gridmask_test_ok

* add fill_value and fill_mode params

* format_code and add training none check

* fix_training2none and update get_config

* fix_typo

* rename gridmask rotation factor to ratation factor

* rename crop fn and mask fn

* add comment on length and update docstring for ratio=1

* support tf_uint8 update docs

* update_call_fn_on_notTraining

* fix_bug_multipy_by_zeor

* rename mask to _compute_mask

* update params

* explicit dtype/axis mention

* add input checker

* remove ratio 1 case

* ok_pytest

* add copyright str

* fix typo

* Update grad_mask  before merge

* Remove unneeded method

* last copy-edits

* Run format

* fix lint issues

Co-authored-by: Luke <lukewoodcs@gmail.com>

* Fix test for merge

* Introduces an Equalize preprocessing layer

* Remove fill utils import

* Address Francois' comments

* Raise error when receives incorrect Tensor type

* Address Scott's comments

* Add a basic test case

* Reformat equalize and equalize_test

* Remove numpy

* Fix typo

* Update equalize per Francois comments

* Run black

* Remove unused import

* Updated equilize to equalization

* Fix import issue

* Fix test for merge

Co-authored-by: Qianli Scott Zhu <scottzhu@google.com>
Co-authored-by: Christoffer Hjort <christofferhjort1@gmail.com>
Co-authored-by: Sebastian <mocart15@gmail.com>
Co-authored-by: Mohammed Innat <innat1994@gmail.com>
adhadse pushed a commit to adhadse/keras-cv that referenced this pull request Sep 17, 2022
adhadse pushed a commit to adhadse/keras-cv that referenced this pull request Sep 17, 2022
* Introduces an Equalize preprocessing layer

* Remove fill utils import

* Update README.md

* Update README.md

* Update README.md

* Address Francois' comments

* Raise error when receives incorrect Tensor type

* Address Scott's comments

* Add a basic test case

* Reformat equalize and equalize_test

* Remove numpy

* Update ROADMAP.md

Fix the indentation in the roadmap.md

* Fix typo

* refactor arguments of fill_utils.rectangle_masks (keras-team#98)

* refactor arguments

* fix variable

* mask_shape argument and docstring

* add shape info to docstring returns

* Remove the `rate` argument from all KPLs. (keras-team#103)

* Remove the `rate` argument from all KPLs.

This will be replaced by a unified API

* format random cutout test

* add missing get_config methods (keras-team#107)

* Prepare to land COCORecall, refactoring, RaggedTensor inputs, etc (keras-team#99)

* Refactor COCORecall

COCOBase is not feasible due to the way COCOMaP
must be computed.  The good news that comes
with this is that I am able to drastically
simplify the COCORecall implementation, as well
as make it more specialized.

This PR also updates the way constants on the metric
are tracked in order to support the default `merge_state`
method, provides more thorough documentation, and
merges COCOBase and COCORecall's unit tests

* Update test cases per Scott's comments on keras-team#80

* Fix broken test case

* support ragged tensor inputs

* remove whitespace

* Begin addressing comments from Francois and Scott

- updates docstring
- changes some default parameters

* Reorganize, refactor, address all comments

* Reformat

* Update recall example script

* Run format.sh

* Remove recall demo

* Updated docstring example

* Update compute dtypes to be respected, allows users to use
float64

* Reformat

* Update to respect compute dtype

* Update bbox_test.py (keras-team#116)

* Added Solarize preprocessing layer. (keras-team#106)

* Added Invert preprocessing layer.

* Added Invert layer constructor params. Refactored Invert layer tests.

* Added get_config method to Invert layer.

* Modified Invert layer docstring.

* Renamed Invert layer to Solarization.

* Added optional threshold parameter to Solarization layer.

* Added input values clipping in Solarization layer.

* Added reference in the docstring for Solarization layer.

* Update Solarization per API design decision

* Update get_config

* Run black

Co-authored-by: Luke Wood <lukewood@google.com>

* Update equalize per Francois comments

* Run black

* Remove unused import

* Add API design guidelines for preprocessing layers (keras-team#129)

* Add API design guidelines for preprocessing layers

* Address bhack's comment

* Updated equilize to equalization

* Fix import issue

* add import aliases to layers

* Run black

* add grid_mask preprocessing layers (keras-team#92)

* add grid_mask

* add todo

* add todo

* add todo

* remove_gridmask_size_ratio param

* add_seed

* add_gridmask_rotation

* update_docstring_for_rotate_seed

* remove_rate_params

* support_3d_input

* update_docstring

* update_dockstring

* run_gridmask_test_ok

* add fill_value and fill_mode params

* format_code and add training none check

* fix_training2none and update get_config

* fix_typo

* rename gridmask rotation factor to ratation factor

* rename crop fn and mask fn

* add comment on length and update docstring for ratio=1

* support tf_uint8 update docs

* update_call_fn_on_notTraining

* fix_bug_multipy_by_zeor

* rename mask to _compute_mask

* update params

* explicit dtype/axis mention

* add input checker

* remove ratio 1 case

* ok_pytest

* add copyright str

* fix typo

* Update grad_mask  before merge

* Remove unneeded method

* last copy-edits

* Run format

* fix lint issues

Co-authored-by: Luke <lukewoodcs@gmail.com>

* Fix test for merge

* Introduces an Equalize preprocessing layer

* Remove fill utils import

* Address Francois' comments

* Raise error when receives incorrect Tensor type

* Address Scott's comments

* Add a basic test case

* Reformat equalize and equalize_test

* Remove numpy

* Fix typo

* Update equalize per Francois comments

* Run black

* Remove unused import

* Updated equilize to equalization

* Fix import issue

* Fix test for merge

Co-authored-by: Qianli Scott Zhu <scottzhu@google.com>
Co-authored-by: Christoffer Hjort <christofferhjort1@gmail.com>
Co-authored-by: Sebastian <mocart15@gmail.com>
Co-authored-by: Mohammed Innat <innat1994@gmail.com>
freedomtan pushed a commit to freedomtan/keras-cv that referenced this pull request Jul 20, 2023
Also updated example in `Reshape` layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants