Skip to content

Commit

Permalink
Bump version for gansynth fix.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 329728693
  • Loading branch information
adarob authored and Magenta Team committed Sep 2, 2020
1 parent 5e26e58 commit 4b6c50d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions magenta/models/music_vae/data_hierarchical.py
Expand Up @@ -14,7 +14,6 @@

"""MusicVAE data library for hierarchical converters."""
import abc
import random

from magenta.models.music_vae import data
from magenta.pipelines import performance_pipeline
Expand Down Expand Up @@ -306,8 +305,6 @@ class MultiInstrumentPerformanceConverter(
sequences longer than the hop size.
chord_encoding: An instantiated OneHotEncoding object to use for encoding
chords on which to condition, or None if not conditioning on chords.
drop_tracks_and_truncate: Randomly drop extra tracks and truncate the event
sequence.
"""

def __init__(self,
Expand All @@ -324,8 +321,7 @@ def __init__(self,
min_pitch=performance_lib.MIN_MIDI_PITCH,
max_pitch=performance_lib.MAX_MIDI_PITCH,
first_subsequence_only=False,
chord_encoding=None,
drop_tracks_and_truncate=False):
chord_encoding=None):
max_shift_steps = (performance_lib.DEFAULT_MAX_SHIFT_QUARTERS *
steps_per_quarter)

Expand All @@ -348,7 +344,6 @@ def __init__(self,
self._min_pitch = min_pitch
self._max_pitch = max_pitch
self._first_subsequence_only = first_subsequence_only
self._drop_tracks_and_truncate = drop_tracks_and_truncate

self._max_num_chunks = hop_size_bars // chunk_size_bars
self._max_steps_truncate = (
Expand Down Expand Up @@ -395,10 +390,6 @@ def _quantized_subsequence_to_tensors(self, quantized_subsequence):
num_velocity_bins=self._num_velocity_bins,
split_instruments=True)

if (self._drop_tracks_and_truncate and
len(tracks) > self._max_num_instruments):
tracks = random.sample(tracks, self._max_num_instruments)

# Reject sequences with too few instruments.
if not (self._min_num_instruments <= len(tracks) <=
self._max_num_instruments):
Expand Down Expand Up @@ -431,10 +422,6 @@ def new_performance(quantized_sequence, start_step, track=track):

assert len(track_chunks) == self._max_num_chunks

if self._drop_tracks_and_truncate:
for i in range(len(track_chunks)):
track_chunks[i].truncate(self._max_events_per_instrument - 2)

track_chunk_lengths = [len(track_chunk) for track_chunk in track_chunks]
# Each track chunk needs room for program token and end token.
if not all(l <= self._max_events_per_instrument - 2
Expand Down
2 changes: 1 addition & 1 deletion magenta/version.py
Expand Up @@ -18,4 +18,4 @@
pulling in all the dependencies in __init__.py.
"""

__version__ = '2.1.1'
__version__ = '2.1.2'

0 comments on commit 4b6c50d

Please sign in to comment.