class_docstr: Distributed DQN agent.
class_docstr_tok: ["Distributed","DQN","agent","."]
docstr: The evaluation process.
docstr_tok: ["The","evaluation","process","."]
code: def evaluator(
      self,
      variable_source: acme.VariableSource,
      counter: counting.Counter,
  ):
      """The evaluation process."""
      environment = self._environment_factory(True)
      network = self._network_factory(self._env_spec.actions)
  
      # Just inline the policy network here.
      policy_network = snt.Sequential(
          [
              network,
              lambda q: trfl.epsilon_greedy(
                  q, self._evaluator_epsilon
              ).sample(),
          ]
      )
  
      tf2_utils.create_variables(
          policy_network, [self._env_spec.observations]
      )
  
      variable_client = tf2_variable_utils.VariableClient(
          client=variable_source,
          variables={"policy": policy_network.trainable_variables},
          update_period=self._variable_update_period,
      )
  
      # Make sure not to use a random policy after checkpoint restoration by
      # assigning variables before running the environment loop.
      variable_client.update_and_wait()
  
      # Create the agent.
      actor = actors.FeedForwardActor(
          policy_network, variable_client=variable_client
      )
  
      # Create the run loop and return it.
      logger = loggers.make_default_logger(
          "evaluator", steps_key="evaluator_steps"
      )
      counter = counting.Counter(counter, "evaluator")
      return acme.EnvironmentLoop(
          environment, actor, counter=counter, logger=logger
      )
  
imports: import copy
  from typing import Callable, 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.dqn 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
  from acme.utils import lp_utils
  import dm_env
  import launchpad
  import numpy
  import reverb
  import sonnet
  import trfl
label_desc: Use image node_id 7 for calling the DistributedDQN obj's underlying member method code with example usage: obj.evaluator(variable_source, counter) and returns: acme