class_docstr: ARS learner.
code: def __init__(
      self,
      spec: specs.EnvironmentSpec,
      networks: networks_lib.FeedForwardNetwork,
      rng: networks_lib.PRNGKey,
      config: ars_config.ARSConfig,
      iterator: Iterator[reverb.ReplaySample],
      counter: Optional[counting.Counter] = None,
      logger: Optional[loggers.Logger] = None,
  ):
      self._config = config
      self._lock = threading.Lock()
  
      # General learner book-keeping and loggers.
      self._counter = counter or counting.Counter()
      self._logger = logger or loggers.make_default_logger(
          "learner",
          asynchronous=True,
          serialize_fn=utils.fetch_devicearray,
          steps_key=self._counter.get_steps_key(),
      )
  
      # Iterator on demonstration transitions.
      self._iterator = iterator
  
      if self._config.normalize_observations:
          normalizer_params = running_statistics.init_state(
              spec.observations
          )
          self._normalizer_update_fn = running_statistics.update
      else:
          normalizer_params = ()
          self._normalizer_update_fn = lambda a, b: a
  
      rng1, rng2, tmp = jax.random.split(rng, 3)
      # Create initial state.
      self._training_state = TrainingState(
          key=rng1,
          policy_params=networks.init(tmp),
          normalizer_params=normalizer_params,
          training_iteration=0,
      )
      self._evaluation_state = EvaluationState(
          key=rng2,
          evaluation_queue=collections.deque(),
          received_results={},
          noises=[],
      )
  
      # Do not record timestamps until after the first learning step is done.
      # This is to avoid including the time it takes for actors to come online and
      # fill the replay buffer.
      self._timestamp = None
  
imports: import collections
  import threading
  import time
  from typing import Any, Deque, Dict, Iterator, List, NamedTuple, Optional
  import acme
  from acme import specs
  from acme.adders import reverb
  from acme.agents.jax.ars import config
  from acme.agents.jax.ars import networks
  from acme.jax import networks
  from acme.jax import running_statistics
  from acme.jax import utils
  from acme.utils import counting
  from acme.utils import loggers
  import jax
  import numpy
  import reverb
label_desc: Use image node_id 1 to create a new ARSLearner object from inherited base classes: acme with example: obj = ARSLearner(spec, networks, rng, config, iterator, counter, logger)