From f701882b6604326c1298d3be3799cf5a616d8c3c Mon Sep 17 00:00:00 2001 From: TianYuan Date: Thu, 9 Dec 2021 12:46:15 +0000 Subject: [PATCH] update add_style_melgan --- paddlespeech/t2s/models/melgan/melgan.py | 9 +++------ .../models/parallel_wavegan/parallel_wavegan_updater.py | 4 ++-- paddlespeech/t2s/modules/residual_stack.py | 3 +-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/paddlespeech/t2s/models/melgan/melgan.py b/paddlespeech/t2s/models/melgan/melgan.py index 8dfc05a0..32fcf658 100644 --- a/paddlespeech/t2s/models/melgan/melgan.py +++ b/paddlespeech/t2s/models/melgan/melgan.py @@ -93,8 +93,7 @@ class MelGANGenerator(nn.Layer): initialize(self, init_type) # for compatibility - if nonlinear_activation == "LeakyReLU": - nonlinear_activation = "leakyrelu" + nonlinear_activation = nonlinear_activation.lower() # check hyper parameters is valid assert channels >= np.prod(upsample_scales) @@ -328,8 +327,7 @@ class MelGANDiscriminator(nn.Layer): super().__init__() # for compatibility - if nonlinear_activation == "LeakyReLU": - nonlinear_activation = "leakyrelu" + nonlinear_activation = nonlinear_activation.lower() # initialize parameters initialize(self, init_type) @@ -479,8 +477,7 @@ class MelGANMultiScaleDiscriminator(nn.Layer): initialize(self, init_type) # for compatibility - if nonlinear_activation == "LeakyReLU": - nonlinear_activation = "leakyrelu" + nonlinear_activation = nonlinear_activation.lower() self.discriminators = nn.LayerList() diff --git a/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan_updater.py b/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan_updater.py index 8ed50bc8..79707aa4 100644 --- a/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan_updater.py +++ b/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan_updater.py @@ -10,8 +10,7 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations -# under the License. +# limitations under the License. import logging from pathlib import Path from typing import Dict @@ -28,6 +27,7 @@ from paddlespeech.t2s.training.extensions.evaluator import StandardEvaluator from paddlespeech.t2s.training.reporter import report from paddlespeech.t2s.training.updaters.standard_updater import StandardUpdater from paddlespeech.t2s.training.updaters.standard_updater import UpdaterState + logging.basicConfig( format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s', datefmt='[%Y-%m-%d %H:%M:%S]') diff --git a/paddlespeech/t2s/modules/residual_stack.py b/paddlespeech/t2s/modules/residual_stack.py index ee3ba64d..b4f95229 100644 --- a/paddlespeech/t2s/modules/residual_stack.py +++ b/paddlespeech/t2s/modules/residual_stack.py @@ -60,8 +60,7 @@ class ResidualStack(nn.Layer): """ super().__init__() # for compatibility - if nonlinear_activation == "LeakyReLU": - nonlinear_activation = "leakyrelu" + nonlinear_activation = nonlinear_activation.lower() # defile residual stack part if not use_causal_conv: