tfl.configs.apply_updates Stay organized with collections Save and categorize content based on your preferences.
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)
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. |
Returns |
| Number of updates that are applied to the model config. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-02 UTC."],[],[]]