# tfl.configs.apply_updates

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/configs.py#L1114-L1152) |

Updates a model config with the given set of (key, values) updates.

    tfl.configs.apply_updates(
        model_config, updates
    )

Any value passed in the updates that matches a field of the config will be
applied to the config. Nested configs can be updated as follows: to add/update
a field `FIELD` in feature config for feature `FEATURE`, use
`feature__FEATURE__FIELD` as the key. To add/update a field `FIELD` for
regularizer with name `REGULARIZER` use `regularizer__REGULARIZER__FIELD` as
the key. This naming scheme can be nested. When possible, string values will
be converted to the corresponding value type in the model config.

#### Example:

    model_config = ...
    updates = [
        ('output_max', 1),
        ('regularizer__torsion__l1', 0.001),
        ('feature__some_feature_name__lattice_size', 4),
        ('feature__some_feature_name__regularizer__calib_hessian__l2', 0.001),
        ('unrelated_haparam_not_affecting_model_config', 42),
    ]
    configs.apply_updates(model_config, updates)

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `model_config` | The model config object to apply the updates to. |
| `updates` | A list of (key, value) pairs with potential config updates. Values that are not matched to a field in the model config will be ignored. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Number of updates that are applied to the model config. ||

<br />