Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
b9ca1e0f
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b9ca1e0f
编写于
1月 17, 2017
作者:
T
Tao Luo
提交者:
GitHub
1月 17, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1156 from Zrachel/fixbug_cossim
fix default value of cos_sim scale
上级
7e03cbaa
19cb2a7f
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
4 addition
and
4 deletion
+4
-4
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+1
-1
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+1
-1
python/paddle/trainer_config_helpers/tests/configs/protostr/test_ntm_layers.protostr
...g_helpers/tests/configs/protostr/test_ntm_layers.protostr
+2
-2
未找到文件。
python/paddle/trainer/config_parser.py
浏览文件 @
b9ca1e0f
...
@@ -2628,7 +2628,7 @@ class AverageLayer(LayerBase):
...
@@ -2628,7 +2628,7 @@ class AverageLayer(LayerBase):
@
config_layer
(
'cos'
)
@
config_layer
(
'cos'
)
class
CosSimLayer
(
LayerBase
):
class
CosSimLayer
(
LayerBase
):
def
__init__
(
self
,
name
,
inputs
,
cos_scale
=
5
,
device
=
None
):
def
__init__
(
self
,
name
,
inputs
,
cos_scale
=
1
,
device
=
None
):
super
(
CosSimLayer
,
self
).
__init__
(
super
(
CosSimLayer
,
self
).
__init__
(
name
,
'cos'
,
1
,
inputs
=
inputs
,
device
=
device
)
name
,
'cos'
,
1
,
inputs
=
inputs
,
device
=
device
)
config_assert
(
len
(
self
.
inputs
)
==
2
,
'CosSimLayer must have 2 inputs'
)
config_assert
(
len
(
self
.
inputs
)
==
2
,
'CosSimLayer must have 2 inputs'
)
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
b9ca1e0f
...
@@ -1673,7 +1673,7 @@ def trans_layer(input, name=None, layer_attr=None):
...
@@ -1673,7 +1673,7 @@ def trans_layer(input, name=None, layer_attr=None):
@
wrap_name_default
()
@
wrap_name_default
()
@
layer_support
()
@
layer_support
()
def
cos_sim
(
a
,
b
,
scale
=
5
,
size
=
1
,
name
=
None
,
layer_attr
=
None
):
def
cos_sim
(
a
,
b
,
scale
=
1
,
size
=
1
,
name
=
None
,
layer_attr
=
None
):
"""
"""
Cosine Similarity Layer. The cosine similarity equation is here.
Cosine Similarity Layer. The cosine similarity equation is here.
...
...
python/paddle/trainer_config_helpers/tests/configs/protostr/test_ntm_layers.protostr
浏览文件 @
b9ca1e0f
...
@@ -79,7 +79,7 @@ layers {
...
@@ -79,7 +79,7 @@ layers {
inputs {
inputs {
input_layer_name: "b"
input_layer_name: "b"
}
}
cos_scale:
5
cos_scale:
1
}
}
layers {
layers {
name: "__cos_sim_1__"
name: "__cos_sim_1__"
...
@@ -92,7 +92,7 @@ layers {
...
@@ -92,7 +92,7 @@ layers {
inputs {
inputs {
input_layer_name: "c"
input_layer_name: "c"
}
}
cos_scale:
5
cos_scale:
1
}
}
layers {
layers {
name: "__sum_to_one_norm_layer_0__"
name: "__sum_to_one_norm_layer_0__"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录