DeepPavlov
DeepPavlov copied to clipboard
add lambda function support in config files e.g., lr_lambda argument for torch optimizer schedulers
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