Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.networks.utils.maybe_permanent_dropout

View source on GitHub

Adds a Keras dropout layer with the option of applying it at inference.

tf_agents.networks.utils.maybe_permanent_dropout(
    rate, noise_shape=None, seed=None, permanent=False
)

Args:

  • rate: the probability of dropping an input.
  • noise_shape: 1D integer tensor representing the dropout mask multiplied to the input.
  • seed: A Python integer to use as random seed.
  • permanent: If set, applies dropout during inference and not only during training. This flag is used for approximated Bayesian inference.

Returns:

A function adding a dropout layer according to the parameters for the given input.