def create_predictor(trainer, model_type, use_gpu, action_dim=None): if model_type == ModelType.SOFT_ACTOR_CRITIC.value: predictor = GymSACPredictor(trainer, action_dim) elif model_type in ( ModelType.PYTORCH_DISCRETE_DQN.value, ModelType.PYTORCH_PARAMETRIC_DQN.value, ): predictor = GymDQNPredictor(trainer, action_dim) else: raise NotImplementedError() return predictor
def create_predictor(trainer, model_type, use_gpu): if model_type == ModelType.CONTINUOUS_ACTION.value: predictor = GymDDPGPredictor(trainer) elif model_type == ModelType.SOFT_ACTOR_CRITIC.value: predictor = GymSACPredictor(trainer) elif model_type in ( ModelType.PYTORCH_DISCRETE_DQN.value, ModelType.PYTORCH_PARAMETRIC_DQN.value, ): predictor = GymDQNPredictor(trainer) else: raise NotImplementedError() return predictor