From 3adb310a1cafb0be1e104aad35491893bbb4e06f Mon Sep 17 00:00:00 2001 From: tianhao zhang <15600919271@163.com> Date: Thu, 17 Nov 2022 17:26:37 +0000 Subject: [PATCH] wav2vec2 demo update: support different optimizer and lr_schedular, align mdoel, update input type, test=asr --- .../s2t/models/wav2vec2/modules/VanillaNN.py | 20 +++++++++++++---- .../s2t/models/wav2vec2/modules/linear.py | 22 ++++++++++++++----- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/paddlespeech/s2t/models/wav2vec2/modules/VanillaNN.py b/paddlespeech/s2t/models/wav2vec2/modules/VanillaNN.py index f47f2b0ab..82313c330 100644 --- a/paddlespeech/s2t/models/wav2vec2/modules/VanillaNN.py +++ b/paddlespeech/s2t/models/wav2vec2/modules/VanillaNN.py @@ -1,7 +1,19 @@ -"""Vanilla Neural Network for simple tests. -Authors -* Elena Rastorgueva 2020 -""" +# Authors +# * Elena Rastorgueva 2020 +# Copyright (c) 2022 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. +# Modified from speechbrain(https://github.com/speechbrain/speechbrain/blob/develop/speechbrain/lobes/models/VanillaNN.py). import paddle from paddlespeech.s2t.models.wav2vec2.modules import containers diff --git a/paddlespeech/s2t/models/wav2vec2/modules/linear.py b/paddlespeech/s2t/models/wav2vec2/modules/linear.py index 0b40f4362..3ea3716c4 100644 --- a/paddlespeech/s2t/models/wav2vec2/modules/linear.py +++ b/paddlespeech/s2t/models/wav2vec2/modules/linear.py @@ -1,8 +1,20 @@ -"""Library implementing linear transformation. -Authors - * Mirco Ravanelli 2020 - * Davide Borra 2021 -""" +# Authors +# * Mirco Ravanelli 2020 +# * Davide Borra 2021 +# Copyright (c) 2022 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. +# Modified from speechbrain(https://github.com/speechbrain/speechbrain/blob/develop/speechbrain/nnet/linear.py). import logging import paddle