(self, predictions, temperature=None)
Sample from model outputs.
Sample from model outputs.
Sample from model outputs .
def sample_predictions(self, predictions, temperature=None):
    """Sample from model outputs."""
    temperature = self.temperature if temperature is None else temperature
    if self.separate_instruments:
      return lib_util.sample(
          predictions, axis=2, onehot=True, temperature=temperature)
    else:
      return lib_util.sample_bernoulli(
          0.5 * predictions, temperature=temperature)
def sample_predictions ( self , predictions , temperature = None ) : temperature = self . temperature if temperature is None else temperature if self . separate_instruments : return lib_util . sample ( predictions , axis = 2 , onehot = True , temperature = temperature ) else : return lib_util . sample_bernoulli ( 0.5 * predictions , temperature = temperature )