Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Parakeet
提交
45af3a43
P
Parakeet
项目概览
PaddlePaddle
/
Parakeet
通知
8
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Parakeet
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
45af3a43
编写于
6月 12, 2020
作者:
C
chenfeiyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix WeightNormWrapper, stop using CacheDataset for deep voice 3, pin numba version to 0.47.0
上级
b7c584e2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
12 deletion
+13
-12
examples/deepvoice3/data.py
examples/deepvoice3/data.py
+1
-1
parakeet/modules/weight_norm.py
parakeet/modules/weight_norm.py
+11
-10
setup.py
setup.py
+1
-1
未找到文件。
examples/deepvoice3/data.py
浏览文件 @
45af3a43
...
...
@@ -230,7 +230,7 @@ def make_data_loader(data_root, config):
ref_level_db
=
c
[
"ref_level_db"
],
max_norm
=
c
[
"max_norm"
],
clip_norm
=
c
[
"clip_norm"
])
ljspeech
=
CacheDataset
(
TransformDataset
(
meta
,
transform
)
)
ljspeech
=
TransformDataset
(
meta
,
transform
)
# use meta data's text length as a sort key for the sampler
batch_size
=
config
[
"train"
][
"batch_size"
]
...
...
parakeet/modules/weight_norm.py
浏览文件 @
45af3a43
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
numpy
as
np
from
paddle
import
fluid
import
paddle.fluid.dygraph
as
dg
import
paddle.fluid.layers
as
F
...
...
@@ -44,10 +43,10 @@ def norm_except(param, dim, power):
if
dim
is
None
:
return
norm
(
param
,
dim
,
power
)
elif
dim
==
0
:
param_matrix
=
F
.
reshape
(
param
,
(
shape
[
0
],
np
.
prod
(
shape
[
1
:])
))
param_matrix
=
F
.
reshape
(
param
,
(
shape
[
0
],
-
1
))
return
norm
(
param_matrix
,
dim
=
1
,
power
=
power
)
elif
dim
==
-
1
or
dim
==
ndim
-
1
:
param_matrix
=
F
.
reshape
(
param
,
(
np
.
prod
(
shape
[:
-
1
])
,
shape
[
-
1
]))
param_matrix
=
F
.
reshape
(
param
,
(
-
1
,
shape
[
-
1
]))
return
norm
(
param_matrix
,
dim
=
0
,
power
=
power
)
else
:
perm
=
list
(
range
(
ndim
))
...
...
@@ -62,24 +61,26 @@ def compute_l2_normalized_weight(v, g, dim):
ndim
=
len
(
shape
)
if
dim
is
None
:
v_normalized
=
v
/
(
F
.
reduce_sum
(
F
.
square
(
v
))
+
1e-12
)
v_normalized
=
v
/
(
F
.
sqrt
(
F
.
reduce_sum
(
F
.
square
(
v
)
))
+
1e-12
)
elif
dim
==
0
:
param_matrix
=
F
.
reshape
(
v
,
(
shape
[
0
],
np
.
prod
(
shape
[
1
:])
))
param_matrix
=
F
.
reshape
(
v
,
(
shape
[
0
],
-
1
))
v_normalized
=
F
.
l2_normalize
(
param_matrix
,
axis
=
1
)
v_normalized
=
F
.
reshape
(
v_normalized
,
shape
)
elif
dim
==
-
1
or
dim
==
ndim
-
1
:
param_matrix
=
F
.
reshape
(
v
,
(
np
.
prod
(
shape
[:
-
1
])
,
shape
[
-
1
]))
param_matrix
=
F
.
reshape
(
v
,
(
-
1
,
shape
[
-
1
]))
v_normalized
=
F
.
l2_normalize
(
param_matrix
,
axis
=
0
)
v_normalized
=
F
.
reshape
(
v_normalized
,
shape
)
else
:
perm
=
list
(
range
(
ndim
))
perm
[
0
]
=
dim
perm
[
dim
]
=
0
transposed_param
=
F
.
transpose
(
v
,
perm
)
param_matrix
=
F
.
reshape
(
transposed_param
,
(
transposed_param
.
shape
[
0
],
np
.
prod
(
transposed_param
.
shape
[
1
:])
))
transposed_shape
=
transposed_param
.
shape
param_matrix
=
F
.
reshape
(
transposed_param
,
(
transposed_param
.
shape
[
0
],
-
1
))
v_normalized
=
F
.
l2_normalize
(
param_matrix
,
axis
=
1
)
v_normalized
=
F
.
reshape
(
v_normalized
,
transposed_shape
)
v_normalized
=
F
.
transpose
(
v_normalized
,
perm
)
v_normalized
=
F
.
reshape
(
v_normalized
,
shape
)
weight
=
F
.
elementwise_mul
(
v_normalized
,
g
,
axis
=
dim
)
return
weight
...
...
setup.py
浏览文件 @
45af3a43
...
...
@@ -55,7 +55,7 @@ setup_info = dict(
'inflect'
,
'librosa'
,
'unidecode'
,
'numba==0.4
8
.0'
,
'numba==0.4
7
.0'
,
'tqdm==4.19.8'
,
'matplotlib'
,
'tensorboardX'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录