Skip to content

Commit 08113b2

Browse files
committed
Merge branch 'develop' of github.com:baidu/Paddle into feature/c_api
2 parents 5ac9c22 + a7730d4 commit 08113b2

File tree

71 files changed

+1823
-686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1823
-686
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

paddle/scripts/docker/Dockerfile.gpu renamed to Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1+
# A image for building paddle binaries
2+
# Use cuda devel base image for both cpu and gpu environment
13
FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04
24
MAINTAINER PaddlePaddle Authors <[email protected]>
35

46
ARG DEBIAN_FRONTEND=noninteractive
57
ARG UBUNTU_MIRROR
6-
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
8+
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
79

810
# ENV variables
911
ARG BUILD_WOBOQ
1012
ARG BUILD_AND_INSTALL
13+
ARG WITH_GPU
1114
ARG WITH_AVX
1215
ARG WITH_DOC
1316
ARG WITH_STYLE_CHECK
1417

1518
ENV BUILD_WOBOQ=${BUILD_WOBOQ:-OFF}
1619
ENV BUILD_AND_INSTALL=${BUILD_AND_INSTALL:-OFF}
17-
ENV WITH_GPU=ON
20+
ENV WITH_GPU=${WITH_AVX:-OFF}
1821
ENV WITH_AVX=${WITH_AVX:-ON}
1922
ENV WITH_DOC=${WITH_DOC:-OFF}
2023
ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF}
2124

2225
ENV HOME /root
23-
2426
# Add bash enhancements
2527
COPY ./paddle/scripts/docker/root/ /root/
2628

@@ -49,9 +51,7 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
4951
cd cmake-3.4.1 && ./bootstrap && make -j `nproc` && make install && \
5052
cd .. && rm -rf cmake-3.4.1
5153

52-
COPY . /paddle/
53-
RUN cd /paddle/ && git submodule update --init --recursive
54-
RUN /paddle/paddle/scripts/docker/build.sh
54+
RUN apt-get install -y swig
5555

5656
VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"]
5757

@@ -62,9 +62,5 @@ RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
6262
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
6363
EXPOSE 22
6464

65-
# Jupyter Notebook: Paddle book
66-
EXPOSE 8888
67-
68-
COPY ./paddle/scripts/docker/entrypoint /opt/bin/
69-
70-
CMD ["/opt/bin/entrypoint"]
65+
# development image default do build work
66+
CMD ["bash", "/paddle/paddle/scripts/docker/build.sh"]

book

Lines changed: 0 additions & 1 deletion
This file was deleted.

cmake/FindSphinx.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function( Sphinx_add_target target_name builder conf cache source destination )
7272
${source}
7373
${destination}
7474
COMMENT "Generating sphinx documentation: ${builder}"
75-
COMMAND cd ${destination} && ln -s ./index_*.html index.html
75+
COMMAND cd ${destination} && ln -sf ./index_*.html index.html
7676
)
7777

7878
set_property(

cmake/external/protobuf.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ INCLUDE(ExternalProject)
1616

1717
FIND_PACKAGE(Protobuf 3.1)
1818

19+
IF(PROTOBUF_FOUND)
20+
EXEC_PROGRAM(${PROTOBUF_PROTOC_EXECUTABLE} ARGS --version OUTPUT_VARIABLE PROTOBUF_VERSION)
21+
STRING(REGEX MATCH "[0-9]+.[0-9]+" PROTOBUF_VERSION "${PROTOBUF_VERSION}")
22+
IF (${PROTOBUF_VERSION} VERSION_LESS "3.1.0")
23+
SET(PROTOBUF_FOUND OFF)
24+
ENDIF()
25+
ENDIF(PROTOBUF_FOUND)
26+
1927
IF(NOT PROTOBUF_FOUND)
2028
SET(PROTOBUF_SOURCES_DIR ${THIRD_PARTY_PATH}/protobuf)
2129
SET(PROTOBUF_INSTALL_DIR ${THIRD_PARTY_PATH}/install/protobuf)

cmake/util.cmake

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,10 @@ function(link_paddle_exe TARGET_NAME)
7171
generate_rdma_links()
7272
endif()
7373

74-
if(WITH_METRIC)
75-
if(WITH_GPU)
76-
set(METRIC_LIBS paddle_metric_learning paddle_dserver_lib metric metric_cpu)
77-
else()
78-
set(METRIC_LIBS paddle_metric_learning paddle_dserver_lib metric_cpu)
79-
endif()
80-
else()
81-
set(METRIC_LIBS "")
82-
endif()
83-
8474
target_circle_link_libraries(${TARGET_NAME}
8575
ARCHIVE_START
8676
paddle_gserver
8777
paddle_function
88-
${METRIC_LIBS}
8978
ARCHIVE_END
9079
paddle_pserver
9180
paddle_trainer_lib
@@ -95,7 +84,6 @@ function(link_paddle_exe TARGET_NAME)
9584
paddle_parameter
9685
paddle_proto
9786
paddle_cuda
98-
${METRIC_LIBS}
9987
${EXTERNAL_LIBS}
10088
${CMAKE_THREAD_LIBS_INIT}
10189
${CMAKE_DL_LIBS}

demo/introduction/api_train_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def main():
1414
act=paddle.activation.Linear(),
1515
bias_attr=paddle.attr.Param(name='b'))
1616
y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1))
17-
cost = paddle.layer.regression_cost(input=y_predict, label=y)
17+
cost = paddle.layer.mse_cost(input=y_predict, label=y)
1818

1919
# create parameters
2020
parameters = paddle.parameters.create(cost)

demo/introduction/trainer_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
size=1,
3535
act=LinearActivation(),
3636
bias_attr=ParamAttr(name='b'))
37-
cost = regression_cost(input=y_predict, label=y)
37+
cost = mse_cost(input=y_predict, label=y)
3838
outputs(cost)

demo/recommendation/api_train_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def main():
6161

6262
inference = paddle.layer.cos_sim(
6363
a=usr_combined_features, b=mov_combined_features, size=1, scale=5)
64-
cost = paddle.layer.regression_cost(
64+
cost = paddle.layer.mse_cost(
6565
input=inference,
6666
label=paddle.layer.data(
6767
name='score', type=paddle.data_type.dense_vector(1)))

demo/recommendation/trainer_config.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ def construct_feature(name):
8686
user_feature = construct_feature("user")
8787
similarity = cos_sim(a=movie_feature, b=user_feature)
8888
if not is_predict:
89-
outputs(
90-
regression_cost(
91-
input=similarity, label=data_layer(
92-
'rating', size=1)))
89+
outputs(mse_cost(input=similarity, label=data_layer('rating', size=1)))
9390

9491
define_py_data_sources2(
9592
'data/train.list',

0 commit comments

Comments
 (0)