Repository: omni-us/jsonargparse

Issue:
[Question] Is it possible to change the init_args of list elements with giving ActionConfigFile
This is a minimal reproduction. If I have this Python code which implements `jsonargparse.ArgumentParser`

```python
# test.py

from lightning.pytorch.cli import LRSchedulerCallable, ReduceLROnPlateau
from jsonargparse import ArgumentParser, ActionConfigFile

class Model:
    def __init__(
        self,
        schedulers: list[LRSchedulerCallable] = lambda optim: ReduceLROnPlateau(
            optim,
            monitor="val/map50",
        ),
    ):
        self.schedulers = schedulers


if __name__ == "__main__":
    parser = ArgumentParser()
    parser.add_argument("--model", type=Model)
    parser.add_argument("--config", action=ActionConfigFile)
    cfg = parser.parse_args()
    print(cfg)
```

, and this YAML configuration file for it.
```yaml
# test.yaml

model:
  class_path: __main__.Model
  init_args:
    schedulers:
      - class_path: torch.optim.lr_scheduler.OneCycleLR
        init_args:
          max_lr: 0.1
      - class_path: lightning.pytorch.cli.ReduceLROnPlateau
        init_args:
          monitor: val/custom
          mode: max
          factor: 0.1
          patience: 4
```

What I want to is to override the `monitor` value of `ReduceLROnPlateau` without changing the other configuration values in the YAML file. For example,
```console
python test.py --config test.yaml --model.schedulers.monitor val/mAP50 --print_config
```

The expect output I want is 
```console
model:
  class_path: __main__.Model
  init_args:
    schedulers:
    - class_path: torch.optim.lr_scheduler.OneCycleLR
      init_args:
        max_lr: 0.1
        ...
    - class_path: lightning.pytorch.cli.ReduceLROnPlateau
      init_args:
        monitor: val/mAP50
        mode: max
        factor: 0.1
        patience: 4
```

However, what I got is 
```console
model:
  class_path: __main__.Model
  init_args:
    schedulers:
    - class_path: torch.optim.lr_scheduler.OneCycleLR
      init_args:
        max_lr: 0.1
        ...
    - class_path: lightning.pytorch.cli.ReduceLROnPlateau
      init_args:
        monitor: val/mAP50
        mode: min
        factor: 0.1
        patience: 10
        threshold: 0.0001
        threshold_mode: rel
        cooldown: 0
        min_lr: 0.0
        eps: 1.0e-08
        verbose: false
```
The other values of `ReduceLROnPlateau` are reset to its default, not ones in the configuration file.

Is there any method to allow this kind of overriding?

Discussion:
sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603)


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 99.92%. Comparing base [(`0c7839b`)](https://app.codecov.io/gh/omni-us/jsonargparse/commit/0c7839bcf9f5bee0246642b73c724083006b9a6c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) to head [(`1058347`)](https://app.codecov.io/gh/omni-us/jsonargparse/commit/1058347da4bb6e6e98052b6e44c9e8fa8f76372d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us).

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff             @@
##              main     #603      +/-   ##
===========================================
- Coverage   100.00%   99.92%   -0.08%     
===========================================
  Files           22       22              
  Lines         6492     6494       +2     
===========================================
- Hits          6492     6489       -3     
- Misses           0        5       +5     
```

| [Flag](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | Coverage Δ | |
|---|---|---|
| [py3.10](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `85.69% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.10_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.72% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.10_pydantic1](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `49.15% <66.66%> (+<0.01%)` | :arrow_up: |
| [py3.10_pydantic2](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `48.93% <66.66%> (+<0.01%)` | :arrow_up: |
| [py3.10_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.73% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.11](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `85.87% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.11_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.67% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.11_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.69% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.12](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `86.01% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.12_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.67% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.12_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.69% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.13](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `86.00% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.13_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.66% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.13_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `98.67% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.8](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `86.30% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.8_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.35% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.8_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.38% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.9](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `86.24% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.9_all](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.30% <100.00%> (-0.08%)` | :arrow_down: |
| [py3.9_types](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us) | `99.32% <100.00%> (-0.08%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/omni-us/jsonargparse/pull/603?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=omni-us).

sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [1 New issue](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603)


sonarcloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=omni-us_jsonargparse&pullRequest=603&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=omni-us_jsonargparse&pullRequest=603&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=omni-us_jsonargparse&pullRequest=603)



Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 9d94c57..c5db0c5 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -27,6 +27,14 @@ Fixed
 - Required and optional ``TypedDict`` keys are now correctly inferred when one
   inherits one ``TypedDict`` from another with different totality (`#597
   <https://github.com/omni-us/jsonargparse/pull/597>`__).
+- Callables that return class not considering previous values (`#603
+  <https://github.com/omni-us/jsonargparse/pull/603>`__).
+
+Changed
+^^^^^^^
+- Callables that return class with class default now normalizes the default to
+  a subclass spec with ``class_path`` (`#603
+  <https://github.com/omni-us/jsonargparse/pull/603>`__).
 
 
 v4.33.2 (2024-10-07)
diff --git a/jsonargparse/_core.py b/jsonargparse/_core.py
index 063b623..ce89003 100644
--- a/jsonargparse/_core.py
+++ b/jsonargparse/_core.py
@@ -1336,7 +1336,6 @@ class ArgumentParser(ParserDeprecations, ActionsContainer, ArgumentLinking, argp
         cfg_to = cfg_to.clone()
         with parser_context(parent_parser=self):
             ActionTypeHint.discard_init_args_on_class_path_change(self, cfg_to, cfg_from)
-        ActionTypeHint.delete_init_args_required_none(cfg_from, cfg_to)
         ActionTypeHint.delete_not_required_args(cfg_from, cfg_to)
         cfg_to.update(cfg_from)
         ActionTypeHint.apply_appends(self, cfg_to)
diff --git a/jsonargparse/_typehints.py b/jsonargparse/_typehints.py
index 14f095c..effbeae 100644
--- a/jsonargparse/_typehints.py
+++ b/jsonargparse/_typehints.py
@@ -274,6 +274,8 @@ class ActionTypeHint(Action):
             default_type = type(default)
             if not is_subclass(default_type, UnknownDefault) and self.is_subclass_typehint(default_type):
                 raise ValueError("Subclass types require as default either a dict with class_path or a lazy instance.")
+        elif ActionTypeHint.is_return_subclass_typehint(self._typehint) and inspect.isclass(default):
+            default = {"class_path": get_import_path(default)}
         return default
 
     @staticmethod
@@ -430,21 +432,6 @@ class ActionTypeHint(Action):
                     keys = keys[: num + 1] + [k for k in keys[num + 1 :] if not k.startswith(key + ".")]
             num += 1
 
-    @staticmethod
-    def delete_init_args_required_none(cfg_from, cfg_to):
-        for key, val in cfg_from.items(branches=True):
-            if isinstance(val, Namespace) and val.get("class_path") and val.get("init_args"):
-                skip_keys = [
-                    k
-                    for k, v in val.init_args.__dict__.items()
-                    if v is None and cfg_to.get(f"{key}.init_args.{k}") is not None
-                ]
-                if skip_keys:
-                    parser = ActionTypeHint.get_class_parser(val.class_path)
-                    for skip_key in skip_keys:
-                        if skip_key in parser.required_args:
-                            del val.init_args[skip_key]
-
     @staticmethod
     def delete_not_required_args(cfg_from, cfg_to):
         for key, val in list(cfg_to.items(branches=True)):
@@ -1021,6 +1008,7 @@ def adapt_typehints(
                         sub_add_kwargs,
                         skip_args=num_partial_args,
                         partial_classes=partial_classes,
+                        prev_val=prev_val,
                     )
             except (ImportError, AttributeError, ArgumentError) as ex:
                 raise_unexpected_value(f"Type {typehint} expects a function or a callable class: {ex}", val, ex)
@@ -1168,8 +1156,6 @@ def subclass_spec_as_namespace(val, prev_val=None):
         val = Namespace({root_key: val})
         if isinstance(prev_val, str):
             prev_val = Namespace(class_path=prev_val)
-        elif inspect.isclass(prev_val):
-            prev_val = Namespace(class_path=get_import_path(prev_val))
     if isinstance(val, dict):
         val = Namespace(val)
     if "init_args" in val and isinstance(val["init_args"], dict):


Test patch:
diff --git a/jsonargparse_tests/test_typehints.py b/jsonargparse_tests/test_typehints.py
index b5dfb06..51354d1 100644
--- a/jsonargparse_tests/test_typehints.py
+++ b/jsonargparse_tests/test_typehints.py
@@ -940,6 +940,7 @@ def test_callable_args_return_type_class(parser, subtests):
 
     with subtests.test("default"):
         cfg = parser.get_defaults()
+        assert cfg.optimizer.class_path == f"{__name__}.SGD"
         init = parser.instantiate_classes(cfg)
         optimizer = init.optimizer([0.1, 2, 3])
         assert isinstance(optimizer, SGD)
@@ -1226,6 +1227,42 @@ def test_callable_return_class_required_arg_from_default(parser):
     assert cfg.model.init_args.scheduler.init_args == Namespace(monitor="acc", factor=0.5)
 
 
+class ModelListCallableReturnClass:
+    def __init__(
+        self,
+        schedulers: List[Callable[[Optimizer], Union[StepLR, ReduceLROnPlateau]]] = [],
+    ):
+        self.schedulers = schedulers
+
+
+def test_list_callable_return_class(parser):
+    parser.add_argument("--cfg", action="config")
+    parser.add_argument("--model", type=ModelListCallableReturnClass)
+
+    config = {
+        "model": {
+            "class_path": f"{__name__}.ModelListCallableReturnClass",
+            "init_args": {
+                "schedulers": [
+                    {
+                        "class_path": f"{__name__}.StepLR",
+                    },
+                    {
+                        "class_path": f"{__name__}.ReduceLROnPlateau",
+                        "init_args": {
+                            "factor": 0.5,
+                        },
+                    },
+                ],
+            },
+        },
+    }
+
+    cfg = parser.parse_args([f"--cfg={config}", "--model.schedulers.monitor=val/mAP50"])
+    assert cfg.model.init_args.schedulers[1].class_path == f"{__name__}.ReduceLROnPlateau"
+    assert cfg.model.init_args.schedulers[1].init_args == Namespace(monitor="val/mAP50", factor=0.5)
+
+
 # lazy_instance tests