MCPcopy
hub / github.com/google-deepmind/acme / sample

Method sample

acme/datasets/tfds.py:85–91  ·  view source on GitHub ↗
(key: jnp.ndarray)

Source from the content-addressed store, hash-verified

83 self._key = key
84
85 def sample(key: jnp.ndarray) -> Tuple[Any, jnp.ndarray]:
86 key, key_randint = jax.random.split(key)
87 indices = jax.random.randint(key_randint, (batch_size,), minval=0,
88 maxval=self._dataset_size)
89 demo_transitions = jax.tree_map(lambda d: jnp.take(d, indices, axis=0),
90 self._jax_dataset)
91 return demo_transitions, key
92 self._sample = jax.jit(sample)
93
94 def __next__(self) -> Any:

Callers 15

itemsMethod · 0.80
__call__Method · 0.80
add_noiseMethod · 0.80
__call__Method · 0.80
__call__Method · 0.80
_callMethod · 0.80
entropyMethod · 0.80
_policyMethod · 0.80
_policyMethod · 0.80
__init__Method · 0.80
updateMethod · 0.80
_stepMethod · 0.80

Calls

no outgoing calls

Tested by 2

itemsMethod · 0.64