update add_style_melgan

pull/1068/head
TianYuan 3 years ago
parent 7b2ecb6eed
commit f701882b66

@ -93,8 +93,7 @@ class MelGANGenerator(nn.Layer):
initialize(self, init_type) initialize(self, init_type)
# for compatibility # for compatibility
if nonlinear_activation == "LeakyReLU": nonlinear_activation = nonlinear_activation.lower()
nonlinear_activation = "leakyrelu"
# check hyper parameters is valid # check hyper parameters is valid
assert channels >= np.prod(upsample_scales) assert channels >= np.prod(upsample_scales)
@ -328,8 +327,7 @@ class MelGANDiscriminator(nn.Layer):
super().__init__() super().__init__()
# for compatibility # for compatibility
if nonlinear_activation == "LeakyReLU": nonlinear_activation = nonlinear_activation.lower()
nonlinear_activation = "leakyrelu"
# initialize parameters # initialize parameters
initialize(self, init_type) initialize(self, init_type)
@ -479,8 +477,7 @@ class MelGANMultiScaleDiscriminator(nn.Layer):
initialize(self, init_type) initialize(self, init_type)
# for compatibility # for compatibility
if nonlinear_activation == "LeakyReLU": nonlinear_activation = nonlinear_activation.lower()
nonlinear_activation = "leakyrelu"
self.discriminators = nn.LayerList() self.discriminators = nn.LayerList()

@ -10,8 +10,7 @@
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations # limitations under the License.
# under the License.
import logging import logging
from pathlib import Path from pathlib import Path
from typing import Dict 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.reporter import report
from paddlespeech.t2s.training.updaters.standard_updater import StandardUpdater from paddlespeech.t2s.training.updaters.standard_updater import StandardUpdater
from paddlespeech.t2s.training.updaters.standard_updater import UpdaterState from paddlespeech.t2s.training.updaters.standard_updater import UpdaterState
logging.basicConfig( logging.basicConfig(
format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s', format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] %(message)s',
datefmt='[%Y-%m-%d %H:%M:%S]') datefmt='[%Y-%m-%d %H:%M:%S]')

@ -60,8 +60,7 @@ class ResidualStack(nn.Layer):
""" """
super().__init__() super().__init__()
# for compatibility # for compatibility
if nonlinear_activation == "LeakyReLU": nonlinear_activation = nonlinear_activation.lower()
nonlinear_activation = "leakyrelu"
# defile residual stack part # defile residual stack part
if not use_causal_conv: if not use_causal_conv:

Loading…
Cancel
Save