class_docstr: Program definition for IMPALA.
code: def __init__(
      self,
      environment_factory: Callable[[bool], dm_env.Environment],
      network_factory: Callable[[specs.DiscreteArray], snt.RNNCore],
      num_actors: int,
      sequence_length: int,
      sequence_period: int,
      environment_spec: Optional[specs.EnvironmentSpec] = None,
      batch_size: int = 256,
      prefetch_size: int = 4,
      max_queue_size: int = 10_000,
      learning_rate: float = 1e-3,
      discount: float = 0.99,
      entropy_cost: float = 0.01,
      baseline_cost: float = 0.5,
      max_abs_reward: Optional[float] = None,
      max_gradient_norm: Optional[float] = None,
      variable_update_period: int = 1000,
      save_logs: bool = False,
  ):
      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._environment_spec = environment_spec
      self._num_actors = num_actors
      self._batch_size = batch_size
      self._prefetch_size = prefetch_size
      self._sequence_length = sequence_length
      self._max_queue_size = max_queue_size
      self._sequence_period = sequence_period
      self._discount = discount
      self._learning_rate = learning_rate
      self._entropy_cost = entropy_cost
      self._baseline_cost = baseline_cost
      self._max_abs_reward = max_abs_reward
      self._max_gradient_norm = max_gradient_norm
      self._variable_update_period = variable_update_period
      self._save_logs = save_logs
  
imports: from typing import Callable, Optional
  import acme
  from acme import datasets
  from acme import specs
  from acme.adders import reverb
  from acme.agents.tf.impala import acting
  from acme.agents.tf.impala import learning
  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
  import dm_env
  import launchpad
  import reverb
  import sonnet
  import tensorflow
label_desc: Use image node_id 1 to create a new DistributedIMPALA object  with example: obj = DistributedIMPALA(environment_factory, network_factory, num_actors, sequence_length, sequence_period, environment_spec, batch_size, prefetch_size, max_queue_size, learning_rate, discount, entropy_cost, baseline_cost, max_abs_reward, max_gradient_norm, variable_update_period, save_logs)