Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
18b85e55
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看板
提交
18b85e55
编写于
12月 01, 2016
作者:
L
Liu Yiqun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add a script to auto compile the warp-ctc submodule.
上级
25f1fbc4
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
39 addition
and
16 deletion
+39
-16
paddle/cuda/CMakeLists.txt
paddle/cuda/CMakeLists.txt
+1
-2
paddle/gserver/tests/CMakeLists.txt
paddle/gserver/tests/CMakeLists.txt
+5
-1
paddle/gserver/tests/test_WarpCTCLayer.cpp
paddle/gserver/tests/test_WarpCTCLayer.cpp
+14
-13
paddle/scripts/travis/build_and_test.sh
paddle/scripts/travis/build_and_test.sh
+1
-0
paddle/scripts/travis/submodules.sh
paddle/scripts/travis/submodules.sh
+18
-0
未找到文件。
paddle/cuda/CMakeLists.txt
浏览文件 @
18b85e55
...
@@ -18,8 +18,7 @@ set(CUDA_CXX_WITH_GPU_SOURCES
...
@@ -18,8 +18,7 @@ set(CUDA_CXX_WITH_GPU_SOURCES
src/hl_cudart_wrap.cc
src/hl_cudart_wrap.cc
src/hl_cuda_cublas.cc
src/hl_cuda_cublas.cc
src/hl_cuda_cudnn.cc
src/hl_cuda_cudnn.cc
src/hl_cuda_device.cc
src/hl_cuda_device.cc
)
)
if
(
WITH_GPU
)
if
(
WITH_GPU
)
set
(
CUDA_CXX_SOURCES
set
(
CUDA_CXX_SOURCES
...
...
paddle/gserver/tests/CMakeLists.txt
浏览文件 @
18b85e55
...
@@ -71,9 +71,13 @@ add_unittest(test_RecurrentLayer
...
@@ -71,9 +71,13 @@ add_unittest(test_RecurrentLayer
############### test_WarpCTCLayer #######################
############### test_WarpCTCLayer #######################
if
(
NOT WITH_DOUBLE
)
if
(
NOT WITH_DOUBLE
)
add_unittest
(
test_WarpCTCLayer
add_unittest
_without_exec
(
test_WarpCTCLayer
test_WarpCTCLayer.cpp
test_WarpCTCLayer.cpp
TestUtil.cpp
)
TestUtil.cpp
)
add_test
(
NAME test_WarpCTCLayer
COMMAND
${
CMAKE_CURRENT_BINARY_DIR
}
/test_WarpCTCLayer --warpctc_dir=
${
PROJ_ROOT
}
/warp-ctc/build
WORKING_DIRECTORY
${
PROJ_ROOT
}
/paddle
)
endif
()
endif
()
############### test_RecurrentGradientMachine ###############
############### test_RecurrentGradientMachine ###############
...
...
paddle/gserver/tests/test_WarpCTCLayer.cpp
浏览文件 @
18b85e55
...
@@ -38,7 +38,7 @@ const real* getData(const Matrix& matrix) {
...
@@ -38,7 +38,7 @@ const real* getData(const Matrix& matrix) {
}
}
}
}
void
checkError
(
const
Matrix
&
matrix1
,
const
Matrix
&
matrix2
)
{
int
checkError
(
const
Matrix
&
matrix1
,
const
Matrix
&
matrix2
)
{
CHECK_EQ
(
matrix1
.
getHeight
(),
matrix2
.
getHeight
());
CHECK_EQ
(
matrix1
.
getHeight
(),
matrix2
.
getHeight
());
CHECK_EQ
(
matrix1
.
getWidth
(),
matrix2
.
getWidth
());
CHECK_EQ
(
matrix1
.
getWidth
(),
matrix2
.
getWidth
());
CHECK_EQ
(
matrix1
.
isTransposed
(),
matrix2
.
isTransposed
());
CHECK_EQ
(
matrix1
.
isTransposed
(),
matrix2
.
isTransposed
());
...
@@ -62,6 +62,7 @@ void checkError(const Matrix& matrix1, const Matrix& matrix2) {
...
@@ -62,6 +62,7 @@ void checkError(const Matrix& matrix1, const Matrix& matrix2) {
}
}
}
}
EXPECT_EQ
(
count
,
0
)
<<
"There are "
<<
count
<<
" different element."
;
EXPECT_EQ
(
count
,
0
)
<<
"There are "
<<
count
<<
" different element."
;
return
count
;
}
}
void
initArgument
(
size_t
batchSize
,
void
initArgument
(
size_t
batchSize
,
...
@@ -72,7 +73,6 @@ void initArgument(size_t batchSize,
...
@@ -72,7 +73,6 @@ void initArgument(size_t batchSize,
data
.
grad
=
Matrix
::
create
(
batchSize
,
layerSize
,
false
,
useGpu
);
data
.
grad
=
Matrix
::
create
(
batchSize
,
layerSize
,
false
,
useGpu
);
data
.
value
->
randomizeUniform
();
data
.
value
->
randomizeUniform
();
data
.
value
->
add
(
-
0.5
);
data
.
value
->
add
(
-
0.5
);
/// data.value->sigmoid(*data.value);
data
.
grad
->
zeroMem
();
data
.
grad
->
zeroMem
();
generateSequenceStartPositions
(
batchSize
,
data
.
sequenceStartPositions
);
generateSequenceStartPositions
(
batchSize
,
data
.
sequenceStartPositions
);
...
@@ -90,9 +90,6 @@ LayerPtr createDataLayer(
...
@@ -90,9 +90,6 @@ LayerPtr createDataLayer(
dataLayer
->
setData
(
data
);
dataLayer
->
setData
(
data
);
dataLayer
->
forward
(
PASS_GC
);
dataLayer
->
forward
(
PASS_GC
);
/// std::cout << "dataLayer: " << std::endl;
/// (dataLayer->getOutput().value)->print(std::cout);
return
layer
;
return
layer
;
}
}
...
@@ -198,14 +195,14 @@ LayerPtr createWarpCTCLayer(string name,
...
@@ -198,14 +195,14 @@ LayerPtr createWarpCTCLayer(string name,
}
}
TEST
(
Layer
,
WarpCTCLayer
)
{
TEST
(
Layer
,
WarpCTCLayer
)
{
for
(
auto
layerSize
:
{
10
,
64
,
128
})
{
for
(
auto
layerSize
:
{
10
,
64
})
{
for
(
auto
batchSize
:
{
1
,
10
,
20
,
64
})
{
for
(
auto
batchSize
:
{
1
,
10
,
32
})
{
for
(
auto
normByTimes
:
{
false
,
true
})
{
for
(
auto
normByTimes
:
{
false
,
true
})
{
for
(
auto
useGpu
:
{
false
,
true
})
{
for
(
auto
useGpu
:
{
false
,
true
})
{
#ifdef PADDLE_ONLY_CPU
#ifdef PADDLE_ONLY_CPU
if
(
useGpu
)
continue
;
if
(
useGpu
)
continue
;
#endif
#endif
LOG
(
INFO
)
<<
"
layerSize="
<<
layerSize
<<
" batchSize="
<<
batchSize
LOG
(
INFO
)
<<
"layerSize="
<<
layerSize
<<
" batchSize="
<<
batchSize
<<
" normByTimes = "
<<
normByTimes
<<
" useGpu="
<<
useGpu
;
<<
" normByTimes = "
<<
normByTimes
<<
" useGpu="
<<
useGpu
;
FLAGS_use_gpu
=
useGpu
;
FLAGS_use_gpu
=
useGpu
;
...
@@ -229,13 +226,17 @@ TEST(Layer, WarpCTCLayer) {
...
@@ -229,13 +226,17 @@ TEST(Layer, WarpCTCLayer) {
LayerPtr
ctcLayer
=
createCTCLayer
(
LayerPtr
ctcLayer
=
createCTCLayer
(
"cost"
,
layerSize
,
useGpu
,
normByTimes
,
dataLayer1
,
labelLayer
);
"cost"
,
layerSize
,
useGpu
,
normByTimes
,
dataLayer1
,
labelLayer
);
/// Check loss
/// Check cost
checkError
(
*
(
warpctcLayer
->
getOutput
().
value
),
LOG
(
INFO
)
<<
"Check cost: "
*
(
ctcLayer
->
getOutput
().
value
));
<<
checkError
(
*
(
warpctcLayer
->
getOutput
().
value
),
*
(
ctcLayer
->
getOutput
().
value
))
<<
" different elements."
;
/// Check gradients
/// Check gradients
checkError
(
*
(
dataLayer0
->
getOutput
().
grad
),
LOG
(
INFO
)
<<
"Check gradients: "
*
(
dataLayer1
->
getOutput
().
grad
));
<<
checkError
(
*
(
dataLayer0
->
getOutput
().
grad
),
*
(
dataLayer1
->
getOutput
().
grad
))
<<
" different elements"
;
}
}
}
}
}
}
...
...
paddle/scripts/travis/build_and_test.sh
浏览文件 @
18b85e55
#!/bin/bash
#!/bin/bash
./submodules.sh
source
./common.sh
source
./common.sh
CMAKE_EXTRA
=
""
CMAKE_EXTRA
=
""
if
[[
"
$TRAVIS_OS_NAME
"
==
"osx"
]]
;
then
if
[[
"
$TRAVIS_OS_NAME
"
==
"osx"
]]
;
then
...
...
paddle/scripts/travis/submodules.sh
0 → 100755
浏览文件 @
18b85e55
#!/bin/bash
set
-e
PROJ_ROOT
=
$(
git rev-parse
--show-cdup
)
SUBMODULES
=
$(
grep
path
${
PROJ_ROOT
}
.gitmodules |
sed
's/^.*path = //'
)
for
module
in
$SUBMODULES
do
case
$module
in
"warp-ctc"
)
if
[
-d
${
PROJ_ROOT
}
warp-ctc/build
]
;
then
rm
-rf
${
PROJ_ROOT
}
warp-ctc/build
fi
mkdir
${
PROJ_ROOT
}
warp-ctc/build
cd
${
PROJ_ROOT
}
warp-ctc/build
cmake ..
;
make
;;
esac
done
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录