diff --git a/rvc/lib/algorithm/generators/refinegan.py b/rvc/lib/algorithm/generators/refinegan.py index b5f29f0c..309387b8 100644 --- a/rvc/lib/algorithm/generators/refinegan.py +++ b/rvc/lib/algorithm/generators/refinegan.py @@ -7,6 +7,7 @@ from rvc.lib.algorithm.commons import get_padding + def kaiser_sinc_filter1d(cutoff, half_width, kernel_size): even = kernel_size % 2 == 0 half_size = kernel_size // 2 @@ -57,6 +58,7 @@ def forward(self, x): x = x[..., self.pad_left : -self.pad_right] # noqa return x + class ResBlock(torch.nn.Module): """ Residual block with multiple dilated convolutions. @@ -164,7 +166,7 @@ def __init__( *, channels: int, leaky_relu_slope: float = 0.2, - use_noise_gen = True, + use_noise_gen=True, ): super().__init__() @@ -179,7 +181,8 @@ def forward(self, x: torch.Tensor): return self.activation(x + gaussian) else: return self.activation(x) - + + class ParallelResBlock(torch.nn.Module): """ Parallel residual block that applies multiple residual blocks with different kernel sizes in parallel. @@ -226,7 +229,7 @@ def __init__( leaky_relu_slope=leaky_relu_slope, ), # disabled a second noise inductor as one is enough - AdaIN(channels=out_channels, use_noise_gen = False), + AdaIN(channels=out_channels, use_noise_gen=False), ) for kernel_size in kernel_sizes ] @@ -463,7 +466,9 @@ def __init__( new_channels = channels // 2 self.upsample_blocks.append( - UpSample1d(rate) # upsampler borrowed from BigVGAN, filters out mirrored harmonics + UpSample1d( + rate + ) # upsampler borrowed from BigVGAN, filters out mirrored harmonics ) self.upsample_conv_blocks.append( diff --git a/rvc/train/train.py b/rvc/train/train.py index 4a93c79c..235def30 100644 --- a/rvc/train/train.py +++ b/rvc/train/train.py @@ -71,8 +71,8 @@ cleanup = strtobool(sys.argv[15]) vocoder = sys.argv[16] checkpointing = strtobool(sys.argv[17]) -randomized=True -optimizer="RAdam" # "AdamW" +randomized = True +optimizer = "RAdam" # "AdamW" current_dir = os.getcwd() experiment_dir = os.path.join(current_dir, "logs", model_name) @@ -400,7 +400,7 @@ def run( optimizer = torch.optim.AdamW elif optimizer == "RAdam": optimizer = torch.optim.RAdam - + optim_g = optimizer( net_g.parameters(), config.train.learning_rate,