def get_state_featurizer_from_dict(cls, featurizer_config) -> Tuple[Any, Any]: # featurizer can have only 1 state featurizer if len(featurizer_config["state_featurizer"]) > 1: raise InvalidPolicyConfig("featurizer can have only 1 state featurizer") state_featurizer_config = featurizer_config["state_featurizer"][0] state_featurizer_name = state_featurizer_config.pop("name") state_featurizer_func = registry.state_featurizer_from_module_path( state_featurizer_name ) return state_featurizer_func, state_featurizer_config
def get_state_featurizer_from_dict(cls, featurizer_config) -> Tuple[Any, Any]: # featurizer can have only 1 state featurizer if len(featurizer_config["state_featurizer"]) > 1: raise InvalidPolicyConfig( f"Every featurizer can only have 1 state " f"featurizer but one of the featurizers uses " f"{len(featurizer_config['state_featurizer'])}.") state_featurizer_config = featurizer_config["state_featurizer"][0] state_featurizer_name = state_featurizer_config.pop("name") state_featurizer_func = registry.state_featurizer_from_module_path( state_featurizer_name) return state_featurizer_func, state_featurizer_config