class_docstr: Baseclass of ES training master runners (serves as basis for dev and other runners).
class_docstr_tok: ["Baseclass","of","ES","training","master","runners","(","serves","as","basis","for","dev","and","other","runners",")","."]
docstr: See :py:meth:`~maze.train.trainers.common.training_runner.TrainingRunner.run`.
  :param distributed_rollouts: The distribution interface for experience collection.
  :param n_epochs: Number of epochs to train.
  :param model_selection: Optional model selection class, receives model evaluation results.
docstr_tok: ["See",":","py",":","meth",":","`","~maze.train.trainers.common.training_runner.TrainingRunner.run","`",".",":","param","distributed_rollouts",":","The","distribution","interface","for","experience","collection",".",":","param","n_epochs",":","Number","of","epochs","to","train",".",":","param","model_selection",":","Optional","model","selection","class",",","receives","model","evaluation","results","."]
code: def run(
      self,
      n_epochs: Optional[int] = None,
      distributed_rollouts: Optional[ESDistributedRollouts] = None,
      model_selection: Optional[ModelSelectionBase] = None,
  ) -> None:
      """
      See :py:meth:`~maze.train.trainers.common.training_runner.TrainingRunner.run`.
      :param distributed_rollouts: The distribution interface for experience collection.
      :param n_epochs: Number of epochs to train.
      :param model_selection: Optional model selection class, receives model evaluation results.
      """
  
      print("********** Run Trainer **********")
  
      env = self.env_factory()
      env.seed(self.maze_seeding.generate_env_instance_seed())
  
      # run with pseudo-distribution, without worker processes
      self._trainer.train(
          n_epochs=self._cfg.algorithm.n_epochs
          if n_epochs is None
          else n_epochs,
          distributed_rollouts=self.create_distributed_rollouts(
              env=env,
              shared_noise=self.shared_noise,
              agent_instance_seed=self.maze_seeding.generate_agent_instance_seed(),
          )
          if distributed_rollouts is None
          else distributed_rollouts,
          model_selection=self._model_selection
          if model_selection is None
          else model_selection,
      )
  
imports: import dataclasses
  from abc import abstractmethod, ABC
  from typing import Union, Optional
  from maze.core.agent.policy import Policy
  from maze.core.agent.torch_model import TorchModel
  from maze.core.utils.factory import Factory
  from omegaconf import DictConfig
  from maze.core.agent.torch_policy import TorchPolicy
  from maze.core.annotations import override
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.train.trainers.common.model_selection.best_model_selection import BestModelSelection
  from maze.train.trainers.common.model_selection.model_selection_base import ModelSelectionBase
  from maze.train.trainers.common.training_runner import TrainingRunner
  from maze.train.trainers.es.distributed.es_distributed_rollouts import ESDistributedRollouts
  from maze.train.trainers.es.distributed.es_dummy_distributed_rollouts import ESDummyDistributedRollouts
  from maze.train.trainers.es.distributed.es_subproc_distributed_rollouts import ESSubprocDistributedRollouts
  from maze.train.trainers.es.es_shared_noise_table import SharedNoiseTable
  from maze.train.trainers.es.es_trainer import ESTrainer
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 3 for calling the ESMasterRunner obj's underlying member method code with example usage: obj.run(n_epochs, distributed_rollouts, model_selection) without return types