def __init__(self, steps_per_quarter): """Initialize a TextChordsEncoder object. Encodes chord symbols using a vocabulary of triads. Indices 0 and 1 are reserved and unused, and the remaining 48 + 1 indices represent each of 4 triad types over each of 12 roots, plus "no chord". Args: steps_per_quarter: Number of steps per quarter at which to quantize. """ self._steps_per_quarter = steps_per_quarter self._encoding = note_seq.TriadChordOneHotEncoding()
hparams=merge_hparams( lstm_models.get_default_hparams(), HParams( batch_size=512, max_seq_len=32, # 2 bars w/ 16 steps per bar z_size=256, enc_rnn_size=[1024], dec_rnn_size=[512, 512, 512], )), note_sequence_augmenter=data.NoteSequenceAugmenter(transpose_range=(-3, 3)), data_converter=data.OneHotMelodyConverter( max_bars=100, slice_bars=2, steps_per_quarter=4, chord_encoding=note_seq.TriadChordOneHotEncoding()), train_examples_path=None, eval_examples_path=None, ) # Drums CONFIG_MAP['cat-drums_2bar_small'] = Config( model=MusicVAE(lstm_models.BidirectionalLstmEncoder(), lstm_models.CategoricalLstmDecoder()), hparams=merge_hparams( lstm_models.get_default_hparams(), HParams( batch_size=512, max_seq_len=32, # 2 bars w/ 16 steps per bar z_size=256, enc_rnn_size=[512],
self.min_note = min_note self.max_note = max_note self.transpose_to_key = transpose_to_key # Default configurations. default_configs = { 'basic_improv': ImprovRnnConfig( generator_pb2.GeneratorDetails( id='basic_improv', description='Basic melody-given-chords RNN with one-hot triad ' 'encoding for chords.'), note_seq.ConditionalEventSequenceEncoderDecoder( note_seq.OneHotEventSequenceEncoderDecoder( note_seq.TriadChordOneHotEncoding()), note_seq.OneHotEventSequenceEncoderDecoder( note_seq.MelodyOneHotEncoding(min_note=DEFAULT_MIN_NOTE, max_note=DEFAULT_MAX_NOTE))), contrib_training.HParams(batch_size=128, rnn_layer_sizes=[64, 64], dropout_keep_prob=0.5, clip_norm=5, learning_rate=0.001)), 'attention_improv': ImprovRnnConfig( generator_pb2.GeneratorDetails( id='attention_improv', description= 'Melody-given-chords RNN with one-hot triad encoding for ' 'chords, attention, and binary counters.'),