Callbacks - tf.keras.callbacks.ModelCheckpoint and tf.keras.callbacks.EarlyStopping -> set_params not working 
The problem is that `tf.keras.callbacks.ModelCheckpoint` and `tf.keras.callbacks.EarlyStopping` uses `set_params` from parent class `tf.keras.callbacks.Callback` which is not working well. So solution to add separate `set_params` method in both (I have also added `set_params`) source (tf.keras.callbacks.ModelCheckpoint): https://github.com/keras-team/keras/blob/v2.14.0/keras/callbacks.py#L1224-L1740 and source (tf.keras.callbacks.EarlyStopping): https://github.com/keras-team/keras/blob/v2.14.0/keras/callbacks.py#L1973-L2146.

```python 
import tensorflow as tf                                                         # load tensorflow 
import warnings                                                                 # load warnings 
class UpdatedModelCheckpoint(tf.keras.callbacks.ModelCheckpoint):

  # define set parameters method 
  def set_params(self,params:dict)->None:

    ''' make set give parameters dictionary ''' 

    if isinstance(params,dict):                                                 # make check parameter must be dictionary 
      for param,value in params.items():                                        # get parameter from parameter dictionary
        if hasattr(self,param):setattr(self,param,value)                        # if parameter present then sets its given value
        else:warnings.warn(f'Invalid paremeter -> {param} !',category=UserWarning)# else raise warning 
    else:raise ValueError(f'`params` must be dictionary of parameters, with key parameter name and value its value')# raise value error 

  
  # define method to get all paremeters 
  def get_params(self)->dict:

    ''' returns dictionary of all parameters '''

    return self.__dict__.copy()                                                 # make return all parameters dictionary copy 


#import tensorflow as tf                                                         # load tensorflow 
ckpt=UpdatedModelCheckpoint('/content/')                                        # make check point with updated class 
ckpt_params=ckpt.get_params()                                                   # get all parameters 
print('Parameters:',ckpt_params)                                                # see parameters dictionary
ckpt_params['save_best_only']=True                                              # update parameter "save_best_only" to True (default False)
ckpt_params['save_weights_only']=True                                           # update parameter "save_weights_only" to True (default False)
ckpt_params['epochs_since_last_save']=10                                        # update parameter "epochs_since_last_save" to 10 (default 0)
print('Current parameters:',ckpt.get_params())                                  # make print orginal paremetrs 
ckpt.set_params(ckpt_params)                                                    # try to make update parameters
print('Is same as updated?',ckpt_params==ckpt.__dict__)                         # make check both are same or not 
print('Updated parameters:',ckpt.get_params())                                  # updated parameters
```
```shell 
Parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': False, 'save_weights_only': False, 'save_freq': 'epoch', 'epochs_since_last_save': 0, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f597957e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>}
Current parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': False, 'save_weights_only': False, 'save_freq': 'epoch', 'epochs_since_last_save': 0, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f597957e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>}
Is same as updated? True
Updated parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': True, 'save_weights_only': True, 'save_freq': 'epoch', 'epochs_since_last_save': 10, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f597957e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>}
``` Same updates can be done with `tf.keras.callbacks.EarlyStopping`. 

```python 
import tensorflow as tf                                                         # load tensorflow 
import warnings                                                                 # load warnings 
class UpdatedEarlyStopping(tf.keras.callbacks.EarlyStopping):

  # define set parameters method 
  def set_params(self,params:dict)->None:

    ''' make set give parameters dictionary ''' 

    if isinstance(params,dict):                                                 # make check parameter must be dictionary 
      for param,value in params.items():                                        # get parameter from parameter dictionary
        if hasattr(self,param):setattr(self,param,value)                        # if parameter present then sets its given value
        else:warnings.warn(f'Invalid paremeter -> {param} !',category=UserWarning)# else raise warning 
    else:raise ValueError(f'`params` must be dictionary of parameters, with key parameter name and value its value')# raise value error 

  
  # define method to get all paremeters 
  def get_params(self)->dict:

    ''' returns dictionary of all parameters '''

    return self.__dict__.copy()                                                 # make return all parameters dictionary copy 

#import tensorflow as tf                                                         # load tensorflow 
lstp=UpdatedEarlyStopping()                                                     # make early stopping with updated class 
lstp_params=lstp.get_params()                                                   # get all parameters 
print('Parameters        :',lstp_params)                                        # see parameters dictionary
lstp_params['patience']=10                                                      # update parameter "patience" to 10 (default 0)
lstp_params['verbose']=1                                                        # update parameter "verbose" to 1 (default 0)
print('Updated parameters:',lstp_params)                                        # see updated parameters 
print('Object\'s current parameters:',lstp.get_params())                        # see parameters dictionary
lstp.set_params(lstp_params)                                                    # try to make update parameters
print('Object\'s updated parameters:',lstp.get_params())                        # see updated parameters dictionary
print('Is same as updated?',lstp_params==lstp.get_params())                     # make check both are same or not 
```
```shell
Parameters        : {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 0, 'verbose': 0, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}
Updated parameters: {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 10, 'verbose': 1, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}
Object's current parameters: {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 0, 'verbose': 0, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}
Object's updated parameters: {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 10, 'verbose': 1, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}
Is same as updated? True
``` Hi **@MegaCreater** 
I replicated this issue with Tf 2.14 version. I attached a [gist](https://colab.research.google.com/gist/Venkat6871/5d388972f17a824956fb3e22b8e96778/untitled11.ipynb) for reference.

Thank you! Okay.. I will create pull request.  Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62352">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62352">No</a>

```
Issue type                                           : Bug
Have you reproduced the bug with TensorFlow Nightly? : No
Source                                               : source
TensorFlow version                                   : v2.14.0-rc1-21-g4dacf3f368e 2.14.0
Custom code                                          : Yes
OS platform and distribution                         : Google colab 
Python version                                       : Python 3.10.12
```

`tf.keras.callbacks.ModelCheckpoint` and `tf.keras.callbacks.EarlyStopping`  -> set_params not working as assumed. 

```python 
import tensorflow as tf                                                         # load tensorflow 
ckpt=tf.keras.callbacks.ModelCheckpoint('/content/')                            # make check point 
ckpt_params=ckpt.__dict__                                                       # get all parameters 
print('Parameters:',ckpt_params)                                                # see parameters dictionary
ckpt_params['save_best_only']=True                                              # update parameter "save_best_only" to True (default False)
ckpt_params['save_weights_only']=True                                           # update parameter "save_weights_only" to True (default False)
ckpt.set_params(ckpt_params)                                                    # try to make update parameters
print('Is same as updated?',ckpt_params==ckpt.__dict__)                         # make check both are same or not 
# both look same but if you look carefully `ckpt_params` and `ckpt.__dict__` will contain copy of themself in new key `'params'`
print('Parameters:',ckpt_params)                                                # see parameters dictionary
```
```shell
Parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': False, 'save_weights_only': False, 'save_freq': 'epoch', 'epochs_since_last_save': 0, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f5942f5e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>}
Is same as updated? True
Parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': True, 'save_weights_only': True, 'save_freq': 'epoch', 'epochs_since_last_save': 0, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f5942f5e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>, 'params': {...}}
```

This change can be seen by making a copy of `ckpt_params`. 

```python 
import tensorflow as tf                                                         # load tensorflow 
ckpt=tf.keras.callbacks.ModelCheckpoint('/content/')                            # make check point 
ckpt_params=ckpt.__dict__.copy()                                                # get all parameters 
print('Parameters:',ckpt_params)                                                # see parameters dictionary
ckpt_params['save_best_only']=True                                              # update parameter "save_best_only" to True (default False)
ckpt_params['save_weights_only']=True                                           # update parameter "save_weights_only" to True (default False)
#ckpt_params_deep_copy={key:value for key,value in ckpt_params.items()}          # make deep copy of `ckpt_params`
ckpt.set_params(ckpt_params)                                                    # try to make update parameters
print('Is same as updated?',ckpt_params==ckpt.__dict__)                         # make check both are same or not 
# both look same but if you look carefully `ckpt_params` and `ckpt.__dict__` will contain copy of themself in new key `'params'`
print('Uncomman parameters:',[key for key in ckpt.__dict__ if key not in ckpt_params])# see parameters dictionary
print('Uncomman parameters:',ckpt.__dict__['params'])                           # which is copy of itself only 
```
```shell
Parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': False, 'save_weights_only': False, 'save_freq': 'epoch', 'epochs_since_last_save': 0, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f5942e3e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>}
Is same as updated? False
Uncomman parameters: ['params']
Uncomman parameters: {'validation_data': None, 'model': None, '_chief_worker_only': False, '_supports_tf_logs': True, 'monitor': 'val_loss', 'verbose': 0, 'filepath': '/content/', 'save_best_only': True, 'save_weights_only': True, 'save_freq': 'epoch', 'epochs_since_last_save': 0, '_batches_seen_since_last_saving': 0, '_last_batch_seen': 0, 'best': inf, '_options': <tensorflow.python.saved_model.save_options.SaveOptions object at 0x7a5f5942e3e0>, 'load_weights_on_restart': False, 'period': 1, 'monitor_op': <ufunc 'less'>}
```
Worse is with `tf.keras.callbacks.EarlyStopping`. It not only make a copy but also don't update parameters. 
```python
import tensorflow as tf                                                         # load tensorflow 
lstp=tf.keras.callbacks.EarlyStopping()                                         # make check point 
lstp_params=lstp.__dict__.copy()                                                # get all parameters 
print('Parameters        :',lstp_params)                                        # see parameters dictionary
lstp_params['patience']=10                                                      # update parameter "patience" to 10 (default 0)
lstp_params['verbose']=1                                                        # update parameter "verbose" to 1 (default 0)
print('Updated parameters:',lstp_params)                                        # see updated parameters 
lstp.set_params(lstp_params.copy())                                             # try to make update parameters
print('Is same as updated?',lstp_params==lstp.__dict__)                         # make check both are same or not 
# Even values are not updated from `lstp_params` and `lstp.__dict__` will contain copy of themself in new key `'params'`
print('Object parameters :',lstp.__dict__)                                              # see parameters dictionary
```
```shell
Parameters        : {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 0, 'verbose': 0, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}
Updated parameters: {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 10, 'verbose': 1, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}
Is same as updated? False
Object parameters : {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 0, 'verbose': 0, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>, 'params': {'validation_data': None, 'model': None, '_chief_worker_only': None, '_supports_tf_logs': False, 'monitor': 'val_loss', 'patience': 10, 'verbose': 1, 'baseline': None, 'min_delta': 0, 'wait': 0, 'stopped_epoch': 0, 'restore_best_weights': False, 'best_weights': None, 'start_from_epoch': 0, 'monitor_op': <ufunc 'less'>}}
```




