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): """Sample from model outputs.""" temperature = self.temperature if temperature is None else temperature # TODO: why do they multiply by 0.5 here? return lib_util.sample_bernoulli(0.5 * predictions, temperature=temperature)