Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
e9082bb7
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
1 年多 前同步成功
通知
696
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看板
提交
e9082bb7
编写于
11月 13, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resume unit testing.
上级
884ce5d5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
37 deletion
+33
-37
paddle/operators/cross_entropy_op.cu
paddle/operators/cross_entropy_op.cu
+0
-2
paddle/operators/math/math_function.cu
paddle/operators/math/math_function.cu
+3
-3
paddle/operators/sequence_conv_op.h
paddle/operators/sequence_conv_op.h
+0
-2
python/paddle/v2/framework/tests/test_lstm_op.py
python/paddle/v2/framework/tests/test_lstm_op.py
+1
-2
python/paddle/v2/framework/tests/test_seq_conv.py
python/paddle/v2/framework/tests/test_seq_conv.py
+29
-28
未找到文件。
paddle/operators/cross_entropy_op.cu
浏览文件 @
e9082bb7
...
...
@@ -23,8 +23,6 @@ template <typename T>
__global__
void
CrossEntropyGradientKernel
(
T
*
dX
,
const
T
*
dY
,
const
T
*
X
,
const
int64_t
*
label
,
const
int
N
,
const
int
D
)
{
// TOOD(qingqing) define CUDA_1D_KERNEL_LOOP macro in a common file.
// CUDA_1D_KERNEL_LOOP(i, N) {
for
(
int
i
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
i
<
N
;
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
int
idx
=
i
*
D
+
label
[
i
];
...
...
paddle/operators/math/math_function.cu
浏览文件 @
e9082bb7
...
...
@@ -240,7 +240,7 @@ void axpy<platform::GPUPlace, float>(const platform::DeviceContext& context,
PADDLE_ENFORCE
(
platform
::
dynload
::
cublasSaxpy
(
reinterpret_cast
<
const
platform
::
CUDADeviceContext
&>
(
context
)
.
cublas_handle
(),
n
,
alpha
,
x
,
1
,
y
,
1
));
n
,
&
alpha
,
x
,
1
,
y
,
1
));
}
template
<
>
...
...
@@ -250,7 +250,7 @@ void axpy<platform::GPUPlace, double>(const platform::DeviceContext& context,
PADDLE_ENFORCE
(
platform
::
dynload
::
cublasDaxpy
(
reinterpret_cast
<
const
platform
::
CUDADeviceContext
&>
(
context
)
.
cublas_handle
(),
n
,
alpha
,
x
,
1
,
y
,
1
));
n
,
&
alpha
,
x
,
1
,
y
,
1
));
}
template
struct
SetConstant
<
platform
::
GPUPlace
,
float
>;
...
...
@@ -270,7 +270,7 @@ DEFINE_GPU_TRANS(6);
struct
TensorSetConstantGPU
{
TensorSetConstantGPU
(
const
platform
::
DeviceContext
&
context
,
framework
::
Tensor
*
tensor
,
float
value
)
framework
::
Tensor
*
tensor
,
float
value
)
:
context_
(
context
),
tensor_
(
tensor
),
value_
(
value
)
{}
template
<
typename
T
>
...
...
paddle/operators/sequence_conv_op.h
浏览文件 @
e9082bb7
...
...
@@ -65,10 +65,8 @@ class SequenceConvKernel : public framework::OpKernel<T> {
padding_trainable
,
context_start
,
context_length
,
context_stride
,
up_pad
,
down_pad
);
context
.
device_context
().
Finish
();
math
::
matmul
<
Place
,
T
>
(
context
.
device_context
(),
col
,
false
,
filter
,
false
,
static_cast
<
T
>
(
1.0
),
out
,
static_cast
<
T
>
(
0.0
));
context
.
device_context
().
Finish
();
}
};
...
...
python/paddle/v2/framework/tests/test_lstm_op.py
浏览文件 @
e9082bb7
...
...
@@ -180,7 +180,6 @@ class TestLstmOp(OpTest):
[
'Input'
,
'Weight'
,
'Bias'
],
[
'Hidden'
],
max_relative_error
=
5e-4
)
"""
class
TestLstmOpHasInitial
(
TestLstmOp
):
def
set_argument
(
self
):
self
.
lod
=
[[
0
,
2
,
5
,
7
]]
...
...
@@ -281,7 +280,7 @@ class TestLstmOpNotUsePeepholes(TestLstmOp):
self
.
has_initial_state
=
False
self
.
is_reverse
=
True
self
.
use_peepholes
=
False
"""
if
__name__
==
'__main__'
:
unittest
.
main
()
python/paddle/v2/framework/tests/test_seq_conv.py
浏览文件 @
e9082bb7
...
...
@@ -122,7 +122,7 @@ class TestSeqProject(OpTest):
max_relative_error
=
0.05
,
no_grad_set
=
set
([
'X'
,
'Filter'
]))
def
not_
test_check_grad_Filter
(
self
):
def
test_check_grad_Filter
(
self
):
self
.
check_grad
(
[
'Filter'
],
'Out'
,
...
...
@@ -165,33 +165,34 @@ class TestSeqProject(OpTest):
self
.
output_represention
=
8
# output feature size
#class TestSeqProjectCase1(TestSeqProject):
# def init_test_case(self):
# self.input_row = 11
# self.context_start = -1
# self.context_length = 3
# self.padding_trainable = True
# self.context_stride = 1
#
# self.input_size = [self.input_row, 23]
# self.lod = [[0, 4, 5, 8, self.input_row]]
# self.output_represention = 8 # output feature size
#
#
#class TestSeqProjectCase2(TestSeqProject):
# def init_test_case(self):
# self.input_row = 25
# self.context_start = 2
# self.context_length = 3
# self.padding_trainable = True
# self.context_stride = 1
#
# self.input_size = [self.input_row, 23]
# idx = range(self.input_size[0])
# del idx[0]
# self.lod = [[0] + np.sort(random.sample(idx, 8)).tolist() +
# [self.input_size[0]]]
# self.output_represention = 8 # output feature size
class
TestSeqProjectCase1
(
TestSeqProject
):
def
init_test_case
(
self
):
self
.
input_row
=
11
self
.
context_start
=
-
1
self
.
context_length
=
3
self
.
padding_trainable
=
True
self
.
context_stride
=
1
self
.
input_size
=
[
self
.
input_row
,
23
]
self
.
lod
=
[[
0
,
4
,
5
,
8
,
self
.
input_row
]]
self
.
output_represention
=
8
# output feature size
class
TestSeqProjectCase2
(
TestSeqProject
):
def
init_test_case
(
self
):
self
.
input_row
=
25
self
.
context_start
=
2
self
.
context_length
=
3
self
.
padding_trainable
=
True
self
.
context_stride
=
1
self
.
input_size
=
[
self
.
input_row
,
23
]
idx
=
range
(
self
.
input_size
[
0
])
del
idx
[
0
]
self
.
lod
=
[[
0
]
+
np
.
sort
(
random
.
sample
(
idx
,
8
)).
tolist
()
+
[
self
.
input_size
[
0
]]]
self
.
output_represention
=
8
# output feature size
if
__name__
==
'__main__'
:
unittest
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录