Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
add __init__ for models
Browse files Browse the repository at this point in the history
  • Loading branch information
yt605155624 committed Oct 12, 2021
1 parent 73cb215 commit 4b94af9
Show file tree
Hide file tree
Showing 21 changed files with 115 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import soundfile as sf
import yaml
from parakeet.data.get_feats import LogMelFBank
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore
from yacs.config import CfgNode as Configuration

Expand Down
2 changes: 1 addition & 1 deletion examples/GANVocoder/parallelwave_gan/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import yaml
from paddle import distributed as dist
from parakeet.datasets.data_table import DataTable
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGGenerator
from yacs.config import CfgNode


Expand Down
8 changes: 4 additions & 4 deletions examples/GANVocoder/parallelwave_gan/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
from paddle.optimizer.lr import StepDecay
from parakeet.datasets.data_table import DataTable
from parakeet.datasets.vocoder_batch_fn import Clip
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGDiscriminator
from parakeet.models.parallel_wavegan.parallel_wavegan_updater import PWGUpdater
from parakeet.models.parallel_wavegan.parallel_wavegan_updater import PWGEvaluator
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGDiscriminator
from parakeet.models.parallel_wavegan import PWGUpdater
from parakeet.models.parallel_wavegan import PWGEvaluator
from parakeet.modules.stft_loss import MultiResolutionSTFTLoss
from parakeet.training.extensions.snapshot import Snapshot
from parakeet.training.extensions.visualizer import VisualDL
Expand Down
8 changes: 4 additions & 4 deletions examples/fastspeech2/aishell3/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import soundfile as sf
import yaml
from parakeet.frontend.zh_frontend import Frontend
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore
from yacs.config import CfgNode

Expand Down
8 changes: 4 additions & 4 deletions examples/fastspeech2/baker/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import soundfile as sf
import yaml
from parakeet.frontend.zh_frontend import Frontend
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore
from yacs.config import CfgNode

Expand Down
8 changes: 4 additions & 4 deletions examples/fastspeech2/ljspeech/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import yaml
from yacs.config import CfgNode
from parakeet.frontend import English
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore


Expand Down
8 changes: 4 additions & 4 deletions examples/fastspeech2/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import yaml
from yacs.config import CfgNode
from parakeet.datasets.data_table import DataTable
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2 import FastSpeech2Inference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore


Expand Down
9 changes: 5 additions & 4 deletions examples/fastspeech2/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@
import yaml
from paddle import DataParallel
from paddle import distributed as dist
from paddle.io import DataLoader, DistributedBatchSampler
from paddle.io import DataLoader
from paddle.io import DistributedBatchSampler
from parakeet.datasets.data_table import DataTable
from parakeet.datasets.am_batch_fn import fastspeech2_single_spk_batch_fn
from parakeet.datasets.am_batch_fn import fastspeech2_multi_spk_batch_fn
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2.fastspeech2_updater import FastSpeech2Evaluator
from parakeet.models.fastspeech2.fastspeech2_updater import FastSpeech2Updater
from parakeet.models.fastspeech2 import FastSpeech2
from parakeet.models.fastspeech2 import FastSpeech2Evaluator
from parakeet.models.fastspeech2 import FastSpeech2Updater
from parakeet.training.extensions.snapshot import Snapshot
from parakeet.training.extensions.visualizer import VisualDL
from parakeet.training.optimizer import build_optimizers
Expand Down
8 changes: 4 additions & 4 deletions examples/speedyspeech/baker/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
from paddle import jit
from paddle.static import InputSpec
from parakeet.frontend.zh_frontend import Frontend
from parakeet.models.speedyspeech.speedyspeech import SpeedySpeech
from parakeet.models.speedyspeech.speedyspeech import SpeedySpeechInference
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.speedyspeech import SpeedySpeech
from parakeet.models.speedyspeech import SpeedySpeechInference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore
from yacs.config import CfgNode

Expand Down
8 changes: 4 additions & 4 deletions examples/speedyspeech/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
from yacs.config import CfgNode

from parakeet.datasets.data_table import DataTable
from parakeet.models.speedyspeech.speedyspeech import SpeedySpeech
from parakeet.models.speedyspeech.speedyspeech import SpeedySpeechInference
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan.parallel_wavegan import PWGInference
from parakeet.models.speedyspeech import SpeedySpeech
from parakeet.models.speedyspeech import SpeedySpeechInference
from parakeet.models.parallel_wavegan import PWGGenerator
from parakeet.models.parallel_wavegan import PWGInference
from parakeet.modules.normalizer import ZScore


Expand Down
6 changes: 3 additions & 3 deletions examples/speedyspeech/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
from paddle.io import DistributedBatchSampler
from parakeet.datasets.data_table import DataTable
from parakeet.datasets.am_batch_fn import speedyspeech_batch_fn
from parakeet.models.speedyspeech.speedyspeech import SpeedySpeech
from parakeet.models.speedyspeech.speedyspeech_updater import SpeedySpeechEvaluator
from parakeet.models.speedyspeech.speedyspeech_updater import SpeedySpeechUpdater
from parakeet.models.speedyspeech import SpeedySpeech
from parakeet.models.speedyspeech import SpeedySpeechEvaluator
from parakeet.models.speedyspeech import SpeedySpeechUpdater
from parakeet.training.extensions.snapshot import Snapshot
from parakeet.training.extensions.visualizer import VisualDL
from parakeet.training.optimizer import build_optimizers
Expand Down
4 changes: 2 additions & 2 deletions examples/transformer_tts/ljspeech/synthesize_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import yaml
from yacs.config import CfgNode
from parakeet.frontend import English
from parakeet.models.transformer_tts.transformer_tts import TransformerTTS
from parakeet.models.transformer_tts.transformer_tts import TransformerTTSInference
from parakeet.models.transformer_tts import TransformerTTS
from parakeet.models.transformer_tts import TransformerTTSInference
from parakeet.models.waveflow import ConditionalWaveFlow
from parakeet.modules.normalizer import ZScore
from parakeet.utils import layer_tools
Expand Down
4 changes: 2 additions & 2 deletions examples/transformer_tts/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import yaml
from yacs.config import CfgNode
from parakeet.datasets.data_table import DataTable
from parakeet.models.transformer_tts.transformer_tts import TransformerTTS
from parakeet.models.transformer_tts.transformer_tts import TransformerTTSInference
from parakeet.models.transformer_tts import TransformerTTS
from parakeet.models.transformer_tts import TransformerTTSInference
from parakeet.models.waveflow import ConditionalWaveFlow
from parakeet.modules.normalizer import ZScore
from parakeet.utils import layer_tools
Expand Down
6 changes: 3 additions & 3 deletions examples/transformer_tts/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
from paddle.io import DistributedBatchSampler
from parakeet.datasets.data_table import DataTable
from parakeet.datasets.am_batch_fn import transformer_single_spk_batch_fn
from parakeet.models.transformer_tts.transformer_tts import TransformerTTS
from parakeet.models.transformer_tts.transformer_tts_updater import TransformerTTSUpdater
from parakeet.models.transformer_tts.transformer_tts_updater import TransformerTTSEvaluator
from parakeet.models.transformer_tts import TransformerTTS
from parakeet.models.transformer_tts import TransformerTTSUpdater
from parakeet.models.transformer_tts import TransformerTTSEvaluator
from parakeet.training.extensions.snapshot import Snapshot
from parakeet.training.extensions.visualizer import VisualDL
from parakeet.training.optimizer import build_optimizers
Expand Down
16 changes: 16 additions & 0 deletions parakeet/models/fastspeech2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.

from .fastspeech2 import *
from .fastspeech2_updater import *
2 changes: 1 addition & 1 deletion parakeet/models/fastspeech2/fastspeech2_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import logging

from paddle import distributed as dist
from parakeet.models.fastspeech2.fastspeech2 import FastSpeech2Loss
from parakeet.models.fastspeech2 import FastSpeech2Loss
from parakeet.training.extensions.evaluator import StandardEvaluator
from parakeet.training.reporter import report
from parakeet.training.updaters.standard_updater import StandardUpdater
Expand Down
16 changes: 16 additions & 0 deletions parakeet/models/parallel_wavegan/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.

from .parallel_wavegan import *
from .parallel_wavegan_updater import *
16 changes: 16 additions & 0 deletions parakeet/models/speedyspeech/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.

from .speedyspeech import *
from .speedyspeech_updater import *
3 changes: 2 additions & 1 deletion parakeet/models/speedyspeech/speedyspeech_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from paddle import distributed as dist
from paddle.fluid.layers import huber_loss
from paddle.nn import functional as F
from parakeet.modules.losses import masked_l1_loss, weighted_mean
from parakeet.modules.losses import masked_l1_loss
from parakeet.modules.losses import weighted_mean
from parakeet.modules.ssim import ssim
from parakeet.training.extensions.evaluator import StandardEvaluator
from parakeet.training.reporter import report
Expand Down
16 changes: 16 additions & 0 deletions parakeet/models/transformer_tts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# 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.

from .transformer_tts import *
from .transformer_tts_updater import *
4 changes: 2 additions & 2 deletions parakeet/models/transformer_tts/transformer_tts_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import paddle
from paddle import distributed as dist
from parakeet.models.transformer_tts.transformer_tts import GuidedMultiHeadAttentionLoss
from parakeet.models.transformer_tts.transformer_tts import TransformerTTSLoss
from parakeet.models.transformer_tts import GuidedMultiHeadAttentionLoss
from parakeet.models.transformer_tts import TransformerTTSLoss
from parakeet.training.extensions.evaluator import StandardEvaluator
from parakeet.training.reporter import report
from parakeet.training.updaters.standard_updater import StandardUpdater
Expand Down

0 comments on commit 4b94af9

Please sign in to comment.