Keras-adamw

Latest version: v1.38

Safety actively analyzes 630305 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

1.30

**FEATURES**:
- Compatibility with TF 2.2 (other versions still compatible, but no longer tested)
- `eta_t` now behaves deterministically, updating after `t_cur` (previously, behavior was semi-random)
- Lots of code cleanup

**USAGE NOTES**:
- `t_cur` should now be set to `-1` instead of `0` to reset `eta_t` to 0
- `t_cur` should now be set at `iters == total_iterations - 2`; explanation [here](https://github.com/OverLordGoldDragon/keras-adamw/blob/master/tests/test_optimizers.pyL53)
- `total_iterations` must now be `> 1`, instead of only `> 0`
- `total_iterations <= 1` will force `weight_decays` and `lr_multipliers` to `None`

**FIXES**:
- Optimizers will no longer zero layer penalties if weight decays cannot be applied (i.e. `total_iterations` is not `> 1`)
- `eta_t` is now properly updated as a `tf.Variable`, instead of being an update `tf.Tensor`
- Testing didn't actually include Eager in last version - now does

**BREAKING**:
- `utils_225tf.py` removed
- `utils_common.py` removed
- `optimizers_tfpy.py` removed
- `utils.py` code is now that of `utils_225tf.py`
- `utils_common.py` merged with `utils.py`
- `self.batch_size` is now an `int`, instead of `tf.Variable`

**MISC**:
- `tests`: `/test_optimizers`, `/test_optimizers_225`, `/test_optimizers_225tf`, `test_optimizers_v2`, `test_optimizers_tfpy` removed
- All tests now done in single file: `tests/test_optimizers.py`
- `_update_t_cur_eta_t` and `_update_t_cur_eta_t_apply_lr_mult` added to `utils.py`
- Updated `examples.py` and related parts in README

1.23

**BUGFIX**:
- `l1` was being decayed as `l2`, and vice versa; formula now correct

**FEATURES**:
- Performance boost due to including only nonzero decays (`l1`, `l2`) in calculations

**MISC**:

- Rename funcs in `utils_common`, and remove unused kwarg in `get_weight_decays`

1.21

**FEATURES**:

- `from keras_adamw import` now accounts for TF 1.x + Keras 2.3.x case
- `model` and `zero_penalties` now show up in optimizer constructor input signatures, making them clearer and more Pythonic
- Each optimizer now has its own full docstring, instead of deferring to `help(AdamW)`

**BREAKING**:

- `model` is no longer to be passed as first positional argument, but as a later one, or a keyword argument (`model=model`)

**BUGFIXES**:

- `name` defaults corrected, many were `"AdamW"` even if not AdamW - though no bugs were encountered as a result

**MISC**:

- `__init__` wrapper moved inside of `__init__` to avoid overriding input signature

1.15

**New features**:

- Simplified imports; just use `from keras_adamw import` for both the optimizers and utils, only requiring `import os; os.environ["TF_KERAS"]='1'` if using `tensorflow.keras` imports.

**Breaking changes**:

- Environment flags are now set via `'1'` and `'0'`, instead of `'True'` and `'False'`

**Bug fixes**:

- `get_configs()` incorrectly cast `eta_min`, `eta_max`, and `eta_t` via `int` - changed to `float`

1.2

**FEATURES**:

- **Automatic weight decay inference** and zeroing; set as usual, e.g. `kernel_regularizer=l2(1e-4)`
- **L1, L1-L2 decay** now supported
- PyPi-indexed: `pip install keras-adamw`

**BREAKING**:

- Moved some utils to new `utils_common.py`

**BUGFIXES**:

- `fill_dict_in_order`: `_list_of_vals` -> `values_list`
- `example.py`: `from keras_adamw.optimizers` -> `from keras_adamw`

**MISC**:

- Update docstrings
- Bump TF version to 2.1 in testing
- Changed README example
- Changed some tests

1.1

**New features**:

- Full compatibility with TensorFlow 2.0.0 and Keras 2.3.0 (`keras` + `tf.keras`)
- Full compatibility with TensorFlow 1.14.0 and Keras 2.2.5 (`keras` + `tf.keras`)^
- Run-based weight decay normalization scheme, normalizing over arbitrary of iterations independent of LR scheduler (e.g. over all epochs) (`total_iterations_wd`)
- `utils` now contain all common optimizer ops, e.g. `_apply_weight_decays()`
- Reference implementation compatible with `tf.python.keras`, TF2 + Keras 2.3.0; see docstring
- Cleaner code

^ - also compatible w/ TensorFlow 1.13.0 & 1.15.0, Keras 2.2.3-2.2.4

<hr>

**BUGFIXES**:

- `lr_multipliers` were _not_ being applied for `AdamW`
- `SGDW` was missing `K.symbolic` wrapper
- `and total_iterations != 0` was missing for `NadamW` and `SGDW`, yielding NaN optimizer weights for `total_iterations = 0`
- TF reset seed method was incompatible w/ TF 2.0.0; added support for both

<hr>

**Misc changes**:

- Updated `README.md` w/ info on `total_iterations_wd`
- Added `README.md` to `keras_adamw` on module version selection
- Added unit tests for respective optimizers
- Revamped `test.sh`; each test has a dedicated folder to ease coverage isolation
- Revamped `.travis.yml`:
- Added versioning builds w/ `TF_KERAS`, `TF_EAGER`, `TF_VERSION`, and `KERAS_VERSION` flags
- Removed boolean `KERAS` flag; repo is based on Keras
- Reorder buggy `setuptools` & `conda update -all` commands
- Moved testing module requirements from `requirements.txt` to `requirements-test.txt`

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.