def build_batch_preprocessor(self) -> BatchPreprocessor: return DiscreteDqnBatchPreprocessor( state_preprocessor=Preprocessor( normalization_parameters=self.state_normalization_parameters, use_gpu=self.use_gpu, ) )
def build_batch_preprocessor(self) -> BatchPreprocessor: state_preprocessor = Preprocessor( self.state_normalization_data.dense_normalization_parameters, ) return DiscreteDqnBatchPreprocessor( num_actions=len(self.model_manager.action_names), state_preprocessor=state_preprocessor, )
def build_batch_preprocessor(self) -> BatchPreprocessor: return DiscreteDqnBatchPreprocessor( num_actions=len(self.action_names), state_preprocessor=Preprocessor( normalization_parameters=self.state_normalization_parameters, use_gpu=self.use_gpu, ), use_gpu=self.use_gpu, )
def build_batch_preprocessor(self) -> BatchPreprocessor: return DiscreteDqnBatchPreprocessor( # pyre-fixme[16]: `DiscreteDQNBase` has no attribute `action_names`. num_actions=len(self.action_names), state_preprocessor=Preprocessor( normalization_parameters=self.state_normalization_parameters, use_gpu=self.use_gpu, ), use_gpu=self.use_gpu, )
def __init__( self, model_params: DiscreteActionModelParameters, state_normalization: Dict[int, NormalizationParameters], use_gpu: bool, use_all_avail_gpus: bool, ): logger.info("Running DQN workflow with params:") logger.info(model_params) self.model_params = model_params self.state_normalization = state_normalization trainer = create_dqn_trainer_from_params( model_params, state_normalization, use_gpu=use_gpu, use_all_avail_gpus=use_all_avail_gpus, ) trainer = update_model_for_warm_start(trainer) assert type(trainer) == DQNTrainer, "Warm started wrong model type: " + str( type(trainer) ) evaluator = Evaluator( model_params.actions, model_params.rl.gamma, trainer, metrics_to_score=trainer.metrics_to_score, ) super().__init__( DiscreteDqnBatchPreprocessor(Preprocessor(state_normalization, use_gpu)), trainer, evaluator, model_params.training.minibatch_size, )