DeepPavlov icon indicating copy to clipboard operation
DeepPavlov copied to clipboard

add lambda function support in config files e.g., lr_lambda argument for torch optimizer schedulers

Open yurakuratov opened this issue 4 years ago • 0 comments

Want to contribute to DeepPavlov? Please read the contributing guideline first.

What problem are we trying to solve?:

`lr_lambda` argument can't be passed to `optim.lr_scheduler.LambdaLR`
`lr_lambda` argument is a lambda function and in case of this configuration file:

"lr_scheduler": "LambdaLR",
        "lr_scheduler_parameters": {
          "lr_lambda": "lambda x: x"
        }

lr_lambda is treated like python string

How can we solve it?:

run eval(lr_lambda) when passing lambda function as argument

Are there other issues that block this solution?:

NA

yurakuratov avatar Aug 27 '20 09:08 yurakuratov