Skip to content

Commit 28c4cee

Browse files
committed
Merge branch 'develop' of github.com:baidu/Paddle into feature/c_api
2 parents bda2008 + fb05a73 commit 28c4cee

File tree

24 files changed

+430
-60
lines changed

24 files changed

+430
-60
lines changed

doc/api/v2/config/optimizer.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _api_v2.optimizer:
2-
31
==========
42
Optimizer
53
==========

doc/api/v2/data.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
========
2-
Datasets
3-
========
1+
==================================
2+
Data Reader Interface and DataSets
3+
==================================
44

55

66
DataTypes
@@ -49,7 +49,6 @@ mnist
4949
:members:
5050
:noindex:
5151

52-
5352
cifar
5453
+++++
5554

@@ -61,7 +60,7 @@ conll05
6160
+++++++
6261

6362
.. automodule:: paddle.v2.dataset.conll05
64-
:members:
63+
:members: get_dict,get_embedding,test
6564
:noindex:
6665

6766
imdb
@@ -85,6 +84,12 @@ movielens
8584
:members:
8685
:noindex:
8786

87+
.. autoclass:: paddle.v2.dataset.movielens.MovieInfo
88+
:noindex:
89+
90+
.. autoclass:: paddle.v2.dataset.movielens.UserInfo
91+
:noindex:
92+
8893
sentiment
8994
+++++++++
9095

@@ -102,7 +107,7 @@ uci_housing
102107
wmt14
103108
+++++
104109

105-
.. automodule:: paddle.v2.dataset.uci_housing
110+
.. automodule:: paddle.v2.dataset.wmt14
106111
:members:
107112
:noindex:
108113

doc/api/v2/run_logic.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@ Parameters
66
==========
77

88
.. automodule:: paddle.v2.parameters
9+
:members: Parameters
910
:noindex:
1011

1112
Trainer
1213
=======
1314

1415
.. automodule:: paddle.v2.trainer
16+
:members: SGD
1517
:noindex:
1618

1719
Event
1820
=====
1921

2022
.. automodule:: paddle.v2.event
23+
:members:
2124
:noindex:
2225

2326
Inference
2427
=========
2528

2629
.. autofunction:: paddle.v2.infer
2730
:noindex:
31+

doc/tutorials/embedding_model/index_cn.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
## 介绍 ###
88
### 中文字典 ###
9-
我们的字典使用内部的分词工具对百度知道和百度百科的语料进行分词后产生。分词风格如下: "《红楼梦》"将被分为 "《","红楼梦","》",和 "《红楼梦》"。字典采用UTF8编码,输出有2列:词本身和词频。字典共包含 3206325个词和3个特殊标记
9+
我们的字典使用内部的分词工具对百度知道和百度百科的语料进行分词后产生。分词风格如下: "《红楼梦》"将被分为 "《","红楼梦","》",和 "《红楼梦》"。字典采用UTF8编码,输出有2列:词本身和词频。字典共包含 3206326个词和4个特殊标记
1010
- `<s>`: 分词序列的开始
1111
- `<e>`: 分词序列的结束
12+
- `PALCEHOLDER_JUST_IGNORE_THE_EMBEDDING`: 占位符,没有实际意义
1213
- `<unk>`: 未知词
1314

1415
### 中文词向量的预训练模型 ###

doc/tutorials/embedding_model/index_en.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ We thank @lipeng for the pull request that defined the model schemas and pretrai
66

77
## Introduction ###
88
### Chinese Word Dictionary ###
9-
Our Chinese-word dictionary is created on Baidu ZhiDao and Baidu Baike by using in-house word segmentor. For example, the participle of "《红楼梦》" is "《","红楼梦","》",and "《红楼梦》". Our dictionary (using UTF-8 format) has has two columns: word and its frequency. The total word count is 3206325, including 3 special token:
9+
Our Chinese-word dictionary is created on Baidu ZhiDao and Baidu Baike by using in-house word segmentor. For example, the participle of "《红楼梦》" is "《","红楼梦","》",and "《红楼梦》". Our dictionary (using UTF-8 format) has has two columns: word and its frequency. The total word count is 3206326, including 4 special token:
1010
- `<s>`: the start of a sequence
1111
- `<e>`: the end of a sequence
12+
- `PALCEHOLDER_JUST_IGNORE_THE_EMBEDDING`: a placeholder, just ignore it and its embedding
1213
- `<unk>`: a word not included in dictionary
1314

1415
### Pretrained Chinese Word Embedding Model ###

paddle/gserver/gradientmachines/GradientMachine.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ class GradientMachine {
134134
backward(callback);
135135
}
136136

137-
virtual Argument getLayerOutput(const std::string& layerName) {
138-
return *((Argument*)nullptr);
139-
}
137+
virtual Argument getLayerOutput(const std::string& layerName) = 0;
140138

141139
// see comment in Layer.h for the function with the same name
142140
virtual void resetState() {}

paddle/scripts/docker/build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ if [ ${WITH_GPU} == "ON" ]; then
99
GPU_DOCKER_PKG="python-pip python-dev"
1010
else
1111
BASE_IMAGE="python:2.7.13-slim"
12+
# FIXME: python base image uses different python version than WITH_GPU
13+
# need to change PYTHONHOME to /usr/local when using python base image
14+
CPU_DOCKER_PYTHON_HOME_ENV="ENV PYTHONHOME /usr/local"
1215
fi
1316

1417
DOCKERFILE_GPU_ENV=""
@@ -97,7 +100,8 @@ ADD build/*.deb /usr/local/opt/paddle/deb/
97100
RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && \
98101
rm -f /usr/local/opt/paddle/deb/*.deb && \
99102
paddle version
100-
${DOCKERFILE_CUDNN_DSO}
103+
${CPU_DOCKER_PYTHON_HOME_ENV}
104+
${DOCKERFILE_CUDNN_DSO}
101105
${DOCKERFILE_GPU_ENV}
102106
# default command shows the paddle version and exit
103107
CMD ["paddle", "version"]

paddle/utils/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
enable_virtualenv.c
2-
PythonUtil.cpp

paddle/utils/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# The utilities for paddle
2-
3-
configure_file(PythonUtil.cpp.in ${PROJ_ROOT}/paddle/utils/PythonUtil.cpp)
4-
52
file(GLOB UTIL_HEADERS . *.h)
63
file(GLOB UTIL_SOURCES . *.cpp)
74
create_resources(enable_virtualenv.py enable_virtualenv.c)

paddle/utils/PythonUtil.cpp.in renamed to paddle/utils/PythonUtil.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,6 @@ extern const char enable_virtualenv_py[];
195195
}
196196
void initPython(int argc, char** argv) {
197197
#ifndef PADDLE_NO_PYTHON
198-
std::string pyHome;
199-
#if defined(__APPLE__) || defined(__OSX__)
200-
pyHome = "/usr/local/Frameworks/Python.framework/Versions/2.7";
201-
Py_SetPythonHome(const_cast<char*>(pyHome.c_str()));
202-
#endif
203-
pyHome = "@PYTHON_INSTALL_DIR@"; // NOLINT
204-
if (!pyHome.empty()) {
205-
Py_SetPythonHome(const_cast<char*>(pyHome.c_str()));
206-
}
207198
Py_SetProgramName(argv[0]);
208199
Py_Initialize();
209200
PySys_SetArgv(argc, argv);

0 commit comments

Comments
 (0)