class_docstr: Program definition for MPO.
class_docstr_tok: ["Program","definition","for","MPO","."]
code: def __init__(
      self,
      environment_factory: Callable[[bool], dm_env.Environment],
      network_factory: Callable[
          [specs.BoundedArray], Dict[str, snt.Module]
      ],
      num_actors: int = 1,
      num_caches: int = 0,
      environment_spec: Optional[specs.EnvironmentSpec] = None,
      batch_size: int = 256,
      prefetch_size: int = 4,
      min_replay_size: int = 1000,
      max_replay_size: int = 1000000,
      samples_per_insert: Optional[float] = 32.0,
      n_step: int = 5,
      num_samples: int = 20,
      additional_discount: float = 0.99,
      target_policy_update_period: int = 100,
      target_critic_update_period: int = 100,
      variable_update_period: int = 1000,
      policy_loss_factory: Optional[Callable[[], snt.Module]] = None,
      max_actor_steps: Optional[int] = None,
      log_every: float = 10.0,
  ):
      if environment_spec is None:
          environment_spec = specs.make_environment_spec(
              environment_factory(False)
          )
  
      self._environment_factory = environment_factory
      self._network_factory = network_factory
      self._policy_loss_factory = policy_loss_factory
      self._environment_spec = environment_spec
      self._num_actors = num_actors
      self._num_caches = num_caches
      self._batch_size = batch_size
      self._prefetch_size = prefetch_size
      self._min_replay_size = min_replay_size
      self._max_replay_size = max_replay_size
      self._samples_per_insert = samples_per_insert
      self._n_step = n_step
      self._additional_discount = additional_discount
      self._num_samples = num_samples
      self._target_policy_update_period = target_policy_update_period
      self._target_critic_update_period = target_critic_update_period
      self._variable_update_period = variable_update_period
      self._max_actor_steps = max_actor_steps
      self._log_every = log_every
  
imports: from typing import Callable, Dict, Optional
  import acme
  from acme import datasets
  from acme import specs
  from acme.adders import reverb
  from acme.agents.tf import actors
  from acme.agents.tf.mpo import learning
  from acme.tf import networks
  from acme.tf import savers
  from acme.tf import utils
  from acme.tf import variable_utils
  from acme.utils import counting
  from acme.utils import loggers
  from acme.utils import lp_utils
  import dm_env
  import launchpad
  import reverb
  import sonnet
  import tensorflow
label_desc: Use image node_id 1 to create a new DistributedMPO object  with example: obj = DistributedMPO(environment_factory, network_factory, num_actors, num_caches, environment_spec, batch_size, prefetch_size, min_replay_size, max_replay_size, samples_per_insert, n_step, num_samples, additional_discount, target_policy_update_period, target_critic_update_period, variable_update_period, policy_loss_factory, max_actor_steps, log_every)