From 091396443bf656b348d9f9c17696d5aedc252eb9 Mon Sep 17 00:00:00 2001 From: vincentherrmann Date: Mon, 26 Mar 2018 00:41:17 +0200 Subject: [PATCH] complex conditioning --- .DS_Store | Bin 10244 -> 10244 bytes audio_data.py | 8 +++++--- wavenet_model.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.DS_Store b/.DS_Store index 22942f911f38fafdcc155c82cf898938ea5d42c2..fad07c5b499dca78eea9e32ce6f8f01e98005656 100644 GIT binary patch delta 42 ycmZn(XbG6$dGU^hRb?q(i=H0H^tgj6T%it=wR5>DjV%&zc@W%F4PW@Z2@!3}l* delta 53 zcmV-50LuS_P=rvBPXR2kP`eKSEVB#{W&@Mf6CIO@6ce-76EO^ta5S?AAo>K8lN2nI LJQ)wOa23b`>emtm diff --git a/audio_data.py b/audio_data.py index e79ca35be..77272a8a9 100644 --- a/audio_data.py +++ b/audio_data.py @@ -185,7 +185,7 @@ def __init__(self, *args, **kwargs): self.conditioning_channels = conditioning_channels print("Conditioning captures time scales ranging from " + str(self.min_conditioning_breadth) + " to " \ - + str(self.min_conditioning_breadth * self.conditioning_channels) + " seconds") + + str(self.min_conditioning_breadth * self.conditioning_channels // 2) + " seconds") super().__init__(*args, **kwargs) @@ -199,8 +199,10 @@ def conditioning(self, file_index, position_in_file, item_length): x = np.linspace(phase_start, phase_start + phase_length, num=conditioning_count) conditioning = np.zeros((self.conditioning_channels, conditioning_count)) - for c in range(self.conditioning_channels): - conditioning[c, :] = np.cos(x * ((c + 1) / self.conditioning_channels)) + frequency_count = self.conditioning_channels // 2 + for c in range(frequency_count): + conditioning[2 * c, :] = np.cos(x * ((c + 1) / frequency_count)) + conditioning[2 * c + 1, :] = np.sin(x * ((c + 1) / frequency_count)) file_encoding = np.zeros((len(self.files), conditioning_count)) file_encoding[file_index, :] = 1. diff --git a/wavenet_model.py b/wavenet_model.py index 0d033326e..eacfae25a 100644 --- a/wavenet_model.py +++ b/wavenet_model.py @@ -383,7 +383,7 @@ def __init__(self, args_dict): self.file_encoding_layers.append(nn.Conv1d(in_channels=self.file_encoding_channels[i], out_channels=self.file_encoding_channels[i + 1], kernel_size=1, - bias=False)) + bias=self.use_bias)) self.conditioning_layers = nn.ModuleList() self.file_conditioning_cross_layers = nn.ModuleList() @@ -396,7 +396,7 @@ def __init__(self, args_dict): self.file_conditioning_cross_layers.append(nn.Conv1d(in_channels=self.file_encoding_channels[-1], out_channels=self.conditioning_channels[i], kernel_size=1, - bias=False)) + bias=self.use_bias)) def activation_unit_init(self): super().activation_unit_init()