class_docstr: Program definition for SVG0.
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,
      sequence_length: int = 10,
      sigma: float = 0.3,
      discount: float = 0.99,
      policy_optimizer: Optional[snt.Optimizer] = None,
      critic_optimizer: Optional[snt.Optimizer] = None,
      prior_optimizer: Optional[snt.Optimizer] = None,
      distillation_cost: Optional[float] = 1e-3,
      entropy_regularizer_cost: Optional[float] = 1e-3,
      target_update_period: int = 100,
      max_actor_steps: Optional[int] = None,
      log_every: float = 10.0,
  ):
      if not environment_spec:
          environment_spec = specs.make_environment_spec(
              environment_factory(False)
          )
  
      # TODO(mwhoffman): Make network_factory directly return the struct.
      # TODO(mwhoffman): Make the factory take the entire spec.
      def wrapped_network_factory(action_spec):
          networks_dict = network_factory(action_spec)
          networks = agent.SVG0Networks(
              policy_network=networks_dict.get("policy"),
              critic_network=networks_dict.get("critic"),
              prior_network=networks_dict.get("prior", None),
          )
          return networks
  
      self._environment_factory = environment_factory
      self._network_factory = wrapped_network_factory
      self._environment_spec = environment_spec
      self._sigma = sigma
      self._num_actors = num_actors
      self._num_caches = num_caches
      self._max_actor_steps = max_actor_steps
      self._log_every = log_every
      self._sequence_length = sequence_length
  
      self._builder = agent.SVG0Builder(
          # TODO(mwhoffman): pass the config dataclass in directly.
          # TODO(mwhoffman): use the limiter rather than the workaround below.
          agent.SVG0Config(
              discount=discount,
              batch_size=batch_size,
              prefetch_size=prefetch_size,
              target_update_period=target_update_period,
              policy_optimizer=policy_optimizer,
              critic_optimizer=critic_optimizer,
              prior_optimizer=prior_optimizer,
              min_replay_size=min_replay_size,
              max_replay_size=max_replay_size,
              samples_per_insert=samples_per_insert,
              sequence_length=sequence_length,
              sigma=sigma,
              distillation_cost=distillation_cost,
              entropy_regularizer_cost=entropy_regularizer_cost,
          )
      )
  
imports: import copy
  from typing import Callable, Dict, Optional
  import acme
  from acme import specs
  from acme.agents.tf.svg0_prior import agent
  from acme.tf import savers
  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
label_desc: Use image node_id 1 to create a new DistributedSVG0 object  with example: obj = DistributedSVG0(environment_factory, network_factory, num_actors, num_caches, environment_spec, batch_size, prefetch_size, min_replay_size, max_replay_size, samples_per_insert, sequence_length, sigma, discount, policy_optimizer, critic_optimizer, prior_optimizer, distillation_cost, entropy_regularizer_cost, target_update_period, max_actor_steps, log_every)