(self, batch_size)
return one_hot_labels
Provides one hot labels.
Provides one hot labels.
Provides one hot labels .
def provide_one_hot_labels(self, batch_size):
    """Provides one hot labels."""
    pitch_counts = self.get_pitch_counts()
    pitches = sorted(pitch_counts.keys())
    counts = [pitch_counts[p] for p in pitches]
    indices = tf.reshape(
        tf.multinomial(tf.log([tf.to_float(counts)]), batch_size), [batch_size])
    one_hot_labels = tf.one_hot(indices, depth=len(pitches))
    return one_hot_labels
def provide_one_hot_labels ( self , batch_size ) : pitch_counts = self . get_pitch_counts ( ) pitches = sorted ( pitch_counts . keys ( ) ) counts = [ pitch_counts [ p ] for p in pitches ] indices = tf . reshape ( tf . multinomial ( tf . log ( [ tf . to_float ( counts ) ] ) , batch_size ) , [ batch_size ] ) one_hot_labels = tf . one_hot ( indices , depth = len ( pitches ) ) return one_hot_labels