class_docstr: Builder that enables Learning From demonstrations.
  
  This builder is not self contained and requires an underlying builder
  implementing an off-policy algorithm.
class_docstr_tok: ["Builder","that","enables","Learning","From","demonstrations",".","This","builder","is","not","self","contained","and","requires","an","underlying","builder","implementing","an","off-policy","algorithm","."]
docstr: LfdBuilder constructor.
  
  Args:
    builder: The underlying builder implementing the off-policy algorithm.
    demonstrations_factory: Factory returning an infinite stream (as an
      iterator) of (action, next_timesteps). Episode boundaries in this stream
      are given by timestep.first() and timestep.last(). Note that in the
      distributed version of this algorithm, each actor is mixing the same
      demonstrations with its online experience. This effectively results in
      the demonstrations being replicated in the replay buffer as many times
      as the number of actors being used.
    config: LfD configuration.
docstr_tok: ["LfdBuilder","constructor",".","Args",":","builder",":","The","underlying","builder","implementing","the","off-policy","algorithm",".","demonstrations_factory",":","Factory","returning","an","infinite","stream","(","as","an","iterator",")","of","(","action",",","next_timesteps",")",".","Episode","boundaries","in","this","stream","are","given","by","timestep.first","(",")","and","timestep.last","(",")",".","Note","that","in","the","distributed","version","of","this","algorithm",",","each","actor","is","mixing","the","same","demonstrations","with","its","online","experience",".","This","effectively","results","in","the","demonstrations","being","replicated","in","the","replay","buffer","as","many","times","as","the","number","of","actors","being","used",".","config",":","LfD","configuration","."]
code: def __init__(
      self,
      builder: builders.ActorLearnerBuilder[
          builders.Networks, builders.Policy, builders.Sample
      ],
      demonstrations_factory: Callable[[], Iterator[LfdStep]],
      config: lfd_config.LfdConfig,
  ):
      """LfdBuilder constructor.
  
      Args:
        builder: The underlying builder implementing the off-policy algorithm.
        demonstrations_factory: Factory returning an infinite stream (as an
          iterator) of (action, next_timesteps). Episode boundaries in this stream
          are given by timestep.first() and timestep.last(). Note that in the
          distributed version of this algorithm, each actor is mixing the same
          demonstrations with its online experience. This effectively results in
          the demonstrations being replicated in the replay buffer as many times
          as the number of actors being used.
        config: LfD configuration.
      """
      self._builder = builder
      self._demonstrations_factory = demonstrations_factory
      self._config = config
  
file_path: acme/acme/agents/jax/lfd/builder.py
imports: from typing import Any, Callable, Generic, Iterator, Tuple
  from acme.agents.jax import builders
  from acme.agents.jax.lfd import config
  from acme.agents.jax.lfd import lfd_adder
  import dm_env
label_desc: Use image node_id 1 to create a new LfdBuilder object from inherited base classes: builders.ActorLearnerBuilder, Generic with example: obj = LfdBuilder(builder, demonstrations_factory, config)