Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
0190d5d6
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0190d5d6
编写于
10月 24, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into check_out_lod
上级
2e783663
200a02ec
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
4 deletion
+15
-4
cmake/external/nccl.cmake
cmake/external/nccl.cmake
+1
-1
paddle/operators/conv2dtranspose_op.h
paddle/operators/conv2dtranspose_op.h
+3
-3
python/paddle/v2/parameters.py
python/paddle/v2/parameters.py
+11
-0
未找到文件。
cmake/external/nccl.cmake
浏览文件 @
0190d5d6
...
@@ -2,7 +2,7 @@ INCLUDE(ExternalProject)
...
@@ -2,7 +2,7 @@ INCLUDE(ExternalProject)
SET
(
NCCL_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/nccl
)
SET
(
NCCL_SOURCE_DIR
${
THIRD_PARTY_PATH
}
/nccl
)
INCLUDE_DIRECTORIES
(
${
NCCL_SOURCE_DIR
}
/src/extern_nccl
)
INCLUDE_DIRECTORIES
(
${
NCCL_SOURCE_DIR
}
/src/extern_nccl
/src
)
if
(
WITH_DSO
)
if
(
WITH_DSO
)
...
...
paddle/operators/conv2dtranspose_op.h
浏览文件 @
0190d5d6
...
@@ -120,7 +120,7 @@ class GemmConv2DTransposeKernel : public framework::OpKernel<T> {
...
@@ -120,7 +120,7 @@ class GemmConv2DTransposeKernel : public framework::OpKernel<T> {
math
::
matmul
<
Place
,
T
>
(
context
.
device_context
(),
filter
,
true
,
math
::
matmul
<
Place
,
T
>
(
context
.
device_context
(),
filter
,
true
,
input_batch
,
false
,
T
(
1.0
),
&
col_matrix
,
T
(
0.0
));
input_batch
,
false
,
T
(
1.0
),
&
col_matrix
,
T
(
0.0
));
col2im
(
context
.
device_context
(),
output_batch
,
col
,
strides
[
0
],
col2im
(
context
.
device_context
(),
output_batch
,
col
,
strides
[
0
],
strides
[
1
],
0
,
0
);
strides
[
1
],
0
,
0
,
0
,
0
);
}
}
}
}
};
};
...
@@ -206,7 +206,7 @@ class GemmConv2DTransposeGradKernel : public framework::OpKernel<T> {
...
@@ -206,7 +206,7 @@ class GemmConv2DTransposeGradKernel : public framework::OpKernel<T> {
// im2col: dy from (c, o_h, o_w) -> (c * k_h * k_w, h * w)
// im2col: dy from (c, o_h, o_w) -> (c * k_h * k_w, h * w)
im2col
(
context
.
device_context
(),
output_grad_batch
,
col
,
strides
[
0
],
im2col
(
context
.
device_context
(),
output_grad_batch
,
col
,
strides
[
0
],
strides
[
1
],
paddings
[
0
],
paddings
[
1
]);
strides
[
1
],
paddings
[
0
],
paddings
[
0
],
paddings
[
1
],
paddings
[
1
]);
// gemm: dx = filter * dy
// gemm: dx = filter * dy
// (m, c * k_h * k_w) * (c * k_h * k_w, h * w) -> (m, c, h)
// (m, c * k_h * k_w) * (c * k_h * k_w, h * w) -> (m, c, h)
...
@@ -238,7 +238,7 @@ class GemmConv2DTransposeGradKernel : public framework::OpKernel<T> {
...
@@ -238,7 +238,7 @@ class GemmConv2DTransposeGradKernel : public framework::OpKernel<T> {
// im2col: (c * h * w, k_h * k_w)
// im2col: (c * h * w, k_h * k_w)
im2col
(
context
.
device_context
(),
output_grad_batch
,
col
,
strides
[
0
],
im2col
(
context
.
device_context
(),
output_grad_batch
,
col
,
strides
[
0
],
strides
[
1
],
paddings
[
0
],
paddings
[
1
]);
strides
[
1
],
paddings
[
0
],
paddings
[
0
],
paddings
[
1
],
paddings
[
1
]);
// gemm: d_filter = x * y_grad^T
// gemm: d_filter = x * y_grad^T
// (m, c * h * w) * (k_h * k_w, c * h * w) -> (m, c, h)
// (m, c * h * w) * (k_h * k_w, c * h * w) -> (m, c, h)
...
...
python/paddle/v2/parameters.py
浏览文件 @
0190d5d6
...
@@ -326,6 +326,17 @@ class Parameters(object):
...
@@ -326,6 +326,17 @@ class Parameters(object):
self
.
set
(
name
,
arr
.
reshape
(
self
.
get_shape
(
name
)))
self
.
set
(
name
,
arr
.
reshape
(
self
.
get_shape
(
name
)))
def
to_tar
(
self
,
f
):
def
to_tar
(
self
,
f
):
"""
Save parameters to a tar file.
WARNING: You should use `paddle.v2.trainer.SGD.save_parameter_to_tar(f)`
to save parameters most of the time. Otherwise, some settings such
as model average will not take effect.
:param f:
:type f: file
:return:
"""
tar
=
tarfile
.
TarFile
(
fileobj
=
f
,
mode
=
'w'
)
tar
=
tarfile
.
TarFile
(
fileobj
=
f
,
mode
=
'w'
)
for
nm
in
self
.
names
():
for
nm
in
self
.
names
():
buf
=
cStringIO
.
StringIO
()
buf
=
cStringIO
.
StringIO
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录