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

Method add_noise

acme/tf/networks/noise.py:35–39  ·  view source on GitHub ↗
(tensor: tf.Tensor)

Source from the content-addressed store, hash-verified

33
34 def __call__(self, inputs: types.NestedTensor) -> types.NestedTensor:
35 def add_noise(tensor: tf.Tensor):
36 output = tensor + tf.cast(self._noise.sample(tensor.shape),
37 dtype=tensor.dtype)
38 output = tf.clip_by_value(output, -1.0, 1.0)
39 return output
40
41 return tree.map_structure(add_noise, inputs)

Callers

nothing calls this directly

Calls 1

sampleMethod · 0.80

Tested by

no test coverage detected