Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
567e90e4
P
PaddleSlim
项目概览
PaddlePaddle
/
PaddleSlim
1 年多 前同步成功
通知
51
Star
1434
Fork
344
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
16
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSlim
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
567e90e4
编写于
5月 18, 2020
作者:
W
whs
提交者:
GitHub
5月 18, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename fluid.layers.one_hot to fluid.one_hot (#292)
上级
b3e4cbeb
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
3 addition
and
3 deletion
+3
-3
demo/darts/train_imagenet.py
demo/darts/train_imagenet.py
+1
-1
demo/models/slimfacenet.py
demo/models/slimfacenet.py
+1
-1
paddleslim/models/slimfacenet.py
paddleslim/models/slimfacenet.py
+1
-1
未找到文件。
demo/darts/train_imagenet.py
浏览文件 @
567e90e4
...
@@ -68,7 +68,7 @@ add_arg('use_data_parallel', ast.literal_eval, False, "The flag indicating whet
...
@@ -68,7 +68,7 @@ add_arg('use_data_parallel', ast.literal_eval, False, "The flag indicating whet
def
cross_entropy_label_smooth
(
preds
,
targets
,
epsilon
):
def
cross_entropy_label_smooth
(
preds
,
targets
,
epsilon
):
preds
=
fluid
.
layers
.
softmax
(
preds
)
preds
=
fluid
.
layers
.
softmax
(
preds
)
targets_one_hot
=
fluid
.
layers
.
one_hot
(
input
=
targets
,
depth
=
args
.
class_num
)
targets_one_hot
=
fluid
.
one_hot
(
input
=
targets
,
depth
=
args
.
class_num
)
targets_smooth
=
fluid
.
layers
.
label_smooth
(
targets_smooth
=
fluid
.
layers
.
label_smooth
(
targets_one_hot
,
epsilon
=
epsilon
,
dtype
=
"float32"
)
targets_one_hot
,
epsilon
=
epsilon
,
dtype
=
"float32"
)
loss
=
fluid
.
layers
.
cross_entropy
(
loss
=
fluid
.
layers
.
cross_entropy
(
...
...
demo/models/slimfacenet.py
浏览文件 @
567e90e4
...
@@ -334,7 +334,7 @@ class SlimFaceNet():
...
@@ -334,7 +334,7 @@ class SlimFaceNet():
else
:
else
:
pass
pass
one_hot
=
fluid
.
layers
.
one_hot
(
input
=
label
,
depth
=
out_dim
)
one_hot
=
fluid
.
one_hot
(
input
=
label
,
depth
=
out_dim
)
output
=
fluid
.
layers
.
elementwise_mul
(
output
=
fluid
.
layers
.
elementwise_mul
(
one_hot
,
phi
)
+
fluid
.
layers
.
elementwise_mul
(
one_hot
,
phi
)
+
fluid
.
layers
.
elementwise_mul
(
(
1.0
-
one_hot
),
cosine
)
(
1.0
-
one_hot
),
cosine
)
...
...
paddleslim/models/slimfacenet.py
浏览文件 @
567e90e4
...
@@ -334,7 +334,7 @@ class SlimFaceNet():
...
@@ -334,7 +334,7 @@ class SlimFaceNet():
else
:
else
:
pass
pass
one_hot
=
fluid
.
layers
.
one_hot
(
input
=
label
,
depth
=
out_dim
)
one_hot
=
fluid
.
one_hot
(
input
=
label
,
depth
=
out_dim
)
output
=
fluid
.
layers
.
elementwise_mul
(
output
=
fluid
.
layers
.
elementwise_mul
(
one_hot
,
phi
)
+
fluid
.
layers
.
elementwise_mul
(
one_hot
,
phi
)
+
fluid
.
layers
.
elementwise_mul
(
(
1.0
-
one_hot
),
cosine
)
(
1.0
-
one_hot
),
cosine
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录