(self, shape, pm=None, outer_masks=1., separate_instruments=True)
return masks * outer_masks
Sample a batch of masks.

    Args:
      shape: sequence of length 4 specifying desired shape of the mask
      pm: Bernoulli success probability
      outer_masks: indicator of area within which to mask out
      separate_instruments: whether instruments are separated

    Returns:
      A batch of masks.
Sample a batch of masks.
Sample a batch of masks .
def __call__(self, shape, pm=None, outer_masks=1., separate_instruments=True):
    """Sample a batch of masks.

    Args:
      shape: sequence of length 4 specifying desired shape of the mask
      pm: Bernoulli success probability
      outer_masks: indicator of area within which to mask out
      separate_instruments: whether instruments are separated

    Returns:
      A batch of masks.
    """
    assert pm is not None
    bb, tt, pp, ii = shape
    if separate_instruments:
      probs = np.tile(np.random.random([bb, tt, 1, ii]), [1, 1, pp, 1])
    else:
      assert ii == 1
      probs = np.random.random([bb, tt, pp, ii]).astype(np.float32)
    masks = probs < pm
    return masks * outer_masks
def __call__ ( self , shape , pm = None , outer_masks = 1. , separate_instruments = True ) : assert pm is not None bb , tt , pp , ii = shape if separate_instruments : probs = np . tile ( np . random . random ( [ bb , tt , 1 , ii ] ) , [ 1 , 1 , pp , 1 ] ) else : assert ii == 1 probs = np . random . random ( [ bb , tt , pp , ii ] ) . astype ( np . float32 ) masks = probs < pm return masks * outer_masks