(noise_density=0.15,
                               mean_noise_span_length=3.0,
                               seed1=None,
                               seed2=None)
return _f
Returns a function that generates a random noise mask.
Returns a function that generates a random noise mask.
Returns a function that generates a random noise mask .
def generate_random_noise_mask(noise_density=0.15,
                               mean_noise_span_length=3.0,
                               seed1=None,
                               seed2=None):
  """Returns a function that generates a random noise mask."""
  def _f(generator):
    for example in generator:
      length = len(example)
      noise_mask = random_spans_noise_mask(
          length, noise_density=noise_density,
          mean_noise_span_length=mean_noise_span_length,
          seed1=seed1, seed2=seed2, example=example)
      yield (example, noise_mask)
  return _f
def generate_random_noise_mask ( noise_density = 0.15 , mean_noise_span_length = 3.0 , seed1 = None , seed2 = None ) : def _f ( generator ) : for example in generator : length = len ( example ) noise_mask = random_spans_noise_mask ( length , noise_density = noise_density , mean_noise_span_length = mean_noise_span_length , seed1 = seed1 , seed2 = seed2 , example = example ) yield ( example , noise_mask ) return _f