(self,
               pianoroll_shape,
               separate_instruments=True,
               blankout_ratio=0.5,
               **unused_kwargs)
return mask
Sample a mask.

    Args:
      pianoroll_shape: shape of pianoroll (time, pitch, instrument)
      separate_instruments: whether instruments are separated
      blankout_ratio: bernoulli inclusion probability

    Returns:
      A mask of shape `shape`.

    Raises:
      ValueError: if shape is not three dimensional.
Sample a mask.
Sample a mask .
def __call__(self,
               pianoroll_shape,
               separate_instruments=True,
               blankout_ratio=0.5,
               **unused_kwargs):
    """Sample a mask.

    Args:
      pianoroll_shape: shape of pianoroll (time, pitch, instrument)
      separate_instruments: whether instruments are separated
      blankout_ratio: bernoulli inclusion probability

    Returns:
      A mask of shape `shape`.

    Raises:
      ValueError: if shape is not three dimensional.
    """
    if len(pianoroll_shape) != 3:
      raise ValueError(
          "Shape needs to of 3 dimensional, time, pitch, and instrument.")
    tt, pp, ii = pianoroll_shape
    if separate_instruments:
      mask = np.random.random([tt, 1, ii]) < blankout_ratio
      mask = mask.astype(np.float32)
      mask = np.tile(mask, [1, pianoroll_shape[1], 1])
    else:
      mask = np.random.random([tt, pp, ii]) < blankout_ratio
      mask = mask.astype(np.float32)
    return mask
def __call__ ( self , pianoroll_shape , separate_instruments = True , blankout_ratio = 0.5 , * * unused_kwargs ) : if len ( pianoroll_shape ) != 3 : raise ValueError ( "Shape needs to of 3 dimensional, time, pitch, and instrument." ) tt , pp , ii = pianoroll_shape if separate_instruments : mask = np . random . random ( [ tt , 1 , ii ] ) < blankout_ratio mask = mask . astype ( np . float32 ) mask = np . tile ( mask , [ 1 , pianoroll_shape [ 1 ] , 1 ] ) else : mask = np . random . random ( [ tt , pp , ii ] ) < blankout_ratio mask = mask . astype ( np . float32 ) return mask