Abhishek Bhatia
04/04/2024, 3:44 PMOmegaConf
not supporting tuple, how do you get over scenarios where tuple is absolutely necessary and list won't work? I know you can handle it inside code but sometimes that's too inconvenient.
For example here, feature_range has to be a tuple and scikit-learn>1.2.0
will raise an error if it's not, but OmegaConf
won't accept it.
Handling it case by case for every algorithm is not feasible at all, as it requires a mapping of all type hints.
- object: sklearn.preprocessing.MinMaxScaler
feature_range: [0, 1]
Using PyYaml
you could do something like:
feature_range: !!python/tuple [0, 1]
But this isn't supported in OmegaConf
Is custom resolver the way? something like {tuple:[1, 2, 3]}
Thanks! 🙂
CC: @Filipe OliveiraNok Lam Chan
04/04/2024, 3:51 PMNok Lam Chan
04/04/2024, 3:52 PMNok Lam Chan
04/04/2024, 3:52 PMNok Lam Chan
04/04/2024, 3:52 PMNok Lam Chan
04/04/2024, 3:55 PMyaml.safe_load
?Nok Lam Chan
04/04/2024, 3:55 PMAbhishek Bhatia
04/04/2024, 3:57 PMyaml.load
but I doubt it would work with yaml.safe_load
Will give it a tryFilipe Oliveira
04/04/2024, 4:02 PMdatajoely
04/04/2024, 4:51 PMdatajoely
04/04/2024, 4:51 PM