You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2015/06/24 15:35:59 UTC
[16/18] incubator-singa git commit: SIGNA-21 Code review-2
SIGNA-21 Code review-2
Clean model.proto and extract some protos to common.proto to make it easier for the web front code to parse it.
--Replaced layer type (which was string) to enum , e.g., 'kLabel' to kLabel.
--Reorganize UpdaterProto to separate configurations for different learning rate change methods and different SGD algorithms. E.g., linear_conf is used for linear interpolation of learning rate.
Tested on mnist and cifar10 dataset.
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/acfc4097
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/acfc4097
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/acfc4097
Branch: refs/heads/master
Commit: acfc4097f8b824a6321a719babc58cc80bb7f2f2
Parents: 28ac509
Author: wang wei <wa...@comp.nus.edu.sg>
Authored: Wed Jun 24 16:16:24 2015 +0800
Committer: wang wei <wa...@comp.nus.edu.sg>
Committed: Wed Jun 24 17:11:12 2015 +0800
----------------------------------------------------------------------
Makefile.am | 26 +-
Makefile.in | 1011 +-
aclocal.m4 | 7371 +------
config.h.in | 9 +-
config/config.guess | 615 +-
config/config.sub | 434 +-
config/depcomp | 637 +-
config/install-sh | 538 +-
config/ltmain.sh | 14884 +++++++------
config/missing | 453 +-
configure | 32340 +++++++++++++---------------
examples/cifar10/model-lmdb.conf | 218 -
examples/cifar10/model-prefetch.conf | 241 -
examples/cifar10/model.conf | 78 +-
examples/mnist/create_shard.cc | 17 +-
examples/mnist/mlp-lmdb.conf | 223 -
examples/mnist/mlp.conf | 65 +-
include/neuralnet/base_layer.h | 7 +-
include/neuralnet/layer.h | 9 +-
include/utils/blob.h | 2 +-
include/utils/factory.h | 34 +-
src/neuralnet/base_layer.cc | 13 +-
src/neuralnet/layer.cc | 92 +-
src/neuralnet/neuralnet.cc | 78 +-
src/proto/common.proto | 80 +
src/proto/model.proto | 507 +-
src/trainer/trainer.cc | 3 +
src/utils/updater.cc | 53 +-
28 files changed, 26858 insertions(+), 33180 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/acfc4097/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index e0df55e..ad8025f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-CLOCAL_AMFLAGS = -I config
+CLOCAL_AMFLAGS = -I config
AUTOMAKE_OPTIONS = foreign subdir-objects
AM_CPPFLAGS = -I$(top_srcdir)/src
@@ -6,14 +6,14 @@ AM_CPPFLAGS = -I$(top_srcdir)/src
MSHADOW_FLAGS = -DMSHADOW_USE_CUDA=0 -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0
AC_CXXFLAGS = -O3 -Wall -pthread -fPIC -std=c++11 -Wno-unknown-pragmas \
- $(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops
+ $(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops
INCLUDES=-I$(top_srcdir)/include
-PROTOS := $(top_srcdir)/src/proto/cluster.proto $(top_srcdir)/src/proto/model.proto
-PROTO_SRCS := src/proto/cluster.pb.cc src/proto/model.pb.cc
-PROTO_HDRS := src/proto/cluster.pb.h src/proto/model.pb.h
-PROTO_OBJS := src/proto/cluster.pb.o src/proto/model.pb.o
+PROTOS := $(top_srcdir)/src/proto/cluster.proto $(top_srcdir)/src/proto/model.proto $(top_srcdir)/src/proto/common.proto
+PROTO_SRCS := src/proto/cluster.pb.cc src/proto/model.pb.cc src/proto/common.pb.cc
+PROTO_HDRS := src/proto/cluster.pb.h src/proto/model.pb.h src/proto/common.pb.h
+PROTO_OBJS := src/proto/cluster.pb.o src/proto/model.pb.o src/proto/common.pb.o
SINGA_SRCS := src/utils/cluster.cc \
src/utils/cluster_rt.cc \
@@ -30,7 +30,7 @@ SINGA_SRCS := src/utils/cluster.cc \
src/neuralnet/neuralnet.cc \
src/neuralnet/layer.cc \
src/communication/socket.cc \
- src/communication/msg.cc
+ src/communication/msg.cc
SINGA_HDRS := include/utils/cluster.h \
include/utils/cluster_rt.h \
@@ -57,7 +57,7 @@ SINGA_HDRS := include/utils/cluster.h \
include/mshadow/tensor_base.h \
include/mshadow/tensor_random.h \
include/communication/msg.h \
- include/communication/socket.h
+ include/communication/socket.h
SINGA_OBJS := src/proto/cluster.pb.o \
src/proto/model.pb.o \
@@ -78,13 +78,13 @@ SINGA_OBJS := src/proto/cluster.pb.o \
src/neuralnet/neuralnet.o \
src/neuralnet/layer.o \
src/communication/socket.o \
- src/communication/msg.o
+ src/communication/msg.o
lib_LTLIBRARIES = libsinga.la
libsinga_la_SOURCES = $(PROTO_HDRS) $(PROTO_SRCS) $(SINGA_SRCS) $(SINGA_HDRS)
libsinga_la_CXXFLAGS = -O3 -Wall -pthread -fPIC -std=c++11 -Wno-unknown-pragmas \
- $(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops -gdwarf-2 -gstrict-dwarf -Woverloaded-virtual -DTHREADED -fpermissive
-libsinga_la_LDFLAGS = -I./include
+ $(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops -gdwarf-2 -gstrict-dwarf -Woverloaded-virtual -DTHREADED -fpermissive
+libsinga_la_LDFLAGS = -I./include
lib_LTLIBRARIES += libsingashard.la
libsingashard_la_SOURCES = src/utils/data_shard.cc \
@@ -97,7 +97,7 @@ libsingashard_la_CXXFLAGS = -O3 -Wall -pthread -fPIC -std=c++11 -Wno-unknown-pra
$(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops -gdwarf-2 -gstrict-dwarf -Woverloaded-virtual
libsingashard_la_LDFLAGS = -I./include
-bin_PROGRAMS=singa
+bin_PROGRAMS=singa
singa_SOURCES=src/main.cc
singa_CXXFLAGS = -O3 -Wall -pthread -fPIC -std=c++11 -MMD -Wno-unknown-pragmas \
$(MSHADOW_FLAGS) -DCPU_ONLY=1 -funroll-loops -DTHREADED -fpermissive
@@ -117,7 +117,7 @@ singa_LDFLAGS = -I./include \
-lzookeeper_mt
clean-local:
- rm -rf $(PROTO_SRCS) $(PROTO_HDRS)
+ rm -rf $(PROTO_SRCS) $(PROTO_HDRS)
$(PROTO_HDRS) $(PROTO_SRCS): $(PROTOS)