class_docstr: A generic actor implemented on top of ActorCore.
  
  An actor based on a policy which takes observations and outputs actions. It
  also adds experiences to replay and updates the actor weights from the policy
  on the learner.
class_docstr_tok: ["A","generic","actor","implemented","on","top","of","ActorCore",".","An","actor","based","on","a","policy","which","takes","observations","and","outputs","actions",".","It","also","adds","experiences","to","replay","and","updates","the","actor","weights","from","the","policy","on","the","learner","."]
docstr: Initializes a feed forward actor.
  
  Args:
    actor: actor core.
    random_key: Random key.
    variable_client: The variable client to get policy parameters from.
    adder: An adder to add experiences to.
    jit: Whether or not to jit the passed ActorCore's pure functions.
    backend: Which backend to use when jitting the policy.
    per_episode_update: if True, updates variable client params once at the
      beginning of each episode
docstr_tok: ["Initializes","a","feed","forward","actor",".","Args",":","actor",":","actor","core",".","random_key",":","Random","key",".","variable_client",":","The","variable","client","to","get","policy","parameters","from",".","adder",":","An","adder","to","add","experiences","to",".","jit",":","Whether","or","not","to","jit","the","passed","ActorCore","'s","pure","functions",".","backend",":","Which","backend","to","use","when","jitting","the","policy",".","per_episode_update",":","if","True",",","updates","variable","client","params","once","at","the","beginning","of","each","episode"]
code: def __init__(
      self,
      actor: actor_core.ActorCore[actor_core.State, actor_core.Extras],
      random_key: network_lib.PRNGKey,
      variable_client: Optional[variable_utils.VariableClient],
      adder: Optional[adders.Adder] = None,
      jit: bool = True,
      backend: Optional[str] = "cpu",
      per_episode_update: bool = False,
  ):
      """Initializes a feed forward actor.
  
      Args:
        actor: actor core.
        random_key: Random key.
        variable_client: The variable client to get policy parameters from.
        adder: An adder to add experiences to.
        jit: Whether or not to jit the passed ActorCore's pure functions.
        backend: Which backend to use when jitting the policy.
        per_episode_update: if True, updates variable client params once at the
          beginning of each episode
      """
      self._random_key = random_key
      self._variable_client = variable_client
      self._adder = adder
      self._state = None
  
      # Unpack ActorCore, jitting if requested.
      if jit:
          self._init = jax.jit(actor.init, backend=backend)
          self._policy = jax.jit(actor.select_action, backend=backend)
      else:
          self._init = actor.init
          self._policy = actor.select_action
      self._get_extras = actor.get_extras
      self._per_episode_update = per_episode_update
  
file_path: acme/acme/agents/jax/actors.py
imports: from typing import Generic, Optional
  from acme import adders
  from acme import core
  from acme import types
  from acme.agents.jax import actor_core
  from acme.jax import networks
  from acme.jax import utils
  from acme.jax import variable_utils
  import dm_env
  import jax
label_desc: Use image node_id 1 to create a new GenericActor object from inherited base classes: core, Generic with example: obj = GenericActor(actor, random_key, variable_client, adder, jit, backend, per_episode_update)