From a32306fcc20064247366618486e8d3c08e81b6bc Mon Sep 17 00:00:00 2001 From: TianYuan Date: Thu, 4 Nov 2021 04:59:39 +0000 Subject: [PATCH] add reference --- paddlespeech/t2s/data/batch.py | 5 ++--- paddlespeech/t2s/data/get_feats.py | 1 + paddlespeech/t2s/models/fastspeech2/fastspeech2.py | 1 + paddlespeech/t2s/models/melgan/melgan.py | 1 + paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan.py | 1 + paddlespeech/t2s/models/transformer_tts/transformer_tts.py | 1 + paddlespeech/t2s/modules/adversarial_loss.py | 1 + .../t2s/modules/fastspeech2_predictor/duration_predictor.py | 1 + .../t2s/modules/fastspeech2_predictor/length_regulator.py | 1 + .../t2s/modules/fastspeech2_predictor/variance_predictor.py | 1 + .../t2s/modules/fastspeech2_transformer/attention.py | 1 + paddlespeech/t2s/modules/fastspeech2_transformer/decoder.py | 1 + .../t2s/modules/fastspeech2_transformer/decoder_layer.py | 1 + .../t2s/modules/fastspeech2_transformer/embedding.py | 1 + paddlespeech/t2s/modules/fastspeech2_transformer/encoder.py | 1 + .../t2s/modules/fastspeech2_transformer/encoder_layer.py | 1 + .../t2s/modules/fastspeech2_transformer/lightconv.py | 1 + .../fastspeech2_transformer/positionwise_feed_forward.py | 1 + paddlespeech/t2s/modules/fastspeech2_transformer/repeat.py | 1 + paddlespeech/t2s/modules/nets_utils.py | 1 + paddlespeech/t2s/modules/pqmf.py | 1 + paddlespeech/t2s/modules/residual_stack.py | 1 + paddlespeech/t2s/modules/stft_loss.py | 1 + paddlespeech/t2s/modules/style_encoder.py | 1 + paddlespeech/t2s/modules/tacotron2/decoder.py | 1 + paddlespeech/t2s/modules/tacotron2/encoder.py | 1 + 26 files changed, 27 insertions(+), 3 deletions(-) diff --git a/paddlespeech/t2s/data/batch.py b/paddlespeech/t2s/data/batch.py index 5e7ac3996..9d83bbe09 100644 --- a/paddlespeech/t2s/data/batch.py +++ b/paddlespeech/t2s/data/batch.py @@ -52,9 +52,8 @@ def batch_text_id(minibatch, pad_id=0, dtype=np.int64): """ peek_example = minibatch[0] assert len(peek_example.shape) == 1, "text example is an 1D tensor" - - lengths = [example.shape[0] for example in - minibatch] # assume (channel, n_samples) or (n_samples, ) + # assume (channel, n_samples) or (n_samples, ) + lengths = [example.shape[0] for example in minibatch] max_len = np.max(lengths) batch = [] diff --git a/paddlespeech/t2s/data/get_feats.py b/paddlespeech/t2s/data/get_feats.py index d7ab76402..b4bea0bd0 100644 --- a/paddlespeech/t2s/data/get_feats.py +++ b/paddlespeech/t2s/data/get_feats.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) import librosa import numpy as np import pyworld diff --git a/paddlespeech/t2s/models/fastspeech2/fastspeech2.py b/paddlespeech/t2s/models/fastspeech2/fastspeech2.py index 754fef2a3..5942533a9 100644 --- a/paddlespeech/t2s/models/fastspeech2/fastspeech2.py +++ b/paddlespeech/t2s/models/fastspeech2/fastspeech2.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Fastspeech2 related modules for paddle""" from typing import Dict from typing import Sequence diff --git a/paddlespeech/t2s/models/melgan/melgan.py b/paddlespeech/t2s/models/melgan/melgan.py index 94d6e631b..80bb1c1b2 100644 --- a/paddlespeech/t2s/models/melgan/melgan.py +++ b/paddlespeech/t2s/models/melgan/melgan.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """MelGAN Modules.""" from typing import Any from typing import Dict diff --git a/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan.py b/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan.py index fe4ec3551..9b0ba4749 100644 --- a/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan.py +++ b/paddlespeech/t2s/models/parallel_wavegan/parallel_wavegan.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) import math from typing import Any from typing import Dict diff --git a/paddlespeech/t2s/models/transformer_tts/transformer_tts.py b/paddlespeech/t2s/models/transformer_tts/transformer_tts.py index f8feb553a..97233c766 100644 --- a/paddlespeech/t2s/models/transformer_tts/transformer_tts.py +++ b/paddlespeech/t2s/models/transformer_tts/transformer_tts.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Fastspeech2 related modules for paddle""" from typing import Dict from typing import Sequence diff --git a/paddlespeech/t2s/modules/adversarial_loss.py b/paddlespeech/t2s/modules/adversarial_loss.py index 02e8c807d..d2c8f7a94 100644 --- a/paddlespeech/t2s/modules/adversarial_loss.py +++ b/paddlespeech/t2s/modules/adversarial_loss.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Adversarial loss modules.""" import paddle import paddle.nn.functional as F diff --git a/paddlespeech/t2s/modules/fastspeech2_predictor/duration_predictor.py b/paddlespeech/t2s/modules/fastspeech2_predictor/duration_predictor.py index eac7cf99e..b269b6866 100644 --- a/paddlespeech/t2s/modules/fastspeech2_predictor/duration_predictor.py +++ b/paddlespeech/t2s/modules/fastspeech2_predictor/duration_predictor.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Duration predictor related modules.""" import paddle from paddle import nn diff --git a/paddlespeech/t2s/modules/fastspeech2_predictor/length_regulator.py b/paddlespeech/t2s/modules/fastspeech2_predictor/length_regulator.py index a4d508add..bf595b24e 100644 --- a/paddlespeech/t2s/modules/fastspeech2_predictor/length_regulator.py +++ b/paddlespeech/t2s/modules/fastspeech2_predictor/length_regulator.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Length regulator related modules.""" import paddle from paddle import nn diff --git a/paddlespeech/t2s/modules/fastspeech2_predictor/variance_predictor.py b/paddlespeech/t2s/modules/fastspeech2_predictor/variance_predictor.py index 0fd108d32..417fca825 100644 --- a/paddlespeech/t2s/modules/fastspeech2_predictor/variance_predictor.py +++ b/paddlespeech/t2s/modules/fastspeech2_predictor/variance_predictor.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Variance predictor related modules.""" import paddle from paddle import nn diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/attention.py b/paddlespeech/t2s/modules/fastspeech2_transformer/attention.py index a61f1245d..b11329b03 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/attention.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/attention.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Multi-Head Attention layer definition.""" import math diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/decoder.py b/paddlespeech/t2s/modules/fastspeech2_transformer/decoder.py index c41e39955..489fda12b 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/decoder.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/decoder.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) # 暂时删除了 dyminic conv """Decoder definition.""" import logging diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/decoder_layer.py b/paddlespeech/t2s/modules/fastspeech2_transformer/decoder_layer.py index 9b042483b..0310d83ea 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/decoder_layer.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/decoder_layer.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Decoder self-attention layer definition.""" import paddle from paddle import nn diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/embedding.py b/paddlespeech/t2s/modules/fastspeech2_transformer/embedding.py index 1dfd6dfdc..f26c9dcba 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/embedding.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/embedding.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Positional Encoding Module.""" import math diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/encoder.py b/paddlespeech/t2s/modules/fastspeech2_transformer/encoder.py index 904b9d8b1..62d7a96f9 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/encoder.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/encoder.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) import logging from paddle import nn diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/encoder_layer.py b/paddlespeech/t2s/modules/fastspeech2_transformer/encoder_layer.py index d8f89d677..fb2c2e823 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/encoder_layer.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/encoder_layer.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Encoder self-attention layer definition.""" import paddle from paddle import nn diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/lightconv.py b/paddlespeech/t2s/modules/fastspeech2_transformer/lightconv.py index 3aceed318..1aeb6d6e1 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/lightconv.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/lightconv.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Lightweight Convolution Module.""" import numpy import paddle diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/positionwise_feed_forward.py b/paddlespeech/t2s/modules/fastspeech2_transformer/positionwise_feed_forward.py index 39c06ebaa..297a3b4fb 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/positionwise_feed_forward.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/positionwise_feed_forward.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Positionwise feed forward layer definition.""" import paddle diff --git a/paddlespeech/t2s/modules/fastspeech2_transformer/repeat.py b/paddlespeech/t2s/modules/fastspeech2_transformer/repeat.py index 3c62298e3..0325a6382 100644 --- a/paddlespeech/t2s/modules/fastspeech2_transformer/repeat.py +++ b/paddlespeech/t2s/modules/fastspeech2_transformer/repeat.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Repeat the same layer definition.""" import paddle diff --git a/paddlespeech/t2s/modules/nets_utils.py b/paddlespeech/t2s/modules/nets_utils.py index 0696335a5..30d3db86c 100644 --- a/paddlespeech/t2s/modules/nets_utils.py +++ b/paddlespeech/t2s/modules/nets_utils.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) import paddle from paddle import nn from typeguard import check_argument_types diff --git a/paddlespeech/t2s/modules/pqmf.py b/paddlespeech/t2s/modules/pqmf.py index 70210e3ba..c299fb577 100644 --- a/paddlespeech/t2s/modules/pqmf.py +++ b/paddlespeech/t2s/modules/pqmf.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Pseudo QMF modules.""" import numpy as np import paddle diff --git a/paddlespeech/t2s/modules/residual_stack.py b/paddlespeech/t2s/modules/residual_stack.py index 71bd4f0c5..236f41d3e 100644 --- a/paddlespeech/t2s/modules/residual_stack.py +++ b/paddlespeech/t2s/modules/residual_stack.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Residual stack module in MelGAN.""" from typing import Any from typing import Dict diff --git a/paddlespeech/t2s/modules/stft_loss.py b/paddlespeech/t2s/modules/stft_loss.py index 8af55ab14..31963e718 100644 --- a/paddlespeech/t2s/modules/stft_loss.py +++ b/paddlespeech/t2s/modules/stft_loss.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) import paddle from paddle import nn from paddle.nn import functional as F diff --git a/paddlespeech/t2s/modules/style_encoder.py b/paddlespeech/t2s/modules/style_encoder.py index c6b12d445..868a73a96 100644 --- a/paddlespeech/t2s/modules/style_encoder.py +++ b/paddlespeech/t2s/modules/style_encoder.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Style encoder of GST-Tacotron.""" from typing import Sequence diff --git a/paddlespeech/t2s/modules/tacotron2/decoder.py b/paddlespeech/t2s/modules/tacotron2/decoder.py index 779fd0c62..691bb3ee2 100644 --- a/paddlespeech/t2s/modules/tacotron2/decoder.py +++ b/paddlespeech/t2s/modules/tacotron2/decoder.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Tacotron2 decoder related modules.""" import paddle.nn.functional as F import six diff --git a/paddlespeech/t2s/modules/tacotron2/encoder.py b/paddlespeech/t2s/modules/tacotron2/encoder.py index 95f71d5e3..b95e3529f 100644 --- a/paddlespeech/t2s/modules/tacotron2/encoder.py +++ b/paddlespeech/t2s/modules/tacotron2/encoder.py @@ -11,6 +11,7 @@ # 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. +# Modified from espnet(https://github.com/espnet/espnet) """Tacotron2 encoder related modules.""" import paddle import six