diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a700f273..9c3253ba5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ endif() project(Caffe C CXX) # ---[ Caffe version -set(CAFFE_TARGET_VERSION "1.0.0-rc3" CACHE STRING "Caffe logical version") -set(CAFFE_TARGET_SOVERSION "1.0.0-rc3" CACHE STRING "Caffe soname version") +set(CAFFE_TARGET_VERSION "1.1.0" CACHE STRING "Caffe logical version") +set(CAFFE_TARGET_SOVERSION "1.1.0" CACHE STRING "Caffe soname version") add_definitions(-DCAFFE_VERSION=${CAFFE_TARGET_VERSION}) # ---[ Using cmake scripts and modules @@ -26,7 +26,7 @@ include(cmake/Summary.cmake) include(cmake/ConfigGen.cmake) # ---[ Options -caffe_option(CPU_ONLY "Build Caffe without CUDA support" OFF) # TODO: rename to USE_CUDA +caffe_option(CPU_ONLY "Build Caffe without CUDA support" ON) # TODO: rename to USE_CUDA caffe_option(USE_OPENMP "Build Caffe with OpenMP support" ON ) caffe_option(USE_CUDNN "Build Caffe with cuDNN library support" ON IF NOT CPU_ONLY) caffe_option(USE_MKL2017_AS_DEFAULT_ENGINE "Use MKL2017 primitives for supported layers" OFF) diff --git a/Makefile b/Makefile index 22575b4b1..5e9d16ad5 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,9 @@ else OTHER_BUILD_DIR := $(DEBUG_BUILD_DIR) endif +ifeq ($(CAFFE_PER_LAYER_TIMINGS), 1) + COMMON_FLAGS += -DCAFFE_PER_LAYER_TIMINGS +endif #################### MLSL #################### @@ -71,17 +74,12 @@ endif RETURN_STRING=$(shell ./external/mlsl/prepare_mlsl.sh) MLSL_ROOT=$(firstword $(RETURN_STRING)) - MLSL_LDFLAGS=$(lastword $(RETURN_STRING)) + MLSL_LDFLAGS:=-l$(lastword $(RETURN_STRING)) -Wl,-rpath,$(MLSL_ROOT)/intel64/lib COMMON_FLAGS += -DUSE_MLSL=1 LIBRARIES += mlsl INCLUDE_DIRS += $(MLSL_ROOT)/intel64/include LIBRARY_DIRS += $(MLSL_ROOT)/intel64/lib - IGNORE := $(shell bash -c "source $(MLSL_ROOT)/intel64/bin/mlslvars.sh; env | sed 's/=/:=/' | sed 's/^/export /' > make_mlsl_env") - include make_mlsl_env - -ifeq ($(CAFFE_PER_LAYER_TIMINGS), 1) - COMMON_FLAGS += -DCAFFE_PER_LAYER_TIMINGS -endif + COMMON_FLAGS += -DFOUNDED_MLSL_ROOT=$(MLSL_ROOT) ifeq ($(CAFFE_MLSL_SHUFFLE), 1) COMMON_FLAGS += -DCAFFE_MLSL_SHUFFLE @@ -103,8 +101,8 @@ LIBRARY_NAME := $(PROJECT) LIB_BUILD_DIR := $(BUILD_DIR)/lib STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a DYNAMIC_VERSION_MAJOR := 1 -DYNAMIC_VERSION_MINOR := 0 -DYNAMIC_VERSION_REVISION := 0-rc3 +DYNAMIC_VERSION_MINOR := 1 +DYNAMIC_VERSION_REVISION := 0 DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so #DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR) DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION) @@ -336,6 +334,9 @@ endif ifdef CUSTOM_CXX CXX := $(CUSTOM_CXX) endif +ifdef CUSTOM_CC + CC := $(CUSTOM_CC) +endif # Linux ifeq ($(LINUX), 1) @@ -492,6 +493,11 @@ ifeq ($(DISABLE_BN_FOLDING), 1) COMMON_FLAGS += -DDISABLE_BN_FOLDING endif +# Disable the conv/eltwise/relu layer fusion +ifeq ($(DISABLE_CONV_SUM_FUSION), 1) + COMMON_FLAGS += -DDISABLE_CONV_SUM_FUSION +endif + # Performance monitoring ifeq ($(PERFORMANCE_MONITORING), 1) CXXFLAGS += -DPERFORMANCE_MONITORING @@ -772,7 +778,7 @@ $(ALL_BUILD_DIRS): | $(BUILD_DIR_LINK) $(DYNAMIC_NAME): $(OBJS) | $(LIB_BUILD_DIR) @ echo LD -o $@ - $(Q)$(CXX) -shared -o $@ $(OBJS) $(VERSIONFLAGS) $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_SHARED_HARDENING_FLAGS) $(LDFLAGS) + $(Q)$(CXX) -shared -o $@ $(OBJS) $(VERSIONFLAGS) $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MLSL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_SHARED_HARDENING_FLAGS) $(LDFLAGS) @ cd $(BUILD_DIR)/lib; rm -f $(DYNAMIC_NAME_SHORT); ln -s $(DYNAMIC_VERSIONED_NAME_SHORT) $(DYNAMIC_NAME_SHORT) $(STATIC_NAME): $(OBJS) | $(LIB_BUILD_DIR) @@ -804,7 +810,7 @@ $(TEST_ALL_BIN): $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJS) \ | $(DYNAMIC_NAME) $(TEST_BIN_DIR) @ echo CXX/LD -o $@ $< $(Q)$(CXX) -std=c++11 $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJS) \ - -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib + -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MLSL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib $(TEST_CU_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CU_BUILD_DIR)/%.o \ $(GTEST_OBJS) | $(DYNAMIC_NAME) $(TEST_BIN_DIR) @@ -816,7 +822,7 @@ $(TEST_CXX_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CXX_BUILD_DIR)/%.o \ $(GTEST_OBJS) | $(DYNAMIC_NAME) $(TEST_BIN_DIR) @ echo LD $< $(Q)$(CXX) -std=c++11 $(TEST_MAIN_SRC) $< $(GTEST_OBJS) \ - -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib + -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MLSL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) $(LDFLAGS) -l$(LIBRARY_NAME) -Wl,-rpath,$(ORIGIN)/../lib # Target for extension-less symlinks to tool binaries with extension '*.bin'. $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR) @@ -825,12 +831,12 @@ $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR) $(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME) @ echo CXX/LD -o $@ - $(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \ + $(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MLSL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \ -Wl,-rpath,$(ORIGIN)/../lib $(EXAMPLE_BINS): %.bin : %.o | $(DYNAMIC_NAME) @ echo CXX/LD -o $@ - $(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \ + $(Q)$(CXX) $< -o $@ $(BOOST_LDFLAGS) $(LINKFLAGS) $(MKL_LDFLAGS) $(MLSL_LDFLAGS) $(MKLDNN_LDFLAGS) $(DLCP_LDFLAGS) $(CXX_HARDENING_FLAGS) $(LINKER_EXEC_HARDENING_FLAGS) -l$(LIBRARY_NAME) $(LDFLAGS) \ -Wl,-rpath,$(ORIGIN)/../../lib proto: $(PROTO_GEN_CC) $(PROTO_GEN_HEADER) diff --git a/Makefile.config.example b/Makefile.config.example index b552ca458..ce18c5cd2 100644 --- a/Makefile.config.example +++ b/Makefile.config.example @@ -76,8 +76,11 @@ USE_MKLDNN_AS_DEFAULT_ENGINE := 1 # already. # BOOST_ROOT := -# Use remove batch norm optimization to boost inferrence +# Use remove batch norm optimization to boost inference DISABLE_BN_FOLDING := 0 + +#Use conv/eltwise/relu layer fusion to boost inference. +DISABLE_CONV_SUM_FUSION := 0 # Intel(r) Machine Learning Scaling Library (uncomment to build # with MLSL for multi-node training) # USE_MLSL :=1 diff --git a/Makefile.dlcp b/Makefile.dlcp index c0a180327..fc239b957 100644 --- a/Makefile.dlcp +++ b/Makefile.dlcp @@ -42,6 +42,7 @@ endif endif ifeq ($(USE_MLSL), 1) +ifneq ($(ENABLE_WEIGHT_GRAD_COMPRESSION), 0) ifeq ($(origin DLCPROOT), environment) dlcp: dlcproot_set else @@ -53,6 +54,10 @@ dlcp: endif endif else +dlcp: + @echo "disabling weight grad compression if ENABLE_WEIGHT_GRAD_COMPRESSION is set to 0" +endif +else dlcp: @echo "disabling weight grad compression if USE_MLSL is not 1" endif diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index bd0127afc..732218865 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -94,6 +94,10 @@ if(USE_OPENCV) add_definitions(-DUSE_OPENCV) endif() +if(CAFFE_PER_LAYER_TIMINGS) + add_definitions("-DCAFFE_PER_LAYER_TIMINGS") +endif() + # ---[ MLSL if(USE_MLSL) if (NOT CPU_ONLY) @@ -116,13 +120,11 @@ if(USE_MLSL) endif() message(STATUS "Machine Learning Scaling Library (MLSL) found (${MLSL_ROOT}/intel64)") add_definitions("-DUSE_MLSL=1") + add_definitions("-DFOUNDED_MLSL_ROOT=${MLSL_ROOT}") include_directories(SYSTEM "${MLSL_ROOT}/intel64/include") link_directories(SYSTEM "${MLSL_ROOT}/intel64/lib") list(APPEND Caffe_LINKER_LIBS mlsl) - if(CAFFE_PER_LAYER_TIMINGS) - add_definitions("-DCAFFE_PER_LAYER_TIMINGS") - endif() if(CAFFE_MLSL_SHUFFLE) add_definitions("-DCAFFE_MLSL_SHUFFLE") endif() @@ -134,28 +136,30 @@ endif() # ---| DLCP if(USE_MLSL) - if(DEFINED ENV{DLCPROOT}) - set(DLCPROOT_DIR $ENV{DLCPROOT}) - if(NOT ${DLCPROOT_DIR} STREQUAL "") - set(DLCPROOT_INCLUDE_DIR "${DLCPROOT_DIR}/include/") - set(DLCPROOT_LIB_DIR "${DLCPROOT_DIR}/lib/") - if(EXISTS ${DLCPROOT_INCLUDE_DIR}/dl_compression.h AND EXISTS ${DLCPROOT_LIB_DIR}/libdlcomp.so) - message(STATUS "Found DLCP: ${DLCPROOT_DIR}") + if (ENABLE_WEIGHT_GRAD_COMPRESSION OR NOT DEFINED ENABLE_WEIGHT_GRAD_COMPRESSION) + if(DEFINED ENV{DLCPROOT}) + set(DLCPROOT_DIR $ENV{DLCPROOT}) + if(NOT ${DLCPROOT_DIR} STREQUAL "") + set(DLCPROOT_INCLUDE_DIR "${DLCPROOT_DIR}/include/") + set(DLCPROOT_LIB_DIR "${DLCPROOT_DIR}/lib/") + if(EXISTS ${DLCPROOT_INCLUDE_DIR}/dl_compression.h AND EXISTS ${DLCPROOT_LIB_DIR}/libdlcomp.so) + message(STATUS "Found DLCP: ${DLCPROOT_DIR}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_WEIGHT_GRAD_COMPRESSION") + list(APPEND Caffe_LINKER_LIBS "${DLCPROOT_LIB_DIR}/libdlcomp.so") + include_directories(SYSTEM ${DLCP_INCLUDE_DIR}) + else() + message(STATUS "DLCP not found. DLCP_INCLUDE_DIR = ${DLCPROOT_INCLUDE_DIR} DLCP_LIB_DIR = ${DLCPROOT_LIB_DIR}") + message(WARNING "weight grad compression is disabled.") + endif() + endif() + else() + Download_DLCP() + if(DLCP_CXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_WEIGHT_GRAD_COMPRESSION") - list(APPEND Caffe_LINKER_LIBS "${DLCPROOT_LIB_DIR}/libdlcomp.so") - include_directories(SYSTEM ${DLCP_INCLUDE_DIR}) - else() - message(STATUS "DLCP not found. DLCP_INCLUDE_DIR = ${DLCPROOT_INCLUDE_DIR} DLCP_LIB_DIR = ${DLCPROOT_LIB_DIR}") - message(WARNING "weight grad compression is disabled.") + list(APPEND Caffe_LINKER_LIBS "${DLCP_LIBDIR}/libdlcomp.so") + include_directories(SYSTEM ${DLCP_INCLDIR}) endif() endif() - else() - Download_DLCP() - if(DLCP_CXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_WEIGHT_GRAD_COMPRESSION") - list(APPEND Caffe_LINKER_LIBS "${DLCP_LIBDIR}/libdlcomp.so") - include_directories(SYSTEM ${DLCP_INCLDIR}) - endif() endif() endif() diff --git a/cmake/Misc.cmake b/cmake/Misc.cmake index 0657ee1e9..eaff48f7f 100644 --- a/cmake/Misc.cmake +++ b/cmake/Misc.cmake @@ -10,6 +10,12 @@ if(DISABLE_BN_FOLDING) message(STATUS "Bn folding is disabled!") add_definitions("-DDISABLE_BN_FOLDING") endif() + +if(DISABLE_CONV_SUM_FUSION) + message(STATUS "conv/eltwise/relu fusion is disabled!") + add_definitions("-DDISABLE_CONV_SUM_FUSION") +endif() + # --[ If user doesn't specify build type then assume release if("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Release) diff --git a/docker/README.md b/docker/README.md index adb893282..f945feabb 100644 --- a/docker/README.md +++ b/docker/README.md @@ -17,7 +17,7 @@ docker run -ti caffe:cpu caffe --version ``` which should show a message like: ``` -caffe version 1.0.0-rc3 +caffe version 1.1.0 ``` One can also build and run the Caffe tests in the image using: diff --git a/examples/pycaffe/tune_model.py b/examples/pycaffe/tune_model.py index 628adf9c0..cf2bd6334 100644 --- a/examples/pycaffe/tune_model.py +++ b/examples/pycaffe/tune_model.py @@ -10,7 +10,13 @@ def genOptimalModel(net, mkldnn_direct_time_map, mkldnn_winograd_time_map, optim for index in range(0, len(net.layer)): l = net.layer[index] if l.type == "Convolution": - if mkldnn_winograd_time_map[l.name] < mkldnn_direct_time_map[l.name]: + if len(l.convolution_param.kernel_size) == 0: + continue + kernel_size = l.convolution_param.kernel_size[0] + stride = 1 + if len(l.convolution_param.stride) != 0: + stride = l.convolution_param.stride[0] + if mkldnn_winograd_time_map[l.name] < mkldnn_direct_time_map[l.name] and kernel_size == 3 and stride == 1 and l.convolution_param.num_output % 16 ==0: l.convolution_param.conv_algorithm = "winograd" else: l.convolution_param.conv_algorithm = "direct" diff --git a/external/mkl/prepare_mkl.sh b/external/mkl/prepare_mkl.sh index d05340e44..f69e79423 100755 --- a/external/mkl/prepare_mkl.sh +++ b/external/mkl/prepare_mkl.sh @@ -74,12 +74,11 @@ echo $VERSION_LINE # Return Version Line # MKL DST=`dirname $0` OMP=0 -VERSION_MATCH=20171007 -ARCHIVE_BASENAME=mklml_lnx_2018.0.1.20171007.tgz +VERSION_MATCH=20171227 +ARCHIVE_BASENAME=mklml_lnx_2018.0.1.20171227.tgz MKL_CONTENT_DIR=`echo $ARCHIVE_BASENAME | rev | cut -d "." -f 2- | rev` -GITHUB_RELEASE_TAG=1.0.6 -MKLURL="https://github.com/intel/caffe/releases/download/$GITHUB_RELEASE_TAG/$ARCHIVE_BASENAME" +MKLURL="https://github.com/01org/mkl-dnn/releases/download/v0.12/$ARCHIVE_BASENAME" # there are diffrent MKL lib to be used for GCC and for ICC reg='^[0-9]+$' VERSION_LINE=`GetVersionName $MKLROOT` diff --git a/include/caffe/filler.hpp b/include/caffe/filler.hpp index a2b5fb2c5..8a966ba24 100644 --- a/include/caffe/filler.hpp +++ b/include/caffe/filler.hpp @@ -230,7 +230,7 @@ template class MSRAFiller : public Filler { FillerParameter_VarianceNorm_FAN_OUT) { n = fan_out; } - Dtype std = sqrt(Dtype(2) / n); + Dtype std = this->filler_param_.scale() * sqrt(Dtype(2) / n); caffe_rng_gaussian(blob->count(), Dtype(0), std, blob->mutable_cpu_data()); CHECK_EQ(this->filler_param_.sparse(), -1) diff --git a/include/caffe/layers/base_conv_layer.hpp b/include/caffe/layers/base_conv_layer.hpp index 00a819920..59cb1bf28 100755 --- a/include/caffe/layers/base_conv_layer.hpp +++ b/include/caffe/layers/base_conv_layer.hpp @@ -63,8 +63,9 @@ class BaseConvolutionLayer : public Layer { virtual inline int MinBottomBlobs() const { return 1; } virtual inline int MinTopBlobs() const { return 1; } +#ifdef DISABLE_CONV_SUM_FUSION virtual inline bool EqualNumBottomTopBlobs() const { return true; } - +#endif protected: // Split Reshape into two parts // Part 1 for normal blob reshape diff --git a/include/caffe/layers/mkldnn_layers.hpp b/include/caffe/layers/mkldnn_layers.hpp index 19bcee9da..659b8bcf8 100644 --- a/include/caffe/layers/mkldnn_layers.hpp +++ b/include/caffe/layers/mkldnn_layers.hpp @@ -59,12 +59,38 @@ using namespace mkldnn; namespace caffe { +// ===== Log functions ============================================== +template +inline void info_mem_pd(shared_ptr mem_pd, string name) { +#ifdef DEBUG + LOG(INFO) << name; + // format of mem_pd + switch (mem_pd->desc().data.format) { + case memory::format::nchw: LOG(INFO) << "format: nchw"; break; + case memory::format::nhwc: LOG(INFO) << "format: nhwc"; break; + case memory::format::nChw8c: LOG(INFO) << "format: nChw8c"; break; + case memory::format::nChw16c: LOG(INFO) << "format: nChw16c"; break; + case memory::format::nc: LOG(INFO) << "format: nc"; break; + default: assert(!"Error format"); + } + // data_type + switch (mem_pd->desc().data.data_type) { + case memory::data_type::f32: LOG(INFO) << "data_type: f32"; break; + case memory::data_type::u8: LOG(INFO) << "data_type: u8"; break; + case memory::data_type::s8: LOG(INFO) << "data_type: s8"; break; + case memory::data_type::s32: LOG(INFO) << "data_type: s32"; break; + default: assert(!"Error data_type"); + } +#endif +} + + // ===== MKLDNNBatchNormLayer ======================================= template class MKLDNNBatchNormLayer : public MKLDNNLayer, public Layer { public: explicit MKLDNNBatchNormLayer(const LayerParameter& param) - : Layer(param) + : MKLDNNLayer(param), Layer(param) , fwd_top_data(), fwd_bottom_data() , bwd_top_diff(), bwd_bottom_diff() , BatchNormFwd_pd(), BatchNormBwd_pd() @@ -270,6 +296,12 @@ class MKLDNNLRNLayer : public MKLDNNLayer , public Layer { MKLDNNPrimitive lrnFwd; MKLDNNPrimitive lrnBwd; shared_ptr bottom_md; + + int fl; + float scale; + shared_ptr buffer; + MKLDNNPrimitive lrn_reorder; + shared_ptr fwd_top_data_memory, bwd_bottom_diff_memory, scratch_memory; shared_ptr fwd_bottom_data_primitive, bwd_top_diff_primitive; Dtype alpha_, beta_, k_; @@ -284,7 +316,7 @@ template class MKLDNNPoolingLayer : public MKLDNNLayer, public Layer { public: explicit MKLDNNPoolingLayer(const LayerParameter& param) - : MKLDNNLayer(), Layer(param) + : MKLDNNLayer(param), Layer(param) , fwd_bottom_data(), fwd_top_data() , bwd_top_diff(), bwd_bottom_diff() , poolingFwd_pd() @@ -359,7 +391,7 @@ class MKLDNNReLULayer : public MKLDNNLayer , public NeuronLayer { * the value @f$ \nu @f$ by which negative values are multiplied. */ explicit MKLDNNReLULayer(const LayerParameter& param) - : MKLDNNLayer(), NeuronLayer(param) + : MKLDNNLayer(param), NeuronLayer(param) , fwd_top_data(), fwd_bottom_data() , bwd_top_diff(), bwd_bottom_diff() , reluFwd_pd(), reluBwd_pd() @@ -387,13 +419,13 @@ class MKLDNNReLULayer : public MKLDNNLayer , public NeuronLayer { void InitReLUBwd(const vector*>& top, const vector& propagate_down , const vector*>& bottom); - shared_ptr > fwd_top_data, fwd_bottom_data; + shared_ptr > fwd_top_data, fwd_bottom_data, bwd_bottom_data; shared_ptr > bwd_top_diff, bwd_bottom_diff; shared_ptr reluFwd_pd; shared_ptr reluBwd_pd; MKLDNNPrimitive reluFwd, reluBwd; shared_ptr fwd_top_data_memory, bwd_bottom_diff_memory; - shared_ptr fwd_bottom_data_primitive, bwd_top_diff_primitive; + shared_ptr fwd_bottom_data_primitive, bwd_top_diff_primitive, bwd_bottom_data_primitive; int32_t num_, width_, height_, channels_; PERFORMANCE_EVENT_ID_DECL(perf_id_fw_); @@ -405,7 +437,7 @@ template class MKLDNNConcatLayer : public MKLDNNLayer , public Layer { public: explicit MKLDNNConcatLayer(const LayerParameter& param) - : MKLDNNLayer(), Layer(param), + : MKLDNNLayer(param), Layer(param), concatFwd_pd(), fwd_output_memory(), bwd_reorder_input_memory(), bwd_reorder_output_memory(), fwd_top_data(), fwd_bottom_data(), split_dims() { @@ -454,7 +486,7 @@ template class MKLDNNSplitLayer : public MKLDNNLayer , public Layer { public: explicit MKLDNNSplitLayer(const LayerParameter& param) - : MKLDNNLayer(), Layer(param), + : MKLDNNLayer(param), Layer(param), splitBwd_pd_(), bwd_bottom_diff_memory_() { PERFORMANCE_EVENT_ID_RESET(perf_id_bw_); @@ -494,7 +526,7 @@ template class MKLDNNEltwiseLayer : public MKLDNNLayer , public Layer { public: explicit MKLDNNEltwiseLayer(const LayerParameter& param) - : MKLDNNLayer(), Layer(param) + : MKLDNNLayer(param), Layer(param) , fwd_top_data(), fwd_bottom_data() , eltwiseFwd_pd() , fwd_top_data_memory() diff --git a/include/caffe/mkldnn_base.hpp b/include/caffe/mkldnn_base.hpp index 6e7c11b29..dc726c73d 100644 --- a/include/caffe/mkldnn_base.hpp +++ b/include/caffe/mkldnn_base.hpp @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "caffe/common.hpp" #include "caffe/util/math_functions.hpp" #include "mkldnn.hpp" +#include "caffe/quant/base_quant_layer.hpp" using namespace mkldnn; @@ -192,9 +193,9 @@ class StreamHolder // ===== MKLDNNLayer ======================================= template -class MKLDNNLayer { +class MKLDNNLayer : public BaseQuantLayer { public: - explicit MKLDNNLayer() {} + explicit MKLDNNLayer(const LayerParameter ¶m); virtual ~MKLDNNLayer() {} protected: bool reshape; diff --git a/include/caffe/mkldnn_memory.hpp b/include/caffe/mkldnn_memory.hpp index 597ab95df..850028ff5 100644 --- a/include/caffe/mkldnn_memory.hpp +++ b/include/caffe/mkldnn_memory.hpp @@ -60,7 +60,17 @@ class MKLDNNMemoryDescriptorBase : public PrvMemDescr public: MKLDNNMemoryDescriptorBase(shared_ptr usr_memory_pd , shared_ptr prv_memory_pd - , Blob* blob, MKLDNNLayer* mkldnn_layer); + , Blob* blob, MKLDNNLayer* mkldnn_layer + , std::vectorfl=std::vector(1,0) + , bool is_sum=false); + + MKLDNNMemoryDescriptorBase(shared_ptr usr_memory_pd + , shared_ptr prv_memory_pd + , Blob* blob, MKLDNNLayer* mkldnn_layer + , bool is_float + , std::vectorscale=std::vector(1,1.) + , bool is_sum=false); + ~MKLDNNMemoryDescriptorBase() {} // ---- PrvMemDescr virtual functions ----- @@ -99,6 +109,20 @@ class MKLDNNMemoryDescriptorBase : public PrvMemDescr shared_ptr reorder_prv2usr() { return _reorder_prv2usr.aprimitive; } shared_ptr reorder_extprv2prv() { return _reorder_extprv2prv.aprimitive; } + float get_scale(int i) { return _scale[i]; } + std::vector get_scale() { return _scale; } + void set_scale(std::vector scale) { _scale.assign(scale.begin(),scale.end());} + + int get_fl(int i) { return _fl[i]; } + std::vector get_fl() { return _fl; } + void set_fl(std::vector fl) { _fl.assign(fl.begin(),fl.end());} + + void set_sum(bool is_sum) { _is_sum = is_sum; } + bool get_sum() { return _is_sum; } + + void set_float(bool is_float) { _is_float = is_float; } + bool get_float() { return _is_float; } + void set_mkldnn_layer(MKLDNNLayer* layer) { _mkldnn_layer = layer; } MKLDNNLayer* mkldnn_layer() const { return _mkldnn_layer; } @@ -130,28 +154,49 @@ class MKLDNNMemoryDescriptorBase : public PrvMemDescr // TODO: may need initialize memory by 0 } } - void set_prv_memory_pd(shared_ptr memory_pd) { + void set_prv_memory_pd(shared_ptr memory_pd, std::vector scale) { _prv_memory_pd = memory_pd; if (_prv_memory_pd && _usr_memory_pd) { check_usr_with_prv_descriptors(); - this->create_reorder_descriptors(); + this->create_reorder_descriptors(scale); } } - void set_extprv_memory_pd(shared_ptr memory_pd) { + + void set_prv_memory_pd(shared_ptr memory_pd, std::vector fl) { + _prv_memory_pd = memory_pd; + if (_prv_memory_pd && _usr_memory_pd) { + check_usr_with_prv_descriptors(); + this->create_reorder_descriptors(fl); + } + } + + void set_extprv_memory_pd(shared_ptr memory_pd, std::vector fl, std::vector fl_ext, bool is_sum) { _extprv_memory_pd = memory_pd; if (_prv_memory_pd && _usr_memory_pd) { check_usr_with_prv_descriptors(); - this->create_reorder_descriptors(); + this->create_reorder_descriptors(fl, fl_ext, is_sum); } } - void set_usr_memory_pd(shared_ptr memory_pd) { - _usr_memory_pd = memory_pd; + + void set_extprv_memory_pd(shared_ptr memory_pd, std::vector scale, std::vector scale_ext, bool is_sum) { + _extprv_memory_pd = memory_pd; if (_prv_memory_pd && _usr_memory_pd) { check_usr_with_prv_descriptors(); - this->create_reorder_descriptors(); + this->create_reorder_descriptors(scale, scale_ext, is_sum); } } - void create_reorder_descriptors(); + + void set_usr_memory_pd(shared_ptr memory_pd, std::vector scale) { + _usr_memory_pd = memory_pd; + } + + void set_usr_memory_pd(shared_ptr memory_pd, std::vector fl) { + _usr_memory_pd = memory_pd; + } + + void create_reorder_descriptors(std::vector scale, std::vectorscale_ext=std::vector(1,1.), bool is_sum=false); + + void create_reorder_descriptors(std::vector fl, std::vectorfl_ext=std::vector(1,0), bool is_sum=false); shared_ptr _usr_memory_pd; shared_ptr _prv_memory_pd; @@ -169,6 +214,10 @@ class MKLDNNMemoryDescriptorBase : public PrvMemDescr MKLDNNLayer* _mkldnn_layer; Blob* _blob; + std::vector _scale = std::vector(1,1.); + std::vector _fl = std::vector(1,0); + bool _is_sum = false; + bool _is_float = false; #ifdef USE_MLSL shared_ptr _mlsl_memory; #endif @@ -179,7 +228,16 @@ class MKLDNNMemoryDescriptor : public MKLDNNMemoryDescriptorBase { public: MKLDNNMemoryDescriptor(shared_ptr usr_memory_pd , shared_ptr prv_memory_pd - , Blob* blob, MKLDNNLayer* mkldnn_layer); + , Blob* blob, MKLDNNLayer* mkldnn_layer + , std::vector fl=std::vector(1,0) + , bool is_sum=false); + + MKLDNNMemoryDescriptor(shared_ptr usr_memory_pd + , shared_ptr prv_memory_pd + , Blob* blob, MKLDNNLayer* mkldnn_layer + , bool is_float + , std::vector scale=std::vector(1,1.) + , bool is_sum=false); virtual void convert_from_prv(void* cpu_ptr); virtual void convert_to_prv(void* cpu_ptr); @@ -218,8 +276,18 @@ class MKLDNNData : public MKLDNNMemoryDescriptor public: MKLDNNData(shared_ptr usr_memory_pd , shared_ptr prv_memory_pd - , Blob* blob, MKLDNNLayer* mkldnn_layer) - : MKLDNNMemoryDescriptor(usr_memory_pd, prv_memory_pd, blob, mkldnn_layer) {} + , Blob* blob, MKLDNNLayer* mkldnn_layer + , std::vector fl=std::vector(1,0) + , bool is_sum=false) + : MKLDNNMemoryDescriptor(usr_memory_pd, prv_memory_pd, blob, mkldnn_layer, fl, is_sum) {} + + MKLDNNData(shared_ptr usr_memory_pd + , shared_ptr prv_memory_pd + , Blob* blob, MKLDNNLayer* mkldnn_layer + , bool is_float + , std::vector scale=std::vector(1,1.) + , bool is_sum=false) + : MKLDNNMemoryDescriptor(usr_memory_pd, prv_memory_pd, blob, mkldnn_layer, is_float, scale, is_sum) {} }; template diff --git a/include/caffe/multinode/mlsl.hpp b/include/caffe/multinode/mlsl.hpp index 9f15a8acf..02360f8c0 100644 --- a/include/caffe/multinode/mlsl.hpp +++ b/include/caffe/multinode/mlsl.hpp @@ -398,9 +398,11 @@ namespace caffe { get_session().commit(); } +#ifdef ENABLE_WEIGHT_GRAD_COMPRESSION inline void set_quantization_param(MLSL::QuantParams *qparams) { MLSL::Environment::GetEnv().SetQuantizationParams(qparams); } +#endif namespace stats { inline void stop() { @@ -478,10 +480,18 @@ namespace caffe { } template void add_parameter_set(int kernelCount, int kernelSize, - bool distributedUpdate = false, MLSL::CompressionType compressType = MLSL::CompressionType::CT_NONE) + bool distributedUpdate = false +#ifdef ENABLE_WEIGHT_GRAD_COMPRESSION + , MLSL::CompressionType compressType = MLSL::CompressionType::CT_NONE +#endif + ) { opRegInfo_->AddParameterSet(kernelCount, kernelSize, detail::dtype(), - distributedUpdate, compressType); + distributedUpdate +#ifdef ENABLE_WEIGHT_GRAD_COMPRESSION + , compressType +#endif + ); } private: MLSL::OperationRegInfo *opRegInfo_{ nullptr }; diff --git a/include/caffe/multinode/multi_solver.hpp b/include/caffe/multinode/multi_solver.hpp index 5c4452aa6..bebab3c6c 100644 --- a/include/caffe/multinode/multi_solver.hpp +++ b/include/caffe/multinode/multi_solver.hpp @@ -111,7 +111,7 @@ class MultiSolver { #endif private: virtual Dtype ForwardBackwardImpl(bool first, bool last); - bool IsSkipWaitGradient(int layer_id); + bool IsSkipSyncGradient(int layer_id); bool WaitGradient(int layer_id); void UpdateGradient(int layer_id); diff --git a/include/caffe/multinode/multi_sync.hpp b/include/caffe/multinode/multi_sync.hpp index 61a79f5a2..969cb53ac 100644 --- a/include/caffe/multinode/multi_sync.hpp +++ b/include/caffe/multinode/multi_sync.hpp @@ -200,6 +200,12 @@ namespace caffe { << " ENABLED" #else << " DISABLED" +#endif + << ", WEIGHT GRADIENT COMPRESSION IS" +#ifdef ENABLE_WEIGHT_GRAD_COMPRESSION + << " ENABLED" +#else + << " DISABLED" #endif << ", SINGLE DB SPLITTING IS" #ifdef CAFFE_MLSL_SHUFFLE diff --git a/include/caffe/net.hpp b/include/caffe/net.hpp index c8e274c6d..f27f24473 100644 --- a/include/caffe/net.hpp +++ b/include/caffe/net.hpp @@ -49,6 +49,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "caffe/layer.hpp" #include "caffe/proto/caffe.pb.h" +#include "caffe/util/benchmark.hpp" + + namespace caffe { /** @@ -304,7 +307,11 @@ class Net { static void CompilationRuleThree(const NetParameter& param, NetParameter* param_compiled); - + /** + * @brief This is rule analyze for conv/elt/relu fusion. + */ + static void CompilationRuleFour(const NetParameter& param, + NetParameter* param_compiled); /** * @brief If find "Conv--BN--Scale" in current network, merge BN and Scale layer into Convolution * layers, this optimization only works in caffe TEST phase now. @@ -331,10 +338,82 @@ class Net { /// @brief return whether NetState state meets NetStateRule rule static bool StateMeetsRule(const NetState& state, const NetStateRule& rule, const string& layer_name); + /** + * @brief Look at the layer activations and parameters to find the maximum + * absolute values. The following layers are considered: Convolution, + * InnerProduct. + * + * @param layer_name The layers that should be quantized to fixed point. + * @param max_in The highest layer input. + * @param max_out The highest layer output. + * @param max_param The highest layer parameter. + * + * For layer parameters, the biases are ignored. + */ + void RangeInLayers(vector* layer_name, vector* max_in, + vector* max_out, vector>* max_param, string scaling); + /** + * @brief Find the maximum value in a blob. + */ + vector FindMax(Blob* blob, bool is_single=true); inline const map& blob_names_index() const { return blob_names_index_; } +#ifdef CAFFE_PER_LAYER_TIMINGS + /* Timers for performance measurements */ + Timer timer; +#ifdef FW_OVERLAP_OPT + Timer wait_timer; +#endif + std::vector forward_time_per_layer; + std::vector backward_time_per_layer; + std::vector update_time_per_layer; + double cleardiffs_time_per_iter; +#ifdef USE_MLSL + std::vector startcomm_time_per_layer; + std::vector waitcomm_time_per_layer; + + std::vector startcomm_start_time_per_layer; + std::vector waitcomm_start_time_per_layer; + std::vector startcomm_stop_time_per_layer; + std::vector waitcomm_stop_time_per_layer; + +#ifdef FW_OVERLAP_OPT + std::vector first_waitcomm_start_time_per_layer; + std::vector first_waitcomm_stop_time_per_layer; + std::vector first_update_start_time_per_layer; + std::vector first_update_stop_time_per_layer; +#endif + +#endif + + std::vector forward_time_per_layer_total; + std::vector backward_time_per_layer_total; + std::vector update_time_per_layer_total; + double cleardiffs_time_per_iter_total; +#ifdef USE_MLSL + std::vector startcomm_time_per_layer_total; + std::vector waitcomm_time_per_layer_total; +#endif + + std::vector forward_start_time_per_layer; + std::vector backward_start_time_per_layer; + std::vector update_start_time_per_layer; + + std::vector forward_stop_time_per_layer; + std::vector backward_stop_time_per_layer; + std::vector update_stop_time_per_layer; + + void InitTimers(); + void ResetTimers(); + void PrintTimers(bool printTotal); + + void PrintPayloadSize(); + void SaveTimeline(); + +#endif /* CAFFE_PER_LAYER_TIMINGS */ + protected: // Helpers for Init. /// @brief Append a new top blob to the net. diff --git a/include/caffe/quant/base_quant_layer.hpp b/include/caffe/quant/base_quant_layer.hpp new file mode 100644 index 000000000..e9deacdd1 --- /dev/null +++ b/include/caffe/quant/base_quant_layer.hpp @@ -0,0 +1,62 @@ +/* +All modification made by Intel Corporation: © 2018 Intel Corporation + +All contributions by the University of California: +Copyright (c) 2014, 2015, The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: +Copyright (c) 2014, 2015, the respective contributors +All rights reserved. +For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md + +A part of the code referenced BVLC CAFFE ristretto branch +For the original code go to https://github.com/pmgysel/caffe + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef CAFFE_BASE_QUANT_LAYER_HPP_ +#define CAFFE_BASE_QUANT_LAYER_HPP_ + +#include "caffe/proto/caffe.pb.h" + +namespace caffe { + +template +class BaseQuantLayer{ + public: + explicit BaseQuantLayer(); + protected: + int bw_params_, bw_layer_in_, bw_layer_out_; + vector fl_params_, fl_layer_in_, fl_layer_out_; + vector scale_params_, scale_in_, scale_out_; + int rounding_, precision_; + bool need_quantize_; + bool is_float_; +}; + +} // namespace caffe + +#endif // CAFFE_BASE_QUANT_LAYER_HPP_ diff --git a/include/caffe/quant/quantization.hpp b/include/caffe/quant/quantization.hpp new file mode 100644 index 000000000..0f2420be1 --- /dev/null +++ b/include/caffe/quant/quantization.hpp @@ -0,0 +1,136 @@ +/* +All modification made by Intel Corporation: © 2018 Intel Corporation + +All contributions by the University of California: +Copyright (c) 2014, 2015, The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: +Copyright (c) 2014, 2015, the respective contributors +All rights reserved. +For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md + +A part of the code referenced BVLC CAFFE ristretto branch +For the original code go to https://github.com/pmgysel/caffe + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef QUANTIZATION_HPP_ +#define QUANTIZATION_HPP_ + +#include "caffe/caffe.hpp" + +using caffe::string; +using caffe::vector; +using caffe::Net; + +/** + * @brief Approximate 32-bit floating point networks. + * + * This is the Ristretto tool. Use it to generate file descriptions of networks + * which use reduced word width arithmetic. + */ +class Quantization { +public: + explicit Quantization(string model, string weights, string model_quantized, + int iterations, string trimming_mode, double error_margin, int score_number, string scaling="single", int detection=0, int power=1); + void QuantizeNet(); +private: + void CheckWritePermissions(const string path); + /** + * @brief Score network. + * @param accuracy Reports the network's accuracy according to + * accuracy_number. + * @param do_stats: Find the maximal values in each layer. + * @param score_number The accuracy layer that matters. + * + * For networks with multiple accuracy layers, set score_number to the + * appropriate value. For example, for BVLC GoogLeNet, use score_number=7. + */ + void RunForwardBatches(const int iterations, Net* caffe_net, + float* accuracy, const bool do_stats = false, const int score_number = 0); // 7 for GoogleNet-V1 + /** + * @brief Quantize convolutional and fully connected layers to dynamic fixed + * point. + * The parameters and layer activations get quantized and the resulting + * network will be tested. + * Find the required number of bits required for parameters and layer + * activations (which might differ from each other). + */ + void Quantize2DynamicFixedPoint(); + + /** + * @brief Change network to dynamic fixed point. + */ + void EditNetDescriptionDynamicFixedPoint(caffe::NetParameter* param, + const string layer_quantize, const string network_part, + const int bw_conv, const int bw_in, const int bw_out); + + vector GetIntegerLengthParams(const string layer_name); + vector GetScaleParams(const string layer_name); + /** + * @brief Find the integer length for dynamic fixed point inputs of a certain + * layer. + */ + int GetIntegerLengthIn(const string layer_name); + float GetScaleIn(const string layer_name); + /** + * @brief Find the integer length for dynamic fixed point outputs of a certain + * layer. + */ + int GetIntegerLengthOut(const string layer_name); + float GetScaleOut(const string layer_name); + + string model_; + string weights_; + string model_quantized_; + int iterations_; + string trimming_mode_; + double error_margin_; + int score_number; + string scaling; + int detection; + int power; + float test_score_baseline_; + // The maximal absolute values of layer inputs, parameters and + // layer outputs. + vector max_in_, max_out_; + vector> max_params_; + + // The integer bits for dynamic fixed point layer inputs, parameters and + // layer outputs. + vector il_in_, il_out_; + vector> il_params_; + + vector scale_in_, scale_out_; + vector> scale_params_; + // The name of the layers that need to be quantized to dynamic fixed point. + vector layer_names_; + // The number of bits used for dynamic fixed point layer inputs, parameters + // and layer outputs. + int bw_in_, bw_conv_params_, bw_fc_params_, bw_out_; +}; + +#endif // QUANTIZATION_HPP_ diff --git a/include/caffe/solver.hpp b/include/caffe/solver.hpp index 5b48287b9..bbbc87944 100644 --- a/include/caffe/solver.hpp +++ b/include/caffe/solver.hpp @@ -44,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "caffe/net.hpp" #include "caffe/solver_factory.hpp" -#include "caffe/util/benchmark.hpp" namespace caffe { @@ -161,36 +160,6 @@ class Solver { void TestAll(); - -#ifdef CAFFE_PER_LAYER_TIMINGS - /* Timers for performance measurements */ - Timer timer; -#ifdef FW_OVERLAP_OPT - Timer wait_timer; -#endif - std::vector forward_time_per_layer; - std::vector backward_time_per_layer; - std::vector update_time_per_layer; - double cleardiffs_time_per_iter; -#ifdef USE_MLSL - std::vector startcomm_time_per_layer; - std::vector waitcomm_time_per_layer; -#endif - - std::vector forward_time_per_layer_total; - std::vector backward_time_per_layer_total; - std::vector update_time_per_layer_total; - double cleardiffs_time_per_iter_total; -#ifdef USE_MLSL - std::vector startcomm_time_per_layer_total; - std::vector waitcomm_time_per_layer_total; -#endif - - void InitTimers(); - void ResetTimers(); - void PrintTimers(bool printTotal); -#endif /* CAFFE_PER_LAYER_TIMINGS */ - protected: string SnapshotFilename(const string extension); string SnapshotToBinaryProto(); diff --git a/include/caffe/util/benchmark.hpp b/include/caffe/util/benchmark.hpp index cc0041643..fa7e36663 100644 --- a/include/caffe/util/benchmark.hpp +++ b/include/caffe/util/benchmark.hpp @@ -54,6 +54,10 @@ class Timer { virtual float MicroSeconds(); virtual float Seconds(); + virtual void InitTime(); + virtual void InitTime(Timer &); + virtual float Duration(); + inline bool initted() { return initted_; } inline bool running() { return running_; } inline bool has_run_at_least_once() { return has_run_at_least_once_; } @@ -68,6 +72,9 @@ class Timer { cudaEvent_t start_gpu_; cudaEvent_t stop_gpu_; #endif + + boost::posix_time::ptime init_cpu_; + boost::posix_time::ptime start_cpu_; boost::posix_time::ptime stop_cpu_; float elapsed_milliseconds_; diff --git a/include/caffe/util/performance.hpp b/include/caffe/util/performance.hpp index 9b9bd0657..28b3e512b 100644 --- a/include/caffe/util/performance.hpp +++ b/include/caffe/util/performance.hpp @@ -77,6 +77,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. performance::monitor.EnableMeasurements(); \ performance::monitor.MarkAsInitialized(); +#define PERFORMANCE_START_RESETTING_MONITOR() \ + performance::monitor.StartResetting(); + +#define PERFORMANCE_STOP_RESETTING_MONITOR() \ + performance::monitor.StopResetting(); + #define PERFORMANCE_MEASUREMENT_END_MKL(prefix) \ do { \ static char name[256]; \ @@ -117,6 +123,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define PERFORMANCE_MEASUREMENT_END_ID(id_name) #define PERFORMANCE_CREATE_MONITOR() #define PERFORMANCE_INIT_MONITOR() +#define PERFORMANCE_START_RESETTING_MONITOR() +#define PERFORMANCE_STOP_RESETTING_MONITOR() #define PERFORMANCE_MEASUREMENT_END_MKL(prefix) #define PERFORMANCE_MEASUREMENT_END_MKL_DETAILED(prefix, suffix) #define PERFORMANCE_MKL_NAME_DETAILED(prefix, suffix) @@ -426,6 +434,7 @@ namespace performance { Map event_name_id_map_; bool are_measurements_enabled_; + bool resetting_; NameVector event_names_; PreciseTime total_non_mkl_time_; @@ -579,6 +588,7 @@ namespace performance { public: Monitor() { + resetting_ = false; events_.reserve(64); PreciseTime::Calibrate(); @@ -607,6 +617,9 @@ namespace performance { total_init_time_ = PreciseTime::GetProcessTime() - total_process_time_; } + void StartResetting() { resetting_ = true; } + void StopResetting() { resetting_ = false; } + unsigned GetEventIdByName(const char *event_name) { if (!are_measurements_enabled_) return PERFORMANCE_EVENT_ID_UNSET; @@ -622,8 +635,12 @@ namespace performance { } void UpdateEventById(unsigned event_id, const Measurement &measurement) { - if (are_measurements_enabled_) - events_[event_id].Update(measurement); + if (are_measurements_enabled_) { + if (resetting_) + events_[event_id] = Event(); + else + events_[event_id].Update(measurement); + } } }; diff --git a/mkldnn.commit b/mkldnn.commit index f28f6c194..4925f6349 100644 --- a/mkldnn.commit +++ b/mkldnn.commit @@ -1 +1 @@ -aab753280e83137ba955f8f19d72cb6aaba545ef +ae00102be506ed0fe2099c6557df2aa88ad57ec1 \ No newline at end of file diff --git a/models/intel_optimized_models/alexnet/solver_dummydata.prototxt b/models/intel_optimized_models/alexnet/solver_dummydata.prototxt new file mode 100644 index 000000000..5c15e565e --- /dev/null +++ b/models/intel_optimized_models/alexnet/solver_dummydata.prototxt @@ -0,0 +1,25 @@ +#This is Intel(R) optimized (in terms of time to train) version of solver for model described in the [AlexNet](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) publication. +#Original solver.prototxt can be found in /models/bvlc_alexnet/ directory of this repository. +#Differences: +#- lr_policy is set to poly instead of step +#- base_lr is decreased to 0.007 +#- max_iter is decreased to 250000 +#- power is set to 0.6 +# +#Top-5 and Top-1 results achieved with this version of solver: +#Top-5: 80.4% +#Top-1: 57.4% +#Training was performed using server equipped with Intel(R) Xeon Phi(TM) CPU 7250 processor. +net: "models/intel_optimized_models/alexnet/train_val_dummydata.prototxt" +test_iter: 1000 +test_interval: 10000 +base_lr: 0.007 +lr_policy: "poly" +power: 0.6 +display: 1 +max_iter: 200 +momentum: 0.9 +weight_decay: 0.0005 +snapshot: 50000 +snapshot_prefix: "models/intel_optimized_models/alexnet/alexnet_train" +solver_mode: CPU diff --git a/models/intel_optimized_models/alexnet/train_val_dummydata.prototxt b/models/intel_optimized_models/alexnet/train_val_dummydata.prototxt new file mode 100644 index 000000000..fc47551c3 --- /dev/null +++ b/models/intel_optimized_models/alexnet/train_val_dummydata.prototxt @@ -0,0 +1,394 @@ +name: "AlexNet" +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TRAIN + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 256 dim: 3 dim: 224 dim: 224 } + shape: { dim: 256 dim: 1 dim: 1 dim: 1 } + } +} +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TEST + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 256 dim: 3 dim: 224 dim: 224 } + shape: { dim: 256 dim: 1 dim: 1 dim: 1 } + } +} + +layer { + name: "conv1" + type: "Convolution" + bottom: "data" + top: "conv1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 11 + stride: 4 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu1" + type: "ReLU" + bottom: "conv1" + top: "conv1" +} +layer { + name: "norm1" + type: "LRN" + bottom: "conv1" + top: "norm1" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "pool1" + type: "Pooling" + bottom: "norm1" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "conv2" + type: "Convolution" + bottom: "pool1" + top: "conv2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 2 + kernel_size: 5 + group: 2 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "relu2" + type: "ReLU" + bottom: "conv2" + top: "conv2" +} +layer { + name: "norm2" + type: "LRN" + bottom: "conv2" + top: "norm2" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "pool2" + type: "Pooling" + bottom: "norm2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "conv3" + type: "Convolution" + bottom: "pool2" + top: "conv3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + pad: 1 + kernel_size: 3 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "relu3" + type: "ReLU" + bottom: "conv3" + top: "conv3" +} +layer { + name: "conv4" + type: "Convolution" + bottom: "conv3" + top: "conv4" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + pad: 1 + kernel_size: 3 + group: 2 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "relu4" + type: "ReLU" + bottom: "conv4" + top: "conv4" +} +layer { + name: "conv5" + type: "Convolution" + bottom: "conv4" + top: "conv5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + group: 2 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "relu5" + type: "ReLU" + bottom: "conv5" + top: "conv5" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "fc6" + type: "InnerProduct" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 4096 + weight_filler { + type: "gaussian" + std: 0.005 + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "InnerProduct" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 4096 + weight_filler { + type: "gaussian" + std: 0.005 + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc8" + type: "InnerProduct" + bottom: "fc7" + top: "fc8" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "fc8" + bottom: "label" + top: "loss" +} +layer { + name: "loss3/top-1" + type: "Accuracy" + bottom: "fc8" + bottom: "label" + top: "loss3/top-1" + include { + phase: TEST + } +} +layer { + name: "loss3/top-5" + type: "Accuracy" + bottom: "fc8" + bottom: "label" + top: "loss3/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/googlenet/solver_dummydata.prototxt b/models/intel_optimized_models/googlenet/solver_dummydata.prototxt new file mode 100644 index 000000000..02ce2018a --- /dev/null +++ b/models/intel_optimized_models/googlenet/solver_dummydata.prototxt @@ -0,0 +1,25 @@ +#This is Intel(R) optimized (in terms of time to train) version of solver for model described in the [AlexNet](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) publication. +#Original solver.prototxt can be found in /models/bvlc_alexnet/ directory of this repository. +#Differences: +#- lr_policy is set to poly instead of step +#- base_lr is decreased to 0.007 +#- max_iter is decreased to 250000 +#- power is set to 0.6 +# +#Top-5 and Top-1 results achieved with this version of solver: +#Top-5: 80.4% +#Top-1: 57.4% +#Training was performed using server equipped with Intel(R) Xeon Phi(TM) CPU 7250 processor. +net: "models/intel_optimized_models/googlenet/train_val_dummydata.prototxt" +test_iter: 1000 +test_interval: 10000 +base_lr: 0.007 +lr_policy: "poly" +power: 0.6 +display: 1 +max_iter: 200 +momentum: 0.9 +weight_decay: 0.0005 +snapshot: 50000 +snapshot_prefix: "models/intel_optimized_models/googlenet/googlenet_train" +solver_mode: CPU diff --git a/models/intel_optimized_models/googlenet/train_val_dummydata.prototxt b/models/intel_optimized_models/googlenet/train_val_dummydata.prototxt new file mode 100644 index 000000000..bf411dfe7 --- /dev/null +++ b/models/intel_optimized_models/googlenet/train_val_dummydata.prototxt @@ -0,0 +1,2427 @@ +name: "GoogleNet" +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TRAIN + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 64 dim: 3 dim: 224 dim: 224 } + shape: { dim: 64 dim: 1 dim: 1 dim: 1 } + } +} + +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TEST + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 32 dim: 3 dim: 224 dim: 224 } + shape: { dim: 32 dim: 1 dim: 1 dim: 1 } + } +} + +layer { + name: "conv1/7x7_s2" + type: "Convolution" + bottom: "data" + top: "conv1/7x7_s2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "conv1/relu_7x7" + type: "ReLU" + bottom: "conv1/7x7_s2" + top: "conv1/7x7_s2" +} +layer { + name: "pool1/3x3_s2" + type: "Pooling" + bottom: "conv1/7x7_s2" + top: "pool1/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "pool1/norm1" + type: "LRN" + bottom: "pool1/3x3_s2" + top: "pool1/norm1" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "conv2/3x3_reduce" + type: "Convolution" + bottom: "pool1/norm1" + top: "conv2/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "conv2/relu_3x3_reduce" + type: "ReLU" + bottom: "conv2/3x3_reduce" + top: "conv2/3x3_reduce" +} +layer { + name: "conv2/3x3" + type: "Convolution" + bottom: "conv2/3x3_reduce" + top: "conv2/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "conv2/relu_3x3" + type: "ReLU" + bottom: "conv2/3x3" + top: "conv2/3x3" +} +layer { + name: "conv2/norm2" + type: "LRN" + bottom: "conv2/3x3" + top: "conv2/norm2" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "pool2/3x3_s2" + type: "Pooling" + bottom: "conv2/norm2" + top: "pool2/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_3a/1x1" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_1x1" + type: "ReLU" + bottom: "inception_3a/1x1" + top: "inception_3a/1x1" +} +layer { + name: "inception_3a/3x3_reduce" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_3a/3x3_reduce" + top: "inception_3a/3x3_reduce" +} +layer { + name: "inception_3a/3x3" + type: "Convolution" + bottom: "inception_3a/3x3_reduce" + top: "inception_3a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_3x3" + type: "ReLU" + bottom: "inception_3a/3x3" + top: "inception_3a/3x3" +} +layer { + name: "inception_3a/5x5_reduce" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 16 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_3a/5x5_reduce" + top: "inception_3a/5x5_reduce" +} +layer { + name: "inception_3a/5x5" + type: "Convolution" + bottom: "inception_3a/5x5_reduce" + top: "inception_3a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_5x5" + type: "ReLU" + bottom: "inception_3a/5x5" + top: "inception_3a/5x5" +} +layer { + name: "inception_3a/pool" + type: "Pooling" + bottom: "pool2/3x3_s2" + top: "inception_3a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_3a/pool_proj" + type: "Convolution" + bottom: "inception_3a/pool" + top: "inception_3a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_pool_proj" + type: "ReLU" + bottom: "inception_3a/pool_proj" + top: "inception_3a/pool_proj" +} +layer { + name: "inception_3a/output" + type: "Concat" + bottom: "inception_3a/1x1" + bottom: "inception_3a/3x3" + bottom: "inception_3a/5x5" + bottom: "inception_3a/pool_proj" + top: "inception_3a/output" +} +layer { + name: "inception_3b/1x1" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_1x1" + type: "ReLU" + bottom: "inception_3b/1x1" + top: "inception_3b/1x1" +} +layer { + name: "inception_3b/3x3_reduce" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_3b/3x3_reduce" + top: "inception_3b/3x3_reduce" +} +layer { + name: "inception_3b/3x3" + type: "Convolution" + bottom: "inception_3b/3x3_reduce" + top: "inception_3b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_3x3" + type: "ReLU" + bottom: "inception_3b/3x3" + top: "inception_3b/3x3" +} +layer { + name: "inception_3b/5x5_reduce" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_3b/5x5_reduce" + top: "inception_3b/5x5_reduce" +} +layer { + name: "inception_3b/5x5" + type: "Convolution" + bottom: "inception_3b/5x5_reduce" + top: "inception_3b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_5x5" + type: "ReLU" + bottom: "inception_3b/5x5" + top: "inception_3b/5x5" +} +layer { + name: "inception_3b/pool" + type: "Pooling" + bottom: "inception_3a/output" + top: "inception_3b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_3b/pool_proj" + type: "Convolution" + bottom: "inception_3b/pool" + top: "inception_3b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_pool_proj" + type: "ReLU" + bottom: "inception_3b/pool_proj" + top: "inception_3b/pool_proj" +} +layer { + name: "inception_3b/output" + type: "Concat" + bottom: "inception_3b/1x1" + bottom: "inception_3b/3x3" + bottom: "inception_3b/5x5" + bottom: "inception_3b/pool_proj" + top: "inception_3b/output" +} +layer { + name: "pool3/3x3_s2" + type: "Pooling" + bottom: "inception_3b/output" + top: "pool3/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_4a/1x1" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_1x1" + type: "ReLU" + bottom: "inception_4a/1x1" + top: "inception_4a/1x1" +} +layer { + name: "inception_4a/3x3_reduce" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4a/3x3_reduce" + top: "inception_4a/3x3_reduce" +} +layer { + name: "inception_4a/3x3" + type: "Convolution" + bottom: "inception_4a/3x3_reduce" + top: "inception_4a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 208 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_3x3" + type: "ReLU" + bottom: "inception_4a/3x3" + top: "inception_4a/3x3" +} +layer { + name: "inception_4a/5x5_reduce" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 16 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4a/5x5_reduce" + top: "inception_4a/5x5_reduce" +} +layer { + name: "inception_4a/5x5" + type: "Convolution" + bottom: "inception_4a/5x5_reduce" + top: "inception_4a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 48 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_5x5" + type: "ReLU" + bottom: "inception_4a/5x5" + top: "inception_4a/5x5" +} +layer { + name: "inception_4a/pool" + type: "Pooling" + bottom: "pool3/3x3_s2" + top: "inception_4a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4a/pool_proj" + type: "Convolution" + bottom: "inception_4a/pool" + top: "inception_4a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_pool_proj" + type: "ReLU" + bottom: "inception_4a/pool_proj" + top: "inception_4a/pool_proj" +} +layer { + name: "inception_4a/output" + type: "Concat" + bottom: "inception_4a/1x1" + bottom: "inception_4a/3x3" + bottom: "inception_4a/5x5" + bottom: "inception_4a/pool_proj" + top: "inception_4a/output" +} +layer { + name: "loss1/ave_pool" + type: "Pooling" + bottom: "inception_4a/output" + top: "loss1/ave_pool" + pooling_param { + pool: AVE + kernel_size: 5 + stride: 3 + } +} +layer { + name: "loss1/conv" + type: "Convolution" + bottom: "loss1/ave_pool" + top: "loss1/conv" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss1/relu_conv" + type: "ReLU" + bottom: "loss1/conv" + top: "loss1/conv" +} +layer { + name: "loss1/fc" + type: "InnerProduct" + bottom: "loss1/conv" + top: "loss1/fc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1024 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss1/relu_fc" + type: "ReLU" + bottom: "loss1/fc" + top: "loss1/fc" +} +layer { + name: "loss1/drop_fc" + type: "Dropout" + bottom: "loss1/fc" + top: "loss1/fc" + dropout_param { + dropout_ratio: 0.7 + } +} +layer { + name: "loss1/classifier" + type: "InnerProduct" + bottom: "loss1/fc" + top: "loss1/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss1/loss" + type: "SoftmaxWithLoss" + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/loss1" + loss_weight: 0.3 +} +layer { + name: "loss1/top-1" + type: "Accuracy" + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/top-1" + include { + phase: TEST + } +} +layer { + name: "loss1/top-5" + type: "Accuracy" + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} +layer { + name: "inception_4b/1x1" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_1x1" + type: "ReLU" + bottom: "inception_4b/1x1" + top: "inception_4b/1x1" +} +layer { + name: "inception_4b/3x3_reduce" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 112 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4b/3x3_reduce" + top: "inception_4b/3x3_reduce" +} +layer { + name: "inception_4b/3x3" + type: "Convolution" + bottom: "inception_4b/3x3_reduce" + top: "inception_4b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 224 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_3x3" + type: "ReLU" + bottom: "inception_4b/3x3" + top: "inception_4b/3x3" +} +layer { + name: "inception_4b/5x5_reduce" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4b/5x5_reduce" + top: "inception_4b/5x5_reduce" +} +layer { + name: "inception_4b/5x5" + type: "Convolution" + bottom: "inception_4b/5x5_reduce" + top: "inception_4b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_5x5" + type: "ReLU" + bottom: "inception_4b/5x5" + top: "inception_4b/5x5" +} +layer { + name: "inception_4b/pool" + type: "Pooling" + bottom: "inception_4a/output" + top: "inception_4b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4b/pool_proj" + type: "Convolution" + bottom: "inception_4b/pool" + top: "inception_4b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_pool_proj" + type: "ReLU" + bottom: "inception_4b/pool_proj" + top: "inception_4b/pool_proj" +} +layer { + name: "inception_4b/output" + type: "Concat" + bottom: "inception_4b/1x1" + bottom: "inception_4b/3x3" + bottom: "inception_4b/5x5" + bottom: "inception_4b/pool_proj" + top: "inception_4b/output" +} +layer { + name: "inception_4c/1x1" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_1x1" + type: "ReLU" + bottom: "inception_4c/1x1" + top: "inception_4c/1x1" +} +layer { + name: "inception_4c/3x3_reduce" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4c/3x3_reduce" + top: "inception_4c/3x3_reduce" +} +layer { + name: "inception_4c/3x3" + type: "Convolution" + bottom: "inception_4c/3x3_reduce" + top: "inception_4c/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_3x3" + type: "ReLU" + bottom: "inception_4c/3x3" + top: "inception_4c/3x3" +} +layer { + name: "inception_4c/5x5_reduce" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4c/5x5_reduce" + top: "inception_4c/5x5_reduce" +} +layer { + name: "inception_4c/5x5" + type: "Convolution" + bottom: "inception_4c/5x5_reduce" + top: "inception_4c/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_5x5" + type: "ReLU" + bottom: "inception_4c/5x5" + top: "inception_4c/5x5" +} +layer { + name: "inception_4c/pool" + type: "Pooling" + bottom: "inception_4b/output" + top: "inception_4c/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4c/pool_proj" + type: "Convolution" + bottom: "inception_4c/pool" + top: "inception_4c/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_pool_proj" + type: "ReLU" + bottom: "inception_4c/pool_proj" + top: "inception_4c/pool_proj" +} +layer { + name: "inception_4c/output" + type: "Concat" + bottom: "inception_4c/1x1" + bottom: "inception_4c/3x3" + bottom: "inception_4c/5x5" + bottom: "inception_4c/pool_proj" + top: "inception_4c/output" +} +layer { + name: "inception_4d/1x1" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 112 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_1x1" + type: "ReLU" + bottom: "inception_4d/1x1" + top: "inception_4d/1x1" +} +layer { + name: "inception_4d/3x3_reduce" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 144 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4d/3x3_reduce" + top: "inception_4d/3x3_reduce" +} +layer { + name: "inception_4d/3x3" + type: "Convolution" + bottom: "inception_4d/3x3_reduce" + top: "inception_4d/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 288 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_3x3" + type: "ReLU" + bottom: "inception_4d/3x3" + top: "inception_4d/3x3" +} +layer { + name: "inception_4d/5x5_reduce" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4d/5x5_reduce" + top: "inception_4d/5x5_reduce" +} +layer { + name: "inception_4d/5x5" + type: "Convolution" + bottom: "inception_4d/5x5_reduce" + top: "inception_4d/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_5x5" + type: "ReLU" + bottom: "inception_4d/5x5" + top: "inception_4d/5x5" +} +layer { + name: "inception_4d/pool" + type: "Pooling" + bottom: "inception_4c/output" + top: "inception_4d/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4d/pool_proj" + type: "Convolution" + bottom: "inception_4d/pool" + top: "inception_4d/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_pool_proj" + type: "ReLU" + bottom: "inception_4d/pool_proj" + top: "inception_4d/pool_proj" +} +layer { + name: "inception_4d/output" + type: "Concat" + bottom: "inception_4d/1x1" + bottom: "inception_4d/3x3" + bottom: "inception_4d/5x5" + bottom: "inception_4d/pool_proj" + top: "inception_4d/output" +} +layer { + name: "loss2/ave_pool" + type: "Pooling" + bottom: "inception_4d/output" + top: "loss2/ave_pool" + pooling_param { + pool: AVE + kernel_size: 5 + stride: 3 + } +} +layer { + name: "loss2/conv" + type: "Convolution" + bottom: "loss2/ave_pool" + top: "loss2/conv" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss2/relu_conv" + type: "ReLU" + bottom: "loss2/conv" + top: "loss2/conv" +} +layer { + name: "loss2/fc" + type: "InnerProduct" + bottom: "loss2/conv" + top: "loss2/fc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1024 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss2/relu_fc" + type: "ReLU" + bottom: "loss2/fc" + top: "loss2/fc" +} +layer { + name: "loss2/drop_fc" + type: "Dropout" + bottom: "loss2/fc" + top: "loss2/fc" + dropout_param { + dropout_ratio: 0.7 + } +} +layer { + name: "loss2/classifier" + type: "InnerProduct" + bottom: "loss2/fc" + top: "loss2/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss2/loss" + type: "SoftmaxWithLoss" + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/loss1" + loss_weight: 0.3 +} +layer { + name: "loss2/top-1" + type: "Accuracy" + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/top-1" + include { + phase: TEST + } +} +layer { + name: "loss2/top-5" + type: "Accuracy" + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} +layer { + name: "inception_4e/1x1" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_1x1" + type: "ReLU" + bottom: "inception_4e/1x1" + top: "inception_4e/1x1" +} +layer { + name: "inception_4e/3x3_reduce" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4e/3x3_reduce" + top: "inception_4e/3x3_reduce" +} +layer { + name: "inception_4e/3x3" + type: "Convolution" + bottom: "inception_4e/3x3_reduce" + top: "inception_4e/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 320 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_3x3" + type: "ReLU" + bottom: "inception_4e/3x3" + top: "inception_4e/3x3" +} +layer { + name: "inception_4e/5x5_reduce" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4e/5x5_reduce" + top: "inception_4e/5x5_reduce" +} +layer { + name: "inception_4e/5x5" + type: "Convolution" + bottom: "inception_4e/5x5_reduce" + top: "inception_4e/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_5x5" + type: "ReLU" + bottom: "inception_4e/5x5" + top: "inception_4e/5x5" +} +layer { + name: "inception_4e/pool" + type: "Pooling" + bottom: "inception_4d/output" + top: "inception_4e/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4e/pool_proj" + type: "Convolution" + bottom: "inception_4e/pool" + top: "inception_4e/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_pool_proj" + type: "ReLU" + bottom: "inception_4e/pool_proj" + top: "inception_4e/pool_proj" +} +layer { + name: "inception_4e/output" + type: "Concat" + bottom: "inception_4e/1x1" + bottom: "inception_4e/3x3" + bottom: "inception_4e/5x5" + bottom: "inception_4e/pool_proj" + top: "inception_4e/output" +} +layer { + name: "pool4/3x3_s2" + type: "Pooling" + bottom: "inception_4e/output" + top: "pool4/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_5a/1x1" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_1x1" + type: "ReLU" + bottom: "inception_5a/1x1" + top: "inception_5a/1x1" +} +layer { + name: "inception_5a/3x3_reduce" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_5a/3x3_reduce" + top: "inception_5a/3x3_reduce" +} +layer { + name: "inception_5a/3x3" + type: "Convolution" + bottom: "inception_5a/3x3_reduce" + top: "inception_5a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 320 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_3x3" + type: "ReLU" + bottom: "inception_5a/3x3" + top: "inception_5a/3x3" +} +layer { + name: "inception_5a/5x5_reduce" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_5a/5x5_reduce" + top: "inception_5a/5x5_reduce" +} +layer { + name: "inception_5a/5x5" + type: "Convolution" + bottom: "inception_5a/5x5_reduce" + top: "inception_5a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_5x5" + type: "ReLU" + bottom: "inception_5a/5x5" + top: "inception_5a/5x5" +} +layer { + name: "inception_5a/pool" + type: "Pooling" + bottom: "pool4/3x3_s2" + top: "inception_5a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_5a/pool_proj" + type: "Convolution" + bottom: "inception_5a/pool" + top: "inception_5a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_pool_proj" + type: "ReLU" + bottom: "inception_5a/pool_proj" + top: "inception_5a/pool_proj" +} +layer { + name: "inception_5a/output" + type: "Concat" + bottom: "inception_5a/1x1" + bottom: "inception_5a/3x3" + bottom: "inception_5a/5x5" + bottom: "inception_5a/pool_proj" + top: "inception_5a/output" +} +layer { + name: "inception_5b/1x1" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_1x1" + type: "ReLU" + bottom: "inception_5b/1x1" + top: "inception_5b/1x1" +} +layer { + name: "inception_5b/3x3_reduce" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_5b/3x3_reduce" + top: "inception_5b/3x3_reduce" +} +layer { + name: "inception_5b/3x3" + type: "Convolution" + bottom: "inception_5b/3x3_reduce" + top: "inception_5b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_3x3" + type: "ReLU" + bottom: "inception_5b/3x3" + top: "inception_5b/3x3" +} +layer { + name: "inception_5b/5x5_reduce" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 48 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_5b/5x5_reduce" + top: "inception_5b/5x5_reduce" +} +layer { + name: "inception_5b/5x5" + type: "Convolution" + bottom: "inception_5b/5x5_reduce" + top: "inception_5b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_5x5" + type: "ReLU" + bottom: "inception_5b/5x5" + top: "inception_5b/5x5" +} +layer { + name: "inception_5b/pool" + type: "Pooling" + bottom: "inception_5a/output" + top: "inception_5b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_5b/pool_proj" + type: "Convolution" + bottom: "inception_5b/pool" + top: "inception_5b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_pool_proj" + type: "ReLU" + bottom: "inception_5b/pool_proj" + top: "inception_5b/pool_proj" +} +layer { + name: "inception_5b/output" + type: "Concat" + bottom: "inception_5b/1x1" + bottom: "inception_5b/3x3" + bottom: "inception_5b/5x5" + bottom: "inception_5b/pool_proj" + top: "inception_5b/output" +} +layer { + name: "pool5/7x7_s1" + type: "Pooling" + bottom: "inception_5b/output" + top: "pool5/7x7_s1" + pooling_param { + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + name: "pool5/drop_7x7_s1" + type: "Dropout" + bottom: "pool5/7x7_s1" + top: "pool5/7x7_s1" + dropout_param { + dropout_ratio: 0.4 + } +} +layer { + name: "loss3/classifier" + type: "InnerProduct" + bottom: "pool5/7x7_s1" + top: "loss3/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss3/loss3" + type: "SoftmaxWithLoss" + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/loss3" + loss_weight: 1 +} +layer { + name: "loss3/top-1" + type: "Accuracy" + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/top-1" + include { + phase: TEST + } +} +layer { + name: "loss3/top-5" + type: "Accuracy" + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/googlenet_v2/solver_dummydata.prototxt b/models/intel_optimized_models/googlenet_v2/solver_dummydata.prototxt new file mode 100644 index 000000000..9162b472c --- /dev/null +++ b/models/intel_optimized_models/googlenet_v2/solver_dummydata.prototxt @@ -0,0 +1,25 @@ +#This is Intel(R) optimized (in terms of time to train) version of solver for model described in the [AlexNet](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) publication. +#Original solver.prototxt can be found in /models/bvlc_alexnet/ directory of this repository. +#Differences: +#- lr_policy is set to poly instead of step +#- base_lr is decreased to 0.007 +#- max_iter is decreased to 250000 +#- power is set to 0.6 +# +#Top-5 and Top-1 results achieved with this version of solver: +#Top-5: 80.4% +#Top-1: 57.4% +#Training was performed using server equipped with Intel(R) Xeon Phi(TM) CPU 7250 processor. +net: "models/intel_optimized_models/googlenet_v2/train_val_dummydata.prototxt" +test_iter: 1000 +test_interval: 10000 +base_lr: 0.007 +lr_policy: "poly" +power: 0.6 +display: 1 +max_iter: 5000 +momentum: 0.9 +weight_decay: 0.0005 +snapshot: 50000 +snapshot_prefix: "models/intel_optimized_models/googlenet_v2/googlenet_train" +solver_mode: CPU diff --git a/models/intel_optimized_models/googlenet_v2/train_val_dummydata.prototxt b/models/intel_optimized_models/googlenet_v2/train_val_dummydata.prototxt new file mode 100644 index 000000000..2908c3841 --- /dev/null +++ b/models/intel_optimized_models/googlenet_v2/train_val_dummydata.prototxt @@ -0,0 +1,4034 @@ +# Inception Network (GoogLeNet Batch Normalization Network) +name: "InceptionNetwork" +### Training Set +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TRAIN + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 96 dim: 3 dim: 224 dim: 224 } + shape: { dim: 96 dim: 1 dim: 1 dim: 1 } + } +} + +### Validation Set +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TEST + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 32 dim: 3 dim: 224 dim: 224 } + shape: { dim: 32 dim: 1 dim: 1 dim: 1 } + } +} + +layer { + bottom: "data" + top: "conv1/7x7_s2" + name: "conv1/7x7_s2" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "conv1/7x7_s2" + name: "conv1/7x7_s2/bn" + top: "conv1/7x7_s2/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "conv1/7x7_s2/bn" + top: "conv1/7x7_s2/bn/sc" + name: "conv1/7x7_s2/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "conv1/7x7_s2/bn/sc" + top: "conv1/7x7_s2/bn/sc" + name: "conv1/7x7_s2/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv1/7x7_s2/bn/sc" + top: "pool1/3x3_s2" + name: "pool1/3x3_s2" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + bottom: "pool1/3x3_s2" + top: "conv2/3x3_reduce" + name: "conv2/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "conv2/3x3_reduce" + name: "conv2/3x3_reduce/bn" + top: "conv2/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "conv2/3x3_reduce/bn" + top: "conv2/3x3_reduce/bn/sc" + name: "conv2/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "conv2/3x3_reduce/bn/sc" + top: "conv2/3x3_reduce/bn/sc" + name: "conv2/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv2/3x3_reduce/bn/sc" + top: "conv2/3x3" + name: "conv2/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "conv2/3x3" + name: "conv2/3x3/bn" + top: "conv2/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "conv2/3x3/bn" + top: "conv2/3x3/bn/sc" + name: "conv2/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "conv2/3x3/bn/sc" + top: "conv2/3x3/bn/sc" + name: "conv2/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv2/3x3/bn/sc" + top: "pool2/3x3_s2" + name: "pool2/3x3_s2" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + bottom: "pool2/3x3_s2" + top: "inception_3a/1x1" + name: "inception_3a/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/1x1" + name: "inception_3a/1x1/bn" + top: "inception_3a/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/1x1/bn" + top: "inception_3a/1x1/bn/sc" + name: "inception_3a/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/1x1/bn/sc" + top: "inception_3a/1x1/bn/sc" + name: "inception_3a/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "pool2/3x3_s2" + top: "inception_3a/3x3_reduce" + name: "inception_3a/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/3x3_reduce" + name: "inception_3a/3x3_reduce/bn" + top: "inception_3a/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/3x3_reduce/bn" + top: "inception_3a/3x3_reduce/bn/sc" + name: "inception_3a/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/3x3_reduce/bn/sc" + top: "inception_3a/3x3_reduce/bn/sc" + name: "inception_3a/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/3x3_reduce/bn/sc" + top: "inception_3a/3x3" + name: "inception_3a/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/3x3" + name: "inception_3a/3x3/bn" + top: "inception_3a/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/3x3/bn" + top: "inception_3a/3x3/bn/sc" + name: "inception_3a/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/3x3/bn/sc" + top: "inception_3a/3x3/bn/sc" + name: "inception_3a/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "pool2/3x3_s2" + top: "inception_3a/double3x3_reduce" + name: "inception_3a/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/double3x3_reduce" + name: "inception_3a/double3x3_reduce/bn" + top: "inception_3a/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/double3x3_reduce/bn" + top: "inception_3a/double3x3_reduce/bn/sc" + name: "inception_3a/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/double3x3_reduce/bn/sc" + top: "inception_3a/double3x3_reduce/bn/sc" + name: "inception_3a/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/double3x3_reduce/bn/sc" + top: "inception_3a/double3x3a" + name: "inception_3a/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/double3x3a" + name: "inception_3a/double3x3a/bn" + top: "inception_3a/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/double3x3a/bn" + top: "inception_3a/double3x3a/bn/sc" + name: "inception_3a/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/double3x3a/bn/sc" + top: "inception_3a/double3x3a/bn/sc" + name: "inception_3a/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/double3x3a/bn/sc" + top: "inception_3a/double3x3b" + name: "inception_3a/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/double3x3b" + name: "inception_3a/double3x3b/bn" + top: "inception_3a/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/double3x3b/bn" + top: "inception_3a/double3x3b/bn/sc" + name: "inception_3a/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/double3x3b/bn/sc" + top: "inception_3a/double3x3b/bn/sc" + name: "inception_3a/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "pool2/3x3_s2" + top: "inception_3a/pool" + name: "inception_3a/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_3a/pool" + top: "inception_3a/pool_proj" + name: "inception_3a/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 32 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3a/pool_proj" + name: "inception_3a/pool_proj/bn" + top: "inception_3a/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3a/pool_proj/bn" + top: "inception_3a/pool_proj/bn/sc" + name: "inception_3a/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3a/pool_proj/bn/sc" + top: "inception_3a/pool_proj/bn/sc" + name: "inception_3a/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/1x1/bn/sc" + bottom: "inception_3a/3x3/bn/sc" + bottom: "inception_3a/double3x3b/bn/sc" + bottom: "inception_3a/pool_proj/bn/sc" + top: "inception_3a/output" + name: "inception_3a/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_3a/output" + top: "inception_3b/1x1" + name: "inception_3b/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/1x1" + name: "inception_3b/1x1/bn" + top: "inception_3b/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/1x1/bn" + top: "inception_3b/1x1/bn/sc" + name: "inception_3b/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/1x1/bn/sc" + top: "inception_3b/1x1/bn/sc" + name: "inception_3b/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/output" + top: "inception_3b/3x3_reduce" + name: "inception_3b/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/3x3_reduce" + name: "inception_3b/3x3_reduce/bn" + top: "inception_3b/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/3x3_reduce/bn" + top: "inception_3b/3x3_reduce/bn/sc" + name: "inception_3b/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/3x3_reduce/bn/sc" + top: "inception_3b/3x3_reduce/bn/sc" + name: "inception_3b/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3b/3x3_reduce/bn/sc" + top: "inception_3b/3x3" + name: "inception_3b/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/3x3" + name: "inception_3b/3x3/bn" + top: "inception_3b/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/3x3/bn" + top: "inception_3b/3x3/bn/sc" + name: "inception_3b/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/3x3/bn/sc" + top: "inception_3b/3x3/bn/sc" + name: "inception_3b/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/output" + top: "inception_3b/double3x3_reduce" + name: "inception_3b/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/double3x3_reduce" + name: "inception_3b/double3x3_reduce/bn" + top: "inception_3b/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/double3x3_reduce/bn" + top: "inception_3b/double3x3_reduce/bn/sc" + name: "inception_3b/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/double3x3_reduce/bn/sc" + top: "inception_3b/double3x3_reduce/bn/sc" + name: "inception_3b/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3b/double3x3_reduce/bn/sc" + top: "inception_3b/double3x3a" + name: "inception_3b/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/double3x3a" + name: "inception_3b/double3x3a/bn" + top: "inception_3b/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/double3x3a/bn" + top: "inception_3b/double3x3a/bn/sc" + name: "inception_3b/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/double3x3a/bn/sc" + top: "inception_3b/double3x3a/bn/sc" + name: "inception_3b/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3b/double3x3a/bn/sc" + top: "inception_3b/double3x3b" + name: "inception_3b/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/double3x3b" + name: "inception_3b/double3x3b/bn" + top: "inception_3b/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/double3x3b/bn" + top: "inception_3b/double3x3b/bn/sc" + name: "inception_3b/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/double3x3b/bn/sc" + top: "inception_3b/double3x3b/bn/sc" + name: "inception_3b/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3a/output" + top: "inception_3b/pool" + name: "inception_3b/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_3b/pool" + top: "inception_3b/pool_proj" + name: "inception_3b/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3b/pool_proj" + name: "inception_3b/pool_proj/bn" + top: "inception_3b/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3b/pool_proj/bn" + top: "inception_3b/pool_proj/bn/sc" + name: "inception_3b/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3b/pool_proj/bn/sc" + top: "inception_3b/pool_proj/bn/sc" + name: "inception_3b/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3b/1x1/bn/sc" + bottom: "inception_3b/3x3/bn/sc" + bottom: "inception_3b/double3x3b/bn/sc" + bottom: "inception_3b/pool_proj/bn/sc" + top: "inception_3b/output" + name: "inception_3b/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_3b/output" + top: "inception_3c/3x3_reduce" + name: "inception_3c/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3c/3x3_reduce" + name: "inception_3c/3x3_reduce/bn" + top: "inception_3c/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3c/3x3_reduce/bn" + top: "inception_3c/3x3_reduce/bn/sc" + name: "inception_3c/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3c/3x3_reduce/bn/sc" + top: "inception_3c/3x3_reduce/bn/sc" + name: "inception_3c/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3c/3x3_reduce/bn/sc" + top: "inception_3c/3x3" + name: "inception_3c/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3c/3x3" + name: "inception_3c/3x3/bn" + top: "inception_3c/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3c/3x3/bn" + top: "inception_3c/3x3/bn/sc" + name: "inception_3c/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3c/3x3/bn/sc" + top: "inception_3c/3x3/bn/sc" + name: "inception_3c/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3b/output" + top: "inception_3c/double3x3_reduce" + name: "inception_3c/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3c/double3x3_reduce" + name: "inception_3c/double3x3_reduce/bn" + top: "inception_3c/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3c/double3x3_reduce/bn" + top: "inception_3c/double3x3_reduce/bn/sc" + name: "inception_3c/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3c/double3x3_reduce/bn/sc" + top: "inception_3c/double3x3_reduce/bn/sc" + name: "inception_3c/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3c/double3x3_reduce/bn/sc" + top: "inception_3c/double3x3a" + name: "inception_3c/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3c/double3x3a" + name: "inception_3c/double3x3a/bn" + top: "inception_3c/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3c/double3x3a/bn" + top: "inception_3c/double3x3a/bn/sc" + name: "inception_3c/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3c/double3x3a/bn/sc" + top: "inception_3c/double3x3a/bn/sc" + name: "inception_3c/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3c/double3x3a/bn/sc" + top: "inception_3c/double3x3b" + name: "inception_3c/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_3c/double3x3b" + name: "inception_3c/double3x3b/bn" + top: "inception_3c/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_3c/double3x3b/bn" + top: "inception_3c/double3x3b/bn/sc" + name: "inception_3c/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_3c/double3x3b/bn/sc" + top: "inception_3c/double3x3b/bn/sc" + name: "inception_3c/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3b/output" + top: "inception_3c/pool" + name: "inception_3c/pool" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + bottom: "inception_3c/3x3/bn/sc" + bottom: "inception_3c/double3x3b/bn/sc" + bottom: "inception_3c/pool" + top: "inception_3c/output" + name: "inception_3c/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_3c/output" + top: "pool3/5x5_s3" + name: "pool3/5x5_s3" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 5 + stride: 3 + } +} +layer { + bottom: "pool3/5x5_s3" + top: "loss1/conv" + name: "loss1/conv" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "loss1/conv" + name: "loss1/conv/bn" + top: "loss1/conv/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "loss1/conv/bn" + top: "loss1/conv/bn/sc" + name: "loss1/conv/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "loss1/conv/bn/sc" + top: "loss1/conv/bn/sc" + name: "loss1/conv/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "loss1/conv/bn/sc" + top: "loss1/fc" + name: "loss1/fc" + type: "InnerProduct" + param { + lr_mult: 1 + decay_mult: 1 + } + inner_product_param { + num_output: 1024 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "loss1/fc" + name: "loss1/fc/bn" + top: "loss1/fc/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "loss1/fc/bn" + top: "loss1/fc/bn/sc" + name: "loss1/fc/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "loss1/fc/bn/sc" + top: "loss1/fc/bn/sc" + name: "loss1/fc/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "loss1/fc/bn/sc" + top: "loss1/classifier" + name: "loss1/classifier" + type: "InnerProduct" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/loss" + name: "loss1/loss" + type: "SoftmaxWithLoss" + loss_weight: 0.3 +} +layer { + bottom: "loss1/classifier" + top: "loss1/prob" + name: "loss1/prob" + type: "Softmax" + include { + phase: TEST + } +} +layer { + bottom: "loss1/prob" + bottom: "label" + top: "loss1/top-1" + name: "loss1/top-1" + type: "Accuracy" + include { + phase: TEST + } +} +layer { + bottom: "loss1/prob" + bottom: "label" + top: "loss1/top-5" + name: "loss1/top-5" + type: "Accuracy" + accuracy_param { + top_k: 5 + } + include { + phase: TEST + } +} +layer { + bottom: "inception_3c/output" + top: "inception_4a/1x1" + name: "inception_4a/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 224 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/1x1" + name: "inception_4a/1x1/bn" + top: "inception_4a/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/1x1/bn" + top: "inception_4a/1x1/bn/sc" + name: "inception_4a/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/1x1/bn/sc" + top: "inception_4a/1x1/bn/sc" + name: "inception_4a/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3c/output" + top: "inception_4a/3x3_reduce" + name: "inception_4a/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 64 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/3x3_reduce" + name: "inception_4a/3x3_reduce/bn" + top: "inception_4a/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/3x3_reduce/bn" + top: "inception_4a/3x3_reduce/bn/sc" + name: "inception_4a/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/3x3_reduce/bn/sc" + top: "inception_4a/3x3_reduce/bn/sc" + name: "inception_4a/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/3x3_reduce/bn/sc" + top: "inception_4a/3x3" + name: "inception_4a/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/3x3" + name: "inception_4a/3x3/bn" + top: "inception_4a/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/3x3/bn" + top: "inception_4a/3x3/bn/sc" + name: "inception_4a/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/3x3/bn/sc" + top: "inception_4a/3x3/bn/sc" + name: "inception_4a/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3c/output" + top: "inception_4a/double3x3_reduce" + name: "inception_4a/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/double3x3_reduce" + name: "inception_4a/double3x3_reduce/bn" + top: "inception_4a/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/double3x3_reduce/bn" + top: "inception_4a/double3x3_reduce/bn/sc" + name: "inception_4a/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/double3x3_reduce/bn/sc" + top: "inception_4a/double3x3_reduce/bn/sc" + name: "inception_4a/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/double3x3_reduce/bn/sc" + top: "inception_4a/double3x3a" + name: "inception_4a/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/double3x3a" + name: "inception_4a/double3x3a/bn" + top: "inception_4a/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/double3x3a/bn" + top: "inception_4a/double3x3a/bn/sc" + name: "inception_4a/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/double3x3a/bn/sc" + top: "inception_4a/double3x3a/bn/sc" + name: "inception_4a/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/double3x3a/bn/sc" + top: "inception_4a/double3x3b" + name: "inception_4a/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/double3x3b" + name: "inception_4a/double3x3b/bn" + top: "inception_4a/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/double3x3b/bn" + top: "inception_4a/double3x3b/bn/sc" + name: "inception_4a/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/double3x3b/bn/sc" + top: "inception_4a/double3x3b/bn/sc" + name: "inception_4a/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_3c/output" + top: "inception_4a/pool" + name: "inception_4a/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_4a/pool" + top: "inception_4a/pool_proj" + name: "inception_4a/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4a/pool_proj" + name: "inception_4a/pool_proj/bn" + top: "inception_4a/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4a/pool_proj/bn" + top: "inception_4a/pool_proj/bn/sc" + name: "inception_4a/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4a/pool_proj/bn/sc" + top: "inception_4a/pool_proj/bn/sc" + name: "inception_4a/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/1x1/bn/sc" + bottom: "inception_4a/3x3/bn/sc" + bottom: "inception_4a/double3x3b/bn/sc" + bottom: "inception_4a/pool_proj/bn/sc" + top: "inception_4a/output" + name: "inception_4a/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_4a/output" + top: "inception_4b/1x1" + name: "inception_4b/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/1x1" + name: "inception_4b/1x1/bn" + top: "inception_4b/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/1x1/bn" + top: "inception_4b/1x1/bn/sc" + name: "inception_4b/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/1x1/bn/sc" + top: "inception_4b/1x1/bn/sc" + name: "inception_4b/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/output" + top: "inception_4b/3x3_reduce" + name: "inception_4b/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/3x3_reduce" + name: "inception_4b/3x3_reduce/bn" + top: "inception_4b/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/3x3_reduce/bn" + top: "inception_4b/3x3_reduce/bn/sc" + name: "inception_4b/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/3x3_reduce/bn/sc" + top: "inception_4b/3x3_reduce/bn/sc" + name: "inception_4b/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/3x3_reduce/bn/sc" + top: "inception_4b/3x3" + name: "inception_4b/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/3x3" + name: "inception_4b/3x3/bn" + top: "inception_4b/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/3x3/bn" + top: "inception_4b/3x3/bn/sc" + name: "inception_4b/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/3x3/bn/sc" + top: "inception_4b/3x3/bn/sc" + name: "inception_4b/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/output" + top: "inception_4b/double3x3_reduce" + name: "inception_4b/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/double3x3_reduce" + name: "inception_4b/double3x3_reduce/bn" + top: "inception_4b/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/double3x3_reduce/bn" + top: "inception_4b/double3x3_reduce/bn/sc" + name: "inception_4b/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/double3x3_reduce/bn/sc" + top: "inception_4b/double3x3_reduce/bn/sc" + name: "inception_4b/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/double3x3_reduce/bn/sc" + top: "inception_4b/double3x3a" + name: "inception_4b/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/double3x3a" + name: "inception_4b/double3x3a/bn" + top: "inception_4b/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/double3x3a/bn" + top: "inception_4b/double3x3a/bn/sc" + name: "inception_4b/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/double3x3a/bn/sc" + top: "inception_4b/double3x3a/bn/sc" + name: "inception_4b/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/double3x3a/bn/sc" + top: "inception_4b/double3x3b" + name: "inception_4b/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/double3x3b" + name: "inception_4b/double3x3b/bn" + top: "inception_4b/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/double3x3b/bn" + top: "inception_4b/double3x3b/bn/sc" + name: "inception_4b/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/double3x3b/bn/sc" + top: "inception_4b/double3x3b/bn/sc" + name: "inception_4b/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4a/output" + top: "inception_4b/pool" + name: "inception_4b/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_4b/pool" + top: "inception_4b/pool_proj" + name: "inception_4b/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4b/pool_proj" + name: "inception_4b/pool_proj/bn" + top: "inception_4b/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4b/pool_proj/bn" + top: "inception_4b/pool_proj/bn/sc" + name: "inception_4b/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4b/pool_proj/bn/sc" + top: "inception_4b/pool_proj/bn/sc" + name: "inception_4b/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/1x1/bn/sc" + bottom: "inception_4b/3x3/bn/sc" + bottom: "inception_4b/double3x3b/bn/sc" + bottom: "inception_4b/pool_proj/bn/sc" + top: "inception_4b/output" + name: "inception_4b/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_4b/output" + top: "inception_4c/1x1" + name: "inception_4c/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/1x1" + name: "inception_4c/1x1/bn" + top: "inception_4c/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/1x1/bn" + top: "inception_4c/1x1/bn/sc" + name: "inception_4c/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/1x1/bn/sc" + top: "inception_4c/1x1/bn/sc" + name: "inception_4c/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/output" + top: "inception_4c/3x3_reduce" + name: "inception_4c/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/3x3_reduce" + name: "inception_4c/3x3_reduce/bn" + top: "inception_4c/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/3x3_reduce/bn" + top: "inception_4c/3x3_reduce/bn/sc" + name: "inception_4c/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/3x3_reduce/bn/sc" + top: "inception_4c/3x3_reduce/bn/sc" + name: "inception_4c/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/3x3_reduce/bn/sc" + top: "inception_4c/3x3" + name: "inception_4c/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/3x3" + name: "inception_4c/3x3/bn" + top: "inception_4c/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/3x3/bn" + top: "inception_4c/3x3/bn/sc" + name: "inception_4c/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/3x3/bn/sc" + top: "inception_4c/3x3/bn/sc" + name: "inception_4c/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/output" + top: "inception_4c/double3x3_reduce" + name: "inception_4c/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/double3x3_reduce" + name: "inception_4c/double3x3_reduce/bn" + top: "inception_4c/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/double3x3_reduce/bn" + top: "inception_4c/double3x3_reduce/bn/sc" + name: "inception_4c/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/double3x3_reduce/bn/sc" + top: "inception_4c/double3x3_reduce/bn/sc" + name: "inception_4c/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/double3x3_reduce/bn/sc" + top: "inception_4c/double3x3a" + name: "inception_4c/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/double3x3a" + name: "inception_4c/double3x3a/bn" + top: "inception_4c/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/double3x3a/bn" + top: "inception_4c/double3x3a/bn/sc" + name: "inception_4c/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/double3x3a/bn/sc" + top: "inception_4c/double3x3a/bn/sc" + name: "inception_4c/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/double3x3a/bn/sc" + top: "inception_4c/double3x3b" + name: "inception_4c/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/double3x3b" + name: "inception_4c/double3x3b/bn" + top: "inception_4c/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/double3x3b/bn" + top: "inception_4c/double3x3b/bn/sc" + name: "inception_4c/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/double3x3b/bn/sc" + top: "inception_4c/double3x3b/bn/sc" + name: "inception_4c/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4b/output" + top: "inception_4c/pool" + name: "inception_4c/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_4c/pool" + top: "inception_4c/pool_proj" + name: "inception_4c/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4c/pool_proj" + name: "inception_4c/pool_proj/bn" + top: "inception_4c/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4c/pool_proj/bn" + top: "inception_4c/pool_proj/bn/sc" + name: "inception_4c/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4c/pool_proj/bn/sc" + top: "inception_4c/pool_proj/bn/sc" + name: "inception_4c/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/1x1/bn/sc" + bottom: "inception_4c/3x3/bn/sc" + bottom: "inception_4c/double3x3b/bn/sc" + bottom: "inception_4c/pool_proj/bn/sc" + top: "inception_4c/output" + name: "inception_4c/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_4c/output" + top: "inception_4d/1x1" + name: "inception_4d/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/1x1" + name: "inception_4d/1x1/bn" + top: "inception_4d/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/1x1/bn" + top: "inception_4d/1x1/bn/sc" + name: "inception_4d/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/1x1/bn/sc" + top: "inception_4d/1x1/bn/sc" + name: "inception_4d/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/output" + top: "inception_4d/3x3_reduce" + name: "inception_4d/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/3x3_reduce" + name: "inception_4d/3x3_reduce/bn" + top: "inception_4d/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/3x3_reduce/bn" + top: "inception_4d/3x3_reduce/bn/sc" + name: "inception_4d/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/3x3_reduce/bn/sc" + top: "inception_4d/3x3_reduce/bn/sc" + name: "inception_4d/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4d/3x3_reduce/bn/sc" + top: "inception_4d/3x3" + name: "inception_4d/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/3x3" + name: "inception_4d/3x3/bn" + top: "inception_4d/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/3x3/bn" + top: "inception_4d/3x3/bn/sc" + name: "inception_4d/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/3x3/bn/sc" + top: "inception_4d/3x3/bn/sc" + name: "inception_4d/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/output" + top: "inception_4d/double3x3_reduce" + name: "inception_4d/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/double3x3_reduce" + name: "inception_4d/double3x3_reduce/bn" + top: "inception_4d/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/double3x3_reduce/bn" + top: "inception_4d/double3x3_reduce/bn/sc" + name: "inception_4d/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/double3x3_reduce/bn/sc" + top: "inception_4d/double3x3_reduce/bn/sc" + name: "inception_4d/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4d/double3x3_reduce/bn/sc" + top: "inception_4d/double3x3a" + name: "inception_4d/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/double3x3a" + name: "inception_4d/double3x3a/bn" + top: "inception_4d/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/double3x3a/bn" + top: "inception_4d/double3x3a/bn/sc" + name: "inception_4d/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/double3x3a/bn/sc" + top: "inception_4d/double3x3a/bn/sc" + name: "inception_4d/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4d/double3x3a/bn/sc" + top: "inception_4d/double3x3b" + name: "inception_4d/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/double3x3b" + name: "inception_4d/double3x3b/bn" + top: "inception_4d/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/double3x3b/bn" + top: "inception_4d/double3x3b/bn/sc" + name: "inception_4d/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/double3x3b/bn/sc" + top: "inception_4d/double3x3b/bn/sc" + name: "inception_4d/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4c/output" + top: "inception_4d/pool" + name: "inception_4d/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_4d/pool" + top: "inception_4d/pool_proj" + name: "inception_4d/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 96 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4d/pool_proj" + name: "inception_4d/pool_proj/bn" + top: "inception_4d/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4d/pool_proj/bn" + top: "inception_4d/pool_proj/bn/sc" + name: "inception_4d/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4d/pool_proj/bn/sc" + top: "inception_4d/pool_proj/bn/sc" + name: "inception_4d/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4d/1x1/bn/sc" + bottom: "inception_4d/3x3/bn/sc" + bottom: "inception_4d/double3x3b/bn/sc" + bottom: "inception_4d/pool_proj/bn/sc" + top: "inception_4d/output" + name: "inception_4d/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_4d/output" + top: "inception_4e/3x3_reduce" + name: "inception_4e/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4e/3x3_reduce" + name: "inception_4e/3x3_reduce/bn" + top: "inception_4e/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4e/3x3_reduce/bn" + top: "inception_4e/3x3_reduce/bn/sc" + name: "inception_4e/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4e/3x3_reduce/bn/sc" + top: "inception_4e/3x3_reduce/bn/sc" + name: "inception_4e/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4e/3x3_reduce/bn/sc" + top: "inception_4e/3x3" + name: "inception_4e/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4e/3x3" + name: "inception_4e/3x3/bn" + top: "inception_4e/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4e/3x3/bn" + top: "inception_4e/3x3/bn/sc" + name: "inception_4e/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4e/3x3/bn/sc" + top: "inception_4e/3x3/bn/sc" + name: "inception_4e/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4d/output" + top: "inception_4e/double3x3_reduce" + name: "inception_4e/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4e/double3x3_reduce" + name: "inception_4e/double3x3_reduce/bn" + top: "inception_4e/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4e/double3x3_reduce/bn" + top: "inception_4e/double3x3_reduce/bn/sc" + name: "inception_4e/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4e/double3x3_reduce/bn/sc" + top: "inception_4e/double3x3_reduce/bn/sc" + name: "inception_4e/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4e/double3x3_reduce/bn/sc" + top: "inception_4e/double3x3a" + name: "inception_4e/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4e/double3x3a" + name: "inception_4e/double3x3a/bn" + top: "inception_4e/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4e/double3x3a/bn" + top: "inception_4e/double3x3a/bn/sc" + name: "inception_4e/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4e/double3x3a/bn/sc" + top: "inception_4e/double3x3a/bn/sc" + name: "inception_4e/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4e/double3x3a/bn/sc" + top: "inception_4e/double3x3b" + name: "inception_4e/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_4e/double3x3b" + name: "inception_4e/double3x3b/bn" + top: "inception_4e/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_4e/double3x3b/bn" + top: "inception_4e/double3x3b/bn/sc" + name: "inception_4e/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_4e/double3x3b/bn/sc" + top: "inception_4e/double3x3b/bn/sc" + name: "inception_4e/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4d/output" + top: "inception_4e/pool" + name: "inception_4e/pool" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + bottom: "inception_4e/3x3/bn/sc" + bottom: "inception_4e/double3x3b/bn/sc" + bottom: "inception_4e/pool" + top: "inception_4e/output" + name: "inception_4e/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_4e/output" + top: "pool4/5x5_s3" + name: "pool4/5x5_s3" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 5 + stride: 3 + } +} +layer { + bottom: "pool4/5x5_s3" + top: "loss2/conv" + name: "loss2/conv" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "loss2/conv" + name: "loss2/conv/bn" + top: "loss2/conv/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "loss2/conv/bn" + top: "loss2/conv/bn/sc" + name: "loss2/conv/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "loss2/conv/bn/sc" + top: "loss2/conv/bn/sc" + name: "loss2/conv/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "loss2/conv/bn/sc" + top: "loss2/fc" + name: "loss2/fc" + type: "InnerProduct" + param { + lr_mult: 1 + decay_mult: 1 + } + inner_product_param { + num_output: 1024 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "loss2/fc" + name: "loss2/fc/bn" + top: "loss2/fc/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "loss2/fc/bn" + top: "loss2/fc/bn/sc" + name: "loss2/fc/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "loss2/fc/bn/sc" + top: "loss2/fc/bn/sc" + name: "loss2/fc/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "loss2/fc/bn/sc" + top: "loss2/classifier" + name: "loss2/classifier" + type: "InnerProduct" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/loss" + name: "loss2/loss" + type: "SoftmaxWithLoss" + loss_weight: 0.3 +} +layer { + bottom: "loss2/classifier" + top: "loss2/prob" + name: "loss2/prob" + type: "Softmax" + include { + phase: TEST + } +} +layer { + bottom: "loss2/prob" + bottom: "label" + top: "loss2/top-1" + name: "loss2/top-1" + type: "Accuracy" + include { + phase: TEST + } +} +layer { + bottom: "loss2/prob" + bottom: "label" + top: "loss2/top-5" + name: "loss2/top-5" + type: "Accuracy" + accuracy_param { + top_k: 5 + } + include { + phase: TEST + } +} +layer { + bottom: "inception_4e/output" + top: "inception_5a/1x1" + name: "inception_5a/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 352 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/1x1" + name: "inception_5a/1x1/bn" + top: "inception_5a/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/1x1/bn" + top: "inception_5a/1x1/bn/sc" + name: "inception_5a/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/1x1/bn/sc" + top: "inception_5a/1x1/bn/sc" + name: "inception_5a/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4e/output" + top: "inception_5a/3x3_reduce" + name: "inception_5a/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/3x3_reduce" + name: "inception_5a/3x3_reduce/bn" + top: "inception_5a/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/3x3_reduce/bn" + top: "inception_5a/3x3_reduce/bn/sc" + name: "inception_5a/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/3x3_reduce/bn/sc" + top: "inception_5a/3x3_reduce/bn/sc" + name: "inception_5a/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/3x3_reduce/bn/sc" + top: "inception_5a/3x3" + name: "inception_5a/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 320 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/3x3" + name: "inception_5a/3x3/bn" + top: "inception_5a/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/3x3/bn" + top: "inception_5a/3x3/bn/sc" + name: "inception_5a/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/3x3/bn/sc" + top: "inception_5a/3x3/bn/sc" + name: "inception_5a/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4e/output" + top: "inception_5a/double3x3_reduce" + name: "inception_5a/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 160 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/double3x3_reduce" + name: "inception_5a/double3x3_reduce/bn" + top: "inception_5a/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/double3x3_reduce/bn" + top: "inception_5a/double3x3_reduce/bn/sc" + name: "inception_5a/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/double3x3_reduce/bn/sc" + top: "inception_5a/double3x3_reduce/bn/sc" + name: "inception_5a/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/double3x3_reduce/bn/sc" + top: "inception_5a/double3x3a" + name: "inception_5a/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 224 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/double3x3a" + name: "inception_5a/double3x3a/bn" + top: "inception_5a/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/double3x3a/bn" + top: "inception_5a/double3x3a/bn/sc" + name: "inception_5a/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/double3x3a/bn/sc" + top: "inception_5a/double3x3a/bn/sc" + name: "inception_5a/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/double3x3a/bn/sc" + top: "inception_5a/double3x3b" + name: "inception_5a/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 224 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/double3x3b" + name: "inception_5a/double3x3b/bn" + top: "inception_5a/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/double3x3b/bn" + top: "inception_5a/double3x3b/bn/sc" + name: "inception_5a/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/double3x3b/bn/sc" + top: "inception_5a/double3x3b/bn/sc" + name: "inception_5a/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_4e/output" + top: "inception_5a/pool" + name: "inception_5a/pool" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_5a/pool" + top: "inception_5a/pool_proj" + name: "inception_5a/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5a/pool_proj" + name: "inception_5a/pool_proj/bn" + top: "inception_5a/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5a/pool_proj/bn" + top: "inception_5a/pool_proj/bn/sc" + name: "inception_5a/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5a/pool_proj/bn/sc" + top: "inception_5a/pool_proj/bn/sc" + name: "inception_5a/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/1x1/bn/sc" + bottom: "inception_5a/3x3/bn/sc" + bottom: "inception_5a/double3x3b/bn/sc" + bottom: "inception_5a/pool_proj/bn/sc" + top: "inception_5a/output" + name: "inception_5a/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_5a/output" + top: "inception_5b/1x1" + name: "inception_5b/1x1" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 352 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/1x1" + name: "inception_5b/1x1/bn" + top: "inception_5b/1x1/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/1x1/bn" + top: "inception_5b/1x1/bn/sc" + name: "inception_5b/1x1/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/1x1/bn/sc" + top: "inception_5b/1x1/bn/sc" + name: "inception_5b/1x1/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/output" + top: "inception_5b/3x3_reduce" + name: "inception_5b/3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/3x3_reduce" + name: "inception_5b/3x3_reduce/bn" + top: "inception_5b/3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/3x3_reduce/bn" + top: "inception_5b/3x3_reduce/bn/sc" + name: "inception_5b/3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/3x3_reduce/bn/sc" + top: "inception_5b/3x3_reduce/bn/sc" + name: "inception_5b/3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5b/3x3_reduce/bn/sc" + top: "inception_5b/3x3" + name: "inception_5b/3x3" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 320 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/3x3" + name: "inception_5b/3x3/bn" + top: "inception_5b/3x3/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/3x3/bn" + top: "inception_5b/3x3/bn/sc" + name: "inception_5b/3x3/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/3x3/bn/sc" + top: "inception_5b/3x3/bn/sc" + name: "inception_5b/3x3/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/output" + top: "inception_5b/double3x3_reduce" + name: "inception_5b/double3x3_reduce" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 192 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/double3x3_reduce" + name: "inception_5b/double3x3_reduce/bn" + top: "inception_5b/double3x3_reduce/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/double3x3_reduce/bn" + top: "inception_5b/double3x3_reduce/bn/sc" + name: "inception_5b/double3x3_reduce/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/double3x3_reduce/bn/sc" + top: "inception_5b/double3x3_reduce/bn/sc" + name: "inception_5b/double3x3_reduce/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5b/double3x3_reduce/bn/sc" + top: "inception_5b/double3x3a" + name: "inception_5b/double3x3a" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 224 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/double3x3a" + name: "inception_5b/double3x3a/bn" + top: "inception_5b/double3x3a/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/double3x3a/bn" + top: "inception_5b/double3x3a/bn/sc" + name: "inception_5b/double3x3a/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/double3x3a/bn/sc" + top: "inception_5b/double3x3a/bn/sc" + name: "inception_5b/double3x3a/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5b/double3x3a/bn/sc" + top: "inception_5b/double3x3b" + name: "inception_5b/double3x3b" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 224 + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/double3x3b" + name: "inception_5b/double3x3b/bn" + top: "inception_5b/double3x3b/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/double3x3b/bn" + top: "inception_5b/double3x3b/bn/sc" + name: "inception_5b/double3x3b/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/double3x3b/bn/sc" + top: "inception_5b/double3x3b/bn/sc" + name: "inception_5b/double3x3b/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5a/output" + top: "inception_5b/pool" + name: "inception_5b/pool" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + bottom: "inception_5b/pool" + top: "inception_5b/pool_proj" + name: "inception_5b/pool_proj" + type: "Convolution" + param { + lr_mult: 1 + decay_mult: 1 + } + convolution_param { + + num_output: 128 + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_term: false + } +} +layer { + bottom: "inception_5b/pool_proj" + name: "inception_5b/pool_proj/bn" + top: "inception_5b/pool_proj/bn" + type: "BatchNorm" + batch_norm_param { + + } +} +layer { + bottom: "inception_5b/pool_proj/bn" + top: "inception_5b/pool_proj/bn/sc" + name: "inception_5b/pool_proj/bn/sc" + type: "Scale" + scale_param { + bias_term: true + } +} +layer { + bottom: "inception_5b/pool_proj/bn/sc" + top: "inception_5b/pool_proj/bn/sc" + name: "inception_5b/pool_proj/bn/sc/relu" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "inception_5b/1x1/bn/sc" + bottom: "inception_5b/3x3/bn/sc" + bottom: "inception_5b/double3x3b/bn/sc" + bottom: "inception_5b/pool_proj/bn/sc" + top: "inception_5b/output" + name: "inception_5b/output" + type: "Concat" + concat_param { + + } +} +layer { + bottom: "inception_5b/output" + top: "pool5/7x7_s1" + name: "pool5/7x7_s1" + type: "Pooling" + pooling_param { + + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + bottom: "pool5/7x7_s1" + top: "loss3/classifier" + name: "loss3/classifier" + type: "InnerProduct" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/loss" + name: "loss3/loss" + type: "SoftmaxWithLoss" + loss_weight: 1 +} +layer { + bottom: "loss3/classifier" + top: "loss3/prob" + name: "loss3/prob" + type: "Softmax" + include { + phase: TEST + } +} +layer { + bottom: "loss3/prob" + bottom: "label" + top: "loss3/top-1" + name: "loss3/top-1" + type: "Accuracy" + include { + phase: TEST + } +} +layer { + bottom: "loss3/prob" + bottom: "label" + top: "loss3/top-5" + name: "loss3/top-5" + type: "Accuracy" + accuracy_param { + top_k: 5 + } + include { + phase: TEST + } +} diff --git a/models/intel_optimized_models/int8/inceptionv3_int8.prototxt b/models/intel_optimized_models/int8/inceptionv3_int8.prototxt new file mode 100644 index 000000000..40a810628 --- /dev/null +++ b/models/intel_optimized_models/int8/inceptionv3_int8.prototxt @@ -0,0 +1,4571 @@ +# For INT8 reference +name: "InceptionV3" +layer { + name: "data" + type: "DummyData" + top: "data" + dummy_data_param { + data_filler { + type: "constant" + value: 0.0099999997764825821 + } + shape { + dim: 64 + dim: 3 + dim: 299 + dim: 299 + } + } +} +layer { + name: "data" + type: "DummyData" + top: "label" + dummy_data_param { + data_filler { + type: "constant" + } + shape { + dim: 64 + } + } +} +layer { + name: "conv_conv2d" + type: "Convolution" + bottom: "data" + top: "conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 32 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 2 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } +} +layer { + name: "conv_batchnorm" + type: "BatchNorm" + bottom: "conv_conv2d" + top: "conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "conv_relu" + type: "ReLU" + bottom: "conv_conv2d_bn" + top: "conv_conv2d_relu" +} +layer { + name: "conv_1_1_conv2d" + type: "Convolution" + bottom: "conv_conv2d_relu" + top: "conv_1_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 32 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 75.3399963379 + scale_out: 48.9399986267 + scale_params: 125.419998169 + } +} +layer { + name: "conv_1_1_batchnorm" + type: "BatchNorm" + bottom: "conv_1_1_conv2d" + top: "conv_1_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "conv_1_1_relu" + type: "ReLU" + bottom: "conv_1_1_conv2d_bn" + top: "conv_1_1_conv2d_relu" +} +layer { + name: "conv_2_2_conv2d" + type: "Convolution" + bottom: "conv_1_1_conv2d_relu" + top: "conv_2_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 48.9399986267 + scale_out: 68.1200027466 + scale_params: 238.300003052 + } +} +layer { + name: "conv_2_2_batchnorm" + type: "BatchNorm" + bottom: "conv_2_2_conv2d" + top: "conv_2_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "conv_2_2_relu" + type: "ReLU" + bottom: "conv_2_2_conv2d_bn" + top: "conv_2_2_conv2d_relu" +} +layer { + name: "pool" + type: "Pooling" + bottom: "conv_2_2_conv2d_relu" + top: "pool" + pooling_param { + pool: MAX + pad: 0 + kernel_size: 3 + stride: 2 + } +} +layer { + name: "conv_3_3_conv2d" + type: "Convolution" + bottom: "pool" + top: "conv_3_3_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 80 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 68.1200027466 + scale_out: 74.3199996948 + scale_params: 115.459999084 + } +} +layer { + name: "conv_3_3_batchnorm" + type: "BatchNorm" + bottom: "conv_3_3_conv2d" + top: "conv_3_3_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "conv_3_3_relu" + type: "ReLU" + bottom: "conv_3_3_conv2d_bn" + top: "conv_3_3_conv2d_relu" +} +layer { + name: "conv_4_4_conv2d" + type: "Convolution" + bottom: "conv_3_3_conv2d_relu" + top: "conv_4_4_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 74.3199996948 + scale_out: 124.080001831 + scale_params: 490.480010986 + } +} +layer { + name: "conv_4_4_batchnorm" + type: "BatchNorm" + bottom: "conv_4_4_conv2d" + top: "conv_4_4_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "conv_4_4_relu" + type: "ReLU" + bottom: "conv_4_4_conv2d_bn" + top: "conv_4_4_conv2d_relu" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv_4_4_conv2d_relu" + top: "pool1" + pooling_param { + pool: MAX + pad: 0 + kernel_size: 3 + stride: 2 + } +} +layer { + name: "mixed_conv_conv2d" + type: "Convolution" + bottom: "pool1" + top: "mixed_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 124.080001831 + scale_out: 125.970001221 + scale_params: 239.179992676 + } +} +layer { + name: "mixed_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_conv_conv2d" + top: "mixed_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_conv_relu" + type: "ReLU" + bottom: "mixed_conv_conv2d_bn" + top: "mixed_conv_conv2d_relu" +} +layer { + name: "mixed_tower_conv_conv2d" + type: "Convolution" + bottom: "pool1" + top: "mixed_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 48 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 124.080001831 + scale_out: 159.11000061 + scale_params: 303.589996338 + } +} +layer { + name: "mixed_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_tower_conv_conv2d" + top: "mixed_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_tower_conv_relu" + type: "ReLU" + bottom: "mixed_tower_conv_conv2d_bn" + top: "mixed_tower_conv_conv2d_relu" +} +layer { + name: "mixed_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_tower_conv_conv2d_relu" + top: "mixed_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 2 + kernel_size: 5 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 159.11000061 + scale_out: 139.080001831 + scale_params: 495.859985352 + } +} +layer { + name: "mixed_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_tower_conv_1_conv2d" + top: "mixed_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_tower_conv_1_conv2d_bn" + top: "mixed_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_tower_1_conv_conv2d" + type: "Convolution" + bottom: "pool1" + top: "mixed_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 124.080001831 + scale_out: 146.25 + scale_params: 215.38999939 + } +} +layer { + name: "mixed_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_tower_1_conv_conv2d" + top: "mixed_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_tower_1_conv_conv2d_bn" + top: "mixed_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_tower_1_conv_conv2d_relu" + top: "mixed_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 146.25 + scale_out: 171.210006714 + scale_params: 322.309997559 + } +} +layer { + name: "mixed_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_tower_1_conv_1_conv2d" + top: "mixed_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_tower_1_conv_1_conv2d_bn" + top: "mixed_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_tower_1_conv_1_conv2d_relu" + top: "mixed_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 171.210006714 + scale_out: 116.150001526 + scale_params: 303.209991455 + } +} +layer { + name: "mixed_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_tower_1_conv_2_conv2d" + top: "mixed_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_tower_1_conv_2_conv2d_bn" + top: "mixed_tower_1_conv_2_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_pool" + type: "Pooling" + bottom: "pool1" + top: "AVE_pool_mixed_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_pool" + top: "mixed_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 32 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 164.720001221 + scale_out: 175.770004272 + scale_params: 160.130004883 + } +} +layer { + name: "mixed_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_tower_2_conv_conv2d" + top: "mixed_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_tower_2_conv_conv2d_bn" + top: "mixed_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_chconcat" + type: "Concat" + bottom: "mixed_conv_conv2d_relu" + bottom: "mixed_tower_conv_1_conv2d_relu" + bottom: "mixed_tower_1_conv_2_conv2d_relu" + bottom: "mixed_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_chconcat" + top: "mixed_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 116.150001526 + scale_out: 128.270004272 + scale_params: 229.300003052 + } +} +layer { + name: "mixed_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_conv_conv2d" + top: "mixed_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_conv_relu" + type: "ReLU" + bottom: "mixed_1_conv_conv2d_bn" + top: "mixed_1_conv_conv2d_relu" +} +layer { + name: "mixed_1_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_chconcat" + top: "mixed_1_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 48 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 116.150001526 + scale_out: 97.9100036621 + scale_params: 171.490005493 + } +} +layer { + name: "mixed_1_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_tower_conv_conv2d" + top: "mixed_1_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_tower_conv_relu" + type: "ReLU" + bottom: "mixed_1_tower_conv_conv2d_bn" + top: "mixed_1_tower_conv_conv2d_relu" +} +layer { + name: "mixed_1_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_1_tower_conv_conv2d_relu" + top: "mixed_1_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 2 + kernel_size: 5 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 97.9100036621 + scale_out: 108.839996338 + scale_params: 516.630004883 + } +} +layer { + name: "mixed_1_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_tower_conv_1_conv2d" + top: "mixed_1_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_1_tower_conv_1_conv2d_bn" + top: "mixed_1_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_1_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_chconcat" + top: "mixed_1_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 116.150001526 + scale_out: 155.809997559 + scale_params: 194.460006714 + } +} +layer { + name: "mixed_1_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_tower_1_conv_conv2d" + top: "mixed_1_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_1_tower_1_conv_conv2d_bn" + top: "mixed_1_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_1_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_1_tower_1_conv_conv2d_relu" + top: "mixed_1_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 155.809997559 + scale_out: 202.300003052 + scale_params: 243.229995728 + } +} +layer { + name: "mixed_1_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_tower_1_conv_1_conv2d" + top: "mixed_1_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_1_tower_1_conv_1_conv2d_bn" + top: "mixed_1_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_1_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_1_tower_1_conv_1_conv2d_relu" + top: "mixed_1_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 202.300003052 + scale_out: 106.050003052 + scale_params: 90.2200012207 + } +} +layer { + name: "mixed_1_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_tower_1_conv_2_conv2d" + top: "mixed_1_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_1_tower_1_conv_2_conv2d_bn" + top: "mixed_1_tower_1_conv_2_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_1_pool" + type: "Pooling" + bottom: "ch_concat_mixed_chconcat" + top: "AVE_pool_mixed_1_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_1_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_1_pool" + top: "mixed_1_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 161.210006714 + scale_out: 200.88999939 + scale_params: 146.809997559 + } +} +layer { + name: "mixed_1_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_1_tower_2_conv_conv2d" + top: "mixed_1_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_1_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_1_tower_2_conv_conv2d_bn" + top: "mixed_1_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_1_chconcat" + type: "Concat" + bottom: "mixed_1_conv_conv2d_relu" + bottom: "mixed_1_tower_conv_1_conv2d_relu" + bottom: "mixed_1_tower_1_conv_2_conv2d_relu" + bottom: "mixed_1_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_1_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_2_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_1_chconcat" + top: "mixed_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 106.050003052 + scale_out: 158.509994507 + scale_params: 251.970001221 + } +} +layer { + name: "mixed_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_conv_conv2d" + top: "mixed_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_conv_relu" + type: "ReLU" + bottom: "mixed_2_conv_conv2d_bn" + top: "mixed_2_conv_conv2d_relu" +} +layer { + name: "mixed_2_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_1_chconcat" + top: "mixed_2_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 48 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 106.050003052 + scale_out: 101.940002441 + scale_params: 211.789993286 + } +} +layer { + name: "mixed_2_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_tower_conv_conv2d" + top: "mixed_2_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_tower_conv_relu" + type: "ReLU" + bottom: "mixed_2_tower_conv_conv2d_bn" + top: "mixed_2_tower_conv_conv2d_relu" +} +layer { + name: "mixed_2_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_2_tower_conv_conv2d_relu" + top: "mixed_2_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 2 + kernel_size: 5 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 101.940002441 + scale_out: 124.5 + scale_params: 537.25 + } +} +layer { + name: "mixed_2_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_tower_conv_1_conv2d" + top: "mixed_2_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_2_tower_conv_1_conv2d_bn" + top: "mixed_2_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_2_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_1_chconcat" + top: "mixed_2_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 106.050003052 + scale_out: 160.86000061 + scale_params: 225.440002441 + } +} +layer { + name: "mixed_2_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_tower_1_conv_conv2d" + top: "mixed_2_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_2_tower_1_conv_conv2d_bn" + top: "mixed_2_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_2_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_2_tower_1_conv_conv2d_relu" + top: "mixed_2_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 160.86000061 + scale_out: 126.050003052 + scale_params: 141.570007324 + } +} +layer { + name: "mixed_2_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_tower_1_conv_1_conv2d" + top: "mixed_2_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_2_tower_1_conv_1_conv2d_bn" + top: "mixed_2_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_2_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_2_tower_1_conv_1_conv2d_relu" + top: "mixed_2_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 126.050003052 + scale_out: 131.869995117 + scale_params: 423.859985352 + } +} +layer { + name: "mixed_2_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_tower_1_conv_2_conv2d" + top: "mixed_2_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_2_tower_1_conv_2_conv2d_bn" + top: "mixed_2_tower_1_conv_2_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_2_pool" + type: "Pooling" + bottom: "ch_concat_mixed_1_chconcat" + top: "AVE_pool_mixed_2_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_2_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_2_pool" + top: "mixed_2_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 170.679992676 + scale_out: 192.61000061 + scale_params: 127.099998474 + } +} +layer { + name: "mixed_2_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_2_tower_2_conv_conv2d" + top: "mixed_2_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_2_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_2_tower_2_conv_conv2d_bn" + top: "mixed_2_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_2_chconcat" + type: "Concat" + bottom: "mixed_2_conv_conv2d_relu" + bottom: "mixed_2_tower_conv_1_conv2d_relu" + bottom: "mixed_2_tower_1_conv_2_conv2d_relu" + bottom: "mixed_2_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_2_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_3_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_2_chconcat" + top: "mixed_3_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 2 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 124.5 + scale_out: 154.25 + scale_params: 251.36000061 + } +} +layer { + name: "mixed_3_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_3_conv_conv2d" + top: "mixed_3_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_3_conv_relu" + type: "ReLU" + bottom: "mixed_3_conv_conv2d_bn" + top: "mixed_3_conv_conv2d_relu" +} +layer { + name: "mixed_3_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_2_chconcat" + top: "mixed_3_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 124.5 + scale_out: 193.350006104 + scale_params: 278.760009766 + } +} +layer { + name: "mixed_3_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_3_tower_conv_conv2d" + top: "mixed_3_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_3_tower_conv_relu" + type: "ReLU" + bottom: "mixed_3_tower_conv_conv2d_bn" + top: "mixed_3_tower_conv_conv2d_relu" +} +layer { + name: "mixed_3_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_3_tower_conv_conv2d_relu" + top: "mixed_3_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 193.350006104 + scale_out: 266.5 + scale_params: 457.459991455 + } +} +layer { + name: "mixed_3_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_3_tower_conv_1_conv2d" + top: "mixed_3_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_3_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_3_tower_conv_1_conv2d_bn" + top: "mixed_3_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_3_tower_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_3_tower_conv_1_conv2d_relu" + top: "mixed_3_tower_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 96 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 2 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 266.5 + scale_out: 118.0 + scale_params: 270.910003662 + } +} +layer { + name: "mixed_3_tower_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_3_tower_conv_2_conv2d" + top: "mixed_3_tower_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_3_tower_conv_2_relu" + type: "ReLU" + bottom: "mixed_3_tower_conv_2_conv2d_bn" + top: "mixed_3_tower_conv_2_conv2d_relu" +} +layer { + name: "max_pool_mixed_3_pool" + type: "Pooling" + bottom: "ch_concat_mixed_2_chconcat" + top: "max_pool_mixed_3_pool" + pooling_param { + pool: MAX + pad: 0 + kernel_size: 3 + stride: 2 + } +} +layer { + name: "ch_concat_mixed_3_chconcat" + type: "Concat" + bottom: "max_pool_mixed_3_pool" + bottom: "mixed_3_conv_conv2d_relu" + bottom: "mixed_3_tower_conv_2_conv2d_relu" + top: "ch_concat_mixed_3_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_4_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_3_chconcat" + top: "mixed_4_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 118.0 + scale_out: 152.289993286 + scale_params: 153.630004883 + } +} +layer { + name: "mixed_4_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_conv_conv2d" + top: "mixed_4_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_conv_relu" + type: "ReLU" + bottom: "mixed_4_conv_conv2d_bn" + top: "mixed_4_conv_conv2d_relu" +} +layer { + name: "mixed_4_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_3_chconcat" + top: "mixed_4_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 118.0 + scale_out: 110.699996948 + scale_params: 182.440002441 + } +} +layer { + name: "mixed_4_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_conv_conv2d" + top: "mixed_4_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_conv_relu" + type: "ReLU" + bottom: "mixed_4_tower_conv_conv2d_bn" + top: "mixed_4_tower_conv_conv2d_relu" +} +layer { + name: "mixed_4_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_4_tower_conv_conv2d_relu" + top: "mixed_4_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 128 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 110.699996948 + scale_out: 96.4899978638 + scale_params: 157.910003662 + } +} +layer { + name: "mixed_4_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_conv_1_conv2d" + top: "mixed_4_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_4_tower_conv_1_conv2d_bn" + top: "mixed_4_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_4_tower_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_4_tower_conv_1_conv2d_relu" + top: "mixed_4_tower_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 96.4899978638 + scale_out: 125.279998779 + scale_params: 241.160003662 + } +} +layer { + name: "mixed_4_tower_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_conv_2_conv2d" + top: "mixed_4_tower_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_conv_2_relu" + type: "ReLU" + bottom: "mixed_4_tower_conv_2_conv2d_bn" + top: "mixed_4_tower_conv_2_conv2d_relu" +} +layer { + name: "mixed_4_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_3_chconcat" + top: "mixed_4_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 118.0 + scale_out: 292.529998779 + scale_params: 284.149993896 + } +} +layer { + name: "mixed_4_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_1_conv_conv2d" + top: "mixed_4_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_4_tower_1_conv_conv2d_bn" + top: "mixed_4_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_4_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_4_tower_1_conv_conv2d_relu" + top: "mixed_4_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 128 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 292.529998779 + scale_out: 252.419998169 + scale_params: 290.660003662 + } +} +layer { + name: "mixed_4_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_1_conv_1_conv2d" + top: "mixed_4_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_4_tower_1_conv_1_conv2d_bn" + top: "mixed_4_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_4_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_4_tower_1_conv_1_conv2d_relu" + top: "mixed_4_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 128 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 252.419998169 + scale_out: 139.050003052 + scale_params: 173.460006714 + } +} +layer { + name: "mixed_4_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_1_conv_2_conv2d" + top: "mixed_4_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_4_tower_1_conv_2_conv2d_bn" + top: "mixed_4_tower_1_conv_2_conv2d_relu" +} +layer { + name: "mixed_4_tower_1_conv_3_conv2d" + type: "Convolution" + bottom: "mixed_4_tower_1_conv_2_conv2d_relu" + top: "mixed_4_tower_1_conv_3_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 128 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 139.050003052 + scale_out: 159.149993896 + scale_params: 185.009994507 + } +} +layer { + name: "mixed_4_tower_1_conv_3_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_1_conv_3_conv2d" + top: "mixed_4_tower_1_conv_3_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_1_conv_3_relu" + type: "ReLU" + bottom: "mixed_4_tower_1_conv_3_conv2d_bn" + top: "mixed_4_tower_1_conv_3_conv2d_relu" +} +layer { + name: "mixed_4_tower_1_conv_4_conv2d" + type: "Convolution" + bottom: "mixed_4_tower_1_conv_3_conv2d_relu" + top: "mixed_4_tower_1_conv_4_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 159.149993896 + scale_out: 153.809997559 + scale_params: 206.669998169 + } +} +layer { + name: "mixed_4_tower_1_conv_4_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_1_conv_4_conv2d" + top: "mixed_4_tower_1_conv_4_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_1_conv_4_relu" + type: "ReLU" + bottom: "mixed_4_tower_1_conv_4_conv2d_bn" + top: "mixed_4_tower_1_conv_4_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_4_pool" + type: "Pooling" + bottom: "ch_concat_mixed_3_chconcat" + top: "AVE_pool_mixed_4_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_4_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_4_pool" + top: "mixed_4_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 202.369995117 + scale_out: 187.529998779 + scale_params: 116.709999084 + } +} +layer { + name: "mixed_4_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_4_tower_2_conv_conv2d" + top: "mixed_4_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_4_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_4_tower_2_conv_conv2d_bn" + top: "mixed_4_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_4_chconcat" + type: "Concat" + bottom: "mixed_4_conv_conv2d_relu" + bottom: "mixed_4_tower_conv_2_conv2d_relu" + bottom: "mixed_4_tower_1_conv_4_conv2d_relu" + bottom: "mixed_4_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_4_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_5_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_4_chconcat" + top: "mixed_5_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 125.279998779 + scale_out: 139.149993896 + scale_params: 192.5 + } +} +layer { + name: "mixed_5_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_conv_conv2d" + top: "mixed_5_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_conv_relu" + type: "ReLU" + bottom: "mixed_5_conv_conv2d_bn" + top: "mixed_5_conv_conv2d_relu" +} +layer { + name: "mixed_5_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_4_chconcat" + top: "mixed_5_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 125.279998779 + scale_out: 109.88999939 + scale_params: 252.080001831 + } +} +layer { + name: "mixed_5_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_conv_conv2d" + top: "mixed_5_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_conv_relu" + type: "ReLU" + bottom: "mixed_5_tower_conv_conv2d_bn" + top: "mixed_5_tower_conv_conv2d_relu" +} +layer { + name: "mixed_5_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_5_tower_conv_conv2d_relu" + top: "mixed_5_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 109.88999939 + scale_out: 108.779998779 + scale_params: 196.350006104 + } +} +layer { + name: "mixed_5_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_conv_1_conv2d" + top: "mixed_5_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_5_tower_conv_1_conv2d_bn" + top: "mixed_5_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_5_tower_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_5_tower_conv_1_conv2d_relu" + top: "mixed_5_tower_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 108.779998779 + scale_out: 94.7200012207 + scale_params: 218.880004883 + } +} +layer { + name: "mixed_5_tower_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_conv_2_conv2d" + top: "mixed_5_tower_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_conv_2_relu" + type: "ReLU" + bottom: "mixed_5_tower_conv_2_conv2d_bn" + top: "mixed_5_tower_conv_2_conv2d_relu" +} +layer { + name: "mixed_5_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_4_chconcat" + top: "mixed_5_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 125.279998779 + scale_out: 215.61000061 + scale_params: 294.489990234 + } +} +layer { + name: "mixed_5_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_1_conv_conv2d" + top: "mixed_5_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_5_tower_1_conv_conv2d_bn" + top: "mixed_5_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_5_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_5_tower_1_conv_conv2d_relu" + top: "mixed_5_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 215.61000061 + scale_out: 145.259994507 + scale_params: 186.509994507 + } +} +layer { + name: "mixed_5_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_1_conv_1_conv2d" + top: "mixed_5_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_5_tower_1_conv_1_conv2d_bn" + top: "mixed_5_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_5_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_5_tower_1_conv_1_conv2d_relu" + top: "mixed_5_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 145.259994507 + scale_out: 125.019996643 + scale_params: 243.020004272 + } +} +layer { + name: "mixed_5_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_1_conv_2_conv2d" + top: "mixed_5_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_5_tower_1_conv_2_conv2d_bn" + top: "mixed_5_tower_1_conv_2_conv2d_relu" +} +layer { + name: "mixed_5_tower_1_conv_3_conv2d" + type: "Convolution" + bottom: "mixed_5_tower_1_conv_2_conv2d_relu" + top: "mixed_5_tower_1_conv_3_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 125.019996643 + scale_out: 164.699996948 + scale_params: 320.420013428 + } +} +layer { + name: "mixed_5_tower_1_conv_3_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_1_conv_3_conv2d" + top: "mixed_5_tower_1_conv_3_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_1_conv_3_relu" + type: "ReLU" + bottom: "mixed_5_tower_1_conv_3_conv2d_bn" + top: "mixed_5_tower_1_conv_3_conv2d_relu" +} +layer { + name: "mixed_5_tower_1_conv_4_conv2d" + type: "Convolution" + bottom: "mixed_5_tower_1_conv_3_conv2d_relu" + top: "mixed_5_tower_1_conv_4_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 164.699996948 + scale_out: 156.759994507 + scale_params: 216.5 + } +} +layer { + name: "mixed_5_tower_1_conv_4_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_1_conv_4_conv2d" + top: "mixed_5_tower_1_conv_4_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_1_conv_4_relu" + type: "ReLU" + bottom: "mixed_5_tower_1_conv_4_conv2d_bn" + top: "mixed_5_tower_1_conv_4_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_5_pool" + type: "Pooling" + bottom: "ch_concat_mixed_4_chconcat" + top: "AVE_pool_mixed_5_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_5_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_5_pool" + top: "mixed_5_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 204.699996948 + scale_out: 129.899993896 + scale_params: 149.190002441 + } +} +layer { + name: "mixed_5_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_5_tower_2_conv_conv2d" + top: "mixed_5_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_5_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_5_tower_2_conv_conv2d_bn" + top: "mixed_5_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_5_chconcat" + type: "Concat" + bottom: "mixed_5_conv_conv2d_relu" + bottom: "mixed_5_tower_conv_2_conv2d_relu" + bottom: "mixed_5_tower_1_conv_4_conv2d_relu" + bottom: "mixed_5_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_5_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_6_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_5_chconcat" + top: "mixed_6_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 94.7200012207 + scale_out: 135.210006714 + scale_params: 165.38999939 + } +} +layer { + name: "mixed_6_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_conv_conv2d" + top: "mixed_6_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_conv_relu" + type: "ReLU" + bottom: "mixed_6_conv_conv2d_bn" + top: "mixed_6_conv_conv2d_relu" +} +layer { + name: "mixed_6_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_5_chconcat" + top: "mixed_6_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 94.7200012207 + scale_out: 145.830001831 + scale_params: 194.589996338 + } +} +layer { + name: "mixed_6_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_conv_conv2d" + top: "mixed_6_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_conv_relu" + type: "ReLU" + bottom: "mixed_6_tower_conv_conv2d_bn" + top: "mixed_6_tower_conv_conv2d_relu" +} +layer { + name: "mixed_6_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_6_tower_conv_conv2d_relu" + top: "mixed_6_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 145.830001831 + scale_out: 142.979995728 + scale_params: 200.419998169 + } +} +layer { + name: "mixed_6_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_conv_1_conv2d" + top: "mixed_6_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_6_tower_conv_1_conv2d_bn" + top: "mixed_6_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_6_tower_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_6_tower_conv_1_conv2d_relu" + top: "mixed_6_tower_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 142.979995728 + scale_out: 144.089996338 + scale_params: 248.820007324 + } +} +layer { + name: "mixed_6_tower_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_conv_2_conv2d" + top: "mixed_6_tower_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_conv_2_relu" + type: "ReLU" + bottom: "mixed_6_tower_conv_2_conv2d_bn" + top: "mixed_6_tower_conv_2_conv2d_relu" +} +layer { + name: "mixed_6_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_5_chconcat" + top: "mixed_6_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 94.7200012207 + scale_out: 180.13999939 + scale_params: 276.739990234 + } +} +layer { + name: "mixed_6_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_1_conv_conv2d" + top: "mixed_6_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_6_tower_1_conv_conv2d_bn" + top: "mixed_6_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_6_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_6_tower_1_conv_conv2d_relu" + top: "mixed_6_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 180.13999939 + scale_out: 104.069999695 + scale_params: 231.600006104 + } +} +layer { + name: "mixed_6_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_1_conv_1_conv2d" + top: "mixed_6_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_6_tower_1_conv_1_conv2d_bn" + top: "mixed_6_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_6_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_6_tower_1_conv_1_conv2d_relu" + top: "mixed_6_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 104.069999695 + scale_out: 117.370002747 + scale_params: 192.809997559 + } +} +layer { + name: "mixed_6_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_1_conv_2_conv2d" + top: "mixed_6_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_6_tower_1_conv_2_conv2d_bn" + top: "mixed_6_tower_1_conv_2_conv2d_relu" +} +layer { + name: "mixed_6_tower_1_conv_3_conv2d" + type: "Convolution" + bottom: "mixed_6_tower_1_conv_2_conv2d_relu" + top: "mixed_6_tower_1_conv_3_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 160 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 117.370002747 + scale_out: 109.230003357 + scale_params: 210.199996948 + } +} +layer { + name: "mixed_6_tower_1_conv_3_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_1_conv_3_conv2d" + top: "mixed_6_tower_1_conv_3_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_1_conv_3_relu" + type: "ReLU" + bottom: "mixed_6_tower_1_conv_3_conv2d_bn" + top: "mixed_6_tower_1_conv_3_conv2d_relu" +} +layer { + name: "mixed_6_tower_1_conv_4_conv2d" + type: "Convolution" + bottom: "mixed_6_tower_1_conv_3_conv2d_relu" + top: "mixed_6_tower_1_conv_4_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 109.230003357 + scale_out: 174.460006714 + scale_params: 312.559997559 + } +} +layer { + name: "mixed_6_tower_1_conv_4_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_1_conv_4_conv2d" + top: "mixed_6_tower_1_conv_4_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_1_conv_4_relu" + type: "ReLU" + bottom: "mixed_6_tower_1_conv_4_conv2d_bn" + top: "mixed_6_tower_1_conv_4_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_6_pool" + type: "Pooling" + bottom: "ch_concat_mixed_5_chconcat" + top: "AVE_pool_mixed_6_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_6_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_6_pool" + top: "mixed_6_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 145.119995117 + scale_out: 208.850006104 + scale_params: 119.339996338 + } +} +layer { + name: "mixed_6_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_6_tower_2_conv_conv2d" + top: "mixed_6_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_6_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_6_tower_2_conv_conv2d_bn" + top: "mixed_6_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_6_chconcat" + type: "Concat" + bottom: "mixed_6_conv_conv2d_relu" + bottom: "mixed_6_tower_conv_2_conv2d_relu" + bottom: "mixed_6_tower_1_conv_4_conv2d_relu" + bottom: "mixed_6_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_6_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_7_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_6_chconcat" + top: "mixed_7_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 135.210006714 + scale_out: 135.440002441 + scale_params: 252.38999939 + } +} +layer { + name: "mixed_7_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_conv_conv2d" + top: "mixed_7_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_conv_relu" + type: "ReLU" + bottom: "mixed_7_conv_conv2d_bn" + top: "mixed_7_conv_conv2d_relu" +} +layer { + name: "mixed_7_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_6_chconcat" + top: "mixed_7_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 135.210006714 + scale_out: 130.25 + scale_params: 369.850006104 + } +} +layer { + name: "mixed_7_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_conv_conv2d" + top: "mixed_7_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_conv_relu" + type: "ReLU" + bottom: "mixed_7_tower_conv_conv2d_bn" + top: "mixed_7_tower_conv_conv2d_relu" +} +layer { + name: "mixed_7_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_7_tower_conv_conv2d_relu" + top: "mixed_7_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 130.25 + scale_out: 105.180000305 + scale_params: 260.700012207 + } +} +layer { + name: "mixed_7_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_conv_1_conv2d" + top: "mixed_7_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_7_tower_conv_1_conv2d_bn" + top: "mixed_7_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_7_tower_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_7_tower_conv_1_conv2d_relu" + top: "mixed_7_tower_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 105.180000305 + scale_out: 153.440002441 + scale_params: 316.489990234 + } +} +layer { + name: "mixed_7_tower_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_conv_2_conv2d" + top: "mixed_7_tower_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_conv_2_relu" + type: "ReLU" + bottom: "mixed_7_tower_conv_2_conv2d_bn" + top: "mixed_7_tower_conv_2_conv2d_relu" +} +layer { + name: "mixed_7_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_6_chconcat" + top: "mixed_7_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 135.210006714 + scale_out: 160.740005493 + scale_params: 264.869995117 + } +} +layer { + name: "mixed_7_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_1_conv_conv2d" + top: "mixed_7_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_7_tower_1_conv_conv2d_bn" + top: "mixed_7_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_7_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_7_tower_1_conv_conv2d_relu" + top: "mixed_7_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 160.740005493 + scale_out: 145.690002441 + scale_params: 273.700012207 + } +} +layer { + name: "mixed_7_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_1_conv_1_conv2d" + top: "mixed_7_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_7_tower_1_conv_1_conv2d_bn" + top: "mixed_7_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_7_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_7_tower_1_conv_1_conv2d_relu" + top: "mixed_7_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 145.690002441 + scale_out: 136.080001831 + scale_params: 273.950012207 + } +} +layer { + name: "mixed_7_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_1_conv_2_conv2d" + top: "mixed_7_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_7_tower_1_conv_2_conv2d_bn" + top: "mixed_7_tower_1_conv_2_conv2d_relu" +} +layer { + name: "mixed_7_tower_1_conv_3_conv2d" + type: "Convolution" + bottom: "mixed_7_tower_1_conv_2_conv2d_relu" + top: "mixed_7_tower_1_conv_3_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 136.080001831 + scale_out: 138.130004883 + scale_params: 271.679992676 + } +} +layer { + name: "mixed_7_tower_1_conv_3_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_1_conv_3_conv2d" + top: "mixed_7_tower_1_conv_3_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_1_conv_3_relu" + type: "ReLU" + bottom: "mixed_7_tower_1_conv_3_conv2d_bn" + top: "mixed_7_tower_1_conv_3_conv2d_relu" +} +layer { + name: "mixed_7_tower_1_conv_4_conv2d" + type: "Convolution" + bottom: "mixed_7_tower_1_conv_3_conv2d_relu" + top: "mixed_7_tower_1_conv_4_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 138.130004883 + scale_out: 166.729995728 + scale_params: 331.309997559 + } +} +layer { + name: "mixed_7_tower_1_conv_4_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_1_conv_4_conv2d" + top: "mixed_7_tower_1_conv_4_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_1_conv_4_relu" + type: "ReLU" + bottom: "mixed_7_tower_1_conv_4_conv2d_bn" + top: "mixed_7_tower_1_conv_4_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_7_pool" + type: "Pooling" + bottom: "ch_concat_mixed_6_chconcat" + top: "AVE_pool_mixed_7_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_7_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_7_pool" + top: "mixed_7_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 233.350006104 + scale_out: 188.050003052 + scale_params: 129.759994507 + } +} +layer { + name: "mixed_7_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_7_tower_2_conv_conv2d" + top: "mixed_7_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_7_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_7_tower_2_conv_conv2d_bn" + top: "mixed_7_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_7_chconcat" + type: "Concat" + bottom: "mixed_7_conv_conv2d_relu" + bottom: "mixed_7_tower_conv_2_conv2d_relu" + bottom: "mixed_7_tower_1_conv_4_conv2d_relu" + bottom: "mixed_7_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_7_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_8_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_7_chconcat" + top: "mixed_8_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 135.440002441 + scale_out: 151.75 + scale_params: 245.309997559 + } +} +layer { + name: "mixed_8_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_8_tower_conv_conv2d" + top: "mixed_8_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_8_tower_conv_relu" + type: "ReLU" + bottom: "mixed_8_tower_conv_conv2d_bn" + top: "mixed_8_tower_conv_conv2d_relu" +} +layer { + name: "mixed_8_tower_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_8_tower_conv_conv2d_relu" + top: "mixed_8_tower_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 320 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 2 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 151.75 + scale_out: 81.1500015259 + scale_params: 171.190002441 + } +} +layer { + name: "mixed_8_tower_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_8_tower_conv_1_conv2d" + top: "mixed_8_tower_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_8_tower_conv_1_relu" + type: "ReLU" + bottom: "mixed_8_tower_conv_1_conv2d_bn" + top: "mixed_8_tower_conv_1_conv2d_relu" +} +layer { + name: "mixed_8_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_7_chconcat" + top: "mixed_8_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 135.440002441 + scale_out: 148.070007324 + scale_params: 135.559997559 + } +} +layer { + name: "mixed_8_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_8_tower_1_conv_conv2d" + top: "mixed_8_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_8_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_8_tower_1_conv_conv2d_bn" + top: "mixed_8_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_8_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_8_tower_1_conv_conv2d_relu" + top: "mixed_8_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 3 + kernel_h: 1 + kernel_w: 7 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 148.070007324 + scale_out: 114.86000061 + scale_params: 123.540000916 + } +} +layer { + name: "mixed_8_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_8_tower_1_conv_1_conv2d" + top: "mixed_8_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_8_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_8_tower_1_conv_1_conv2d_bn" + top: "mixed_8_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_8_tower_1_conv_2_conv2d" + type: "Convolution" + bottom: "mixed_8_tower_1_conv_1_conv2d_relu" + top: "mixed_8_tower_1_conv_2_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 3 + pad_w: 0 + kernel_h: 7 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 114.86000061 + scale_out: 193.179992676 + scale_params: 310.769989014 + } +} +layer { + name: "mixed_8_tower_1_conv_2_batchnorm" + type: "BatchNorm" + bottom: "mixed_8_tower_1_conv_2_conv2d" + top: "mixed_8_tower_1_conv_2_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_8_tower_1_conv_2_relu" + type: "ReLU" + bottom: "mixed_8_tower_1_conv_2_conv2d_bn" + top: "mixed_8_tower_1_conv_2_conv2d_relu" +} +layer { + name: "mixed_8_tower_1_conv_3_conv2d" + type: "Convolution" + bottom: "mixed_8_tower_1_conv_2_conv2d_relu" + top: "mixed_8_tower_1_conv_3_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 3 + stride: 2 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 193.179992676 + scale_out: 135.479995728 + scale_params: 313.369995117 + } +} +layer { + name: "mixed_8_tower_1_conv_3_batchnorm" + type: "BatchNorm" + bottom: "mixed_8_tower_1_conv_3_conv2d" + top: "mixed_8_tower_1_conv_3_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_8_tower_1_conv_3_relu" + type: "ReLU" + bottom: "mixed_8_tower_1_conv_3_conv2d_bn" + top: "mixed_8_tower_1_conv_3_conv2d_relu" +} +layer { + name: "MAX_pool_mixed_8_pool" + type: "Pooling" + bottom: "ch_concat_mixed_7_chconcat" + top: "MAX_pool_mixed_8_pool" + pooling_param { + pool: MAX + pad: 0 + kernel_size: 3 + stride: 2 + } +} +layer { + name: "ch_concat_mixed_8_chconcat" + type: "Concat" + bottom: "mixed_8_tower_conv_1_conv2d_relu" + bottom: "mixed_8_tower_1_conv_3_conv2d_relu" + bottom: "MAX_pool_mixed_8_pool" + top: "ch_concat_mixed_8_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_9_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_8_chconcat" + top: "mixed_9_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 320 + bias_term: false + pad: 0 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + kernel_h: 1 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 81.1500015259 + scale_out: 313.279998779 + scale_params: 400.739990234 + } +} +layer { + name: "mixed_9_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_conv_conv2d" + top: "mixed_9_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_conv_relu" + type: "ReLU" + bottom: "mixed_9_conv_conv2d_bn" + top: "mixed_9_conv_conv2d_relu" +} +layer { + name: "mixed_9_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_8_chconcat" + top: "mixed_9_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 81.1500015259 + scale_out: 175.759994507 + scale_params: 289.25 + } +} +layer { + name: "mixed_9_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_conv_conv2d" + top: "mixed_9_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_conv_relu" + type: "ReLU" + bottom: "mixed_9_tower_conv_conv2d_bn" + top: "mixed_9_tower_conv_conv2d_relu" +} +layer { + name: "mixed_9_tower_mixed_conv_conv2d" + type: "Convolution" + bottom: "mixed_9_tower_conv_conv2d_relu" + top: "mixed_9_tower_mixed_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 1 + kernel_h: 1 + kernel_w: 3 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 175.759994507 + scale_out: 207.509994507 + scale_params: 346.429992676 + } +} +layer { + name: "mixed_9_tower_mixed_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_mixed_conv_conv2d" + top: "mixed_9_tower_mixed_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_mixed_conv_relu" + type: "ReLU" + bottom: "mixed_9_tower_mixed_conv_conv2d_bn" + top: "mixed_9_tower_mixed_conv_conv2d_relu" +} +layer { + name: "mixed_9_tower_mixed_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_9_tower_conv_conv2d_relu" + top: "mixed_9_tower_mixed_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 1 + pad_w: 0 + kernel_h: 3 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 175.759994507 + scale_out: 187.419998169 + scale_params: 263.369995117 + } +} +layer { + name: "mixed_9_tower_mixed_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_mixed_conv_1_conv2d" + top: "mixed_9_tower_mixed_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_mixed_conv_1_relu" + type: "ReLU" + bottom: "mixed_9_tower_mixed_conv_1_conv2d_bn" + top: "mixed_9_tower_mixed_conv_1_conv2d_relu" +} +layer { + name: "mixed_9_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_8_chconcat" + top: "mixed_9_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 448 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 81.1500015259 + scale_out: 140.960006714 + scale_params: 241.759994507 + } +} +layer { + name: "mixed_9_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_1_conv_conv2d" + top: "mixed_9_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_9_tower_1_conv_conv2d_bn" + top: "mixed_9_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_9_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_9_tower_1_conv_conv2d_relu" + top: "mixed_9_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 140.960006714 + scale_out: 127.019996643 + scale_params: 514.510009766 + } +} +layer { + name: "mixed_9_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_1_conv_1_conv2d" + top: "mixed_9_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_9_tower_1_conv_1_conv2d_bn" + top: "mixed_9_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_9_tower_1_mixed_conv_conv2d" + type: "Convolution" + bottom: "mixed_9_tower_1_conv_1_conv2d_relu" + top: "mixed_9_tower_1_mixed_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 1 + kernel_h: 1 + kernel_w: 3 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 127.019996643 + scale_out: 198.600006104 + scale_params: 570.369995117 + } +} +layer { + name: "mixed_9_tower_1_mixed_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_1_mixed_conv_conv2d" + top: "mixed_9_tower_1_mixed_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_1_mixed_conv_relu" + type: "ReLU" + bottom: "mixed_9_tower_1_mixed_conv_conv2d_bn" + top: "mixed_9_tower_1_mixed_conv_conv2d_relu" +} +layer { + name: "mixed_9_tower_1_mixed_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_9_tower_1_conv_1_conv2d_relu" + top: "mixed_9_tower_1_mixed_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 1 + pad_w: 0 + kernel_h: 3 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 127.019996643 + scale_out: 199.339996338 + scale_params: 365.929992676 + } +} +layer { + name: "mixed_9_tower_1_mixed_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_1_mixed_conv_1_conv2d" + top: "mixed_9_tower_1_mixed_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_1_mixed_conv_1_relu" + type: "ReLU" + bottom: "mixed_9_tower_1_mixed_conv_1_conv2d_bn" + top: "mixed_9_tower_1_mixed_conv_1_conv2d_relu" +} +layer { + name: "AVE_pool_mixed_9_pool" + type: "Pooling" + bottom: "ch_concat_mixed_8_chconcat" + top: "AVE_pool_mixed_9_pool" + pooling_param { + pool: AVE + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_9_tower_2_conv_conv2d" + type: "Convolution" + bottom: "AVE_pool_mixed_9_pool" + top: "mixed_9_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 152.100006104 + scale_out: 308.799987793 + scale_params: 119.88999939 + } +} +layer { + name: "mixed_9_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_9_tower_2_conv_conv2d" + top: "mixed_9_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_9_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_9_tower_2_conv_conv2d_bn" + top: "mixed_9_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_9_chconcat" + type: "Concat" + bottom: "mixed_9_conv_conv2d_relu" + bottom: "mixed_9_tower_mixed_conv_conv2d_relu" + bottom: "mixed_9_tower_mixed_conv_1_conv2d_relu" + bottom: "mixed_9_tower_1_mixed_conv_conv2d_relu" + bottom: "mixed_9_tower_1_mixed_conv_1_conv2d_relu" + bottom: "mixed_9_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_9_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "mixed_10_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_9_chconcat" + top: "mixed_10_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 320 + bias_term: false + pad: 0 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + kernel_h: 1 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 187.419998169 + scale_out: 33.7900009155 + scale_params: 19.4200000763 + } +} +layer { + name: "mixed_10_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_conv_conv2d" + top: "mixed_10_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_conv_relu" + type: "ReLU" + bottom: "mixed_10_conv_conv2d_bn" + top: "mixed_10_conv_conv2d_relu" +} +layer { + name: "mixed_10_tower_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_9_chconcat" + top: "mixed_10_tower_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 187.419998169 + scale_out: 122.779998779 + scale_params: 105.769996643 + } +} +layer { + name: "mixed_10_tower_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_conv_conv2d" + top: "mixed_10_tower_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_conv_relu" + type: "ReLU" + bottom: "mixed_10_tower_conv_conv2d_bn" + top: "mixed_10_tower_conv_conv2d_relu" +} +layer { + name: "mixed_10_tower_mixed_conv_conv2d" + type: "Convolution" + bottom: "mixed_10_tower_conv_conv2d_relu" + top: "mixed_10_tower_mixed_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 1 + kernel_h: 1 + kernel_w: 3 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 122.779998779 + scale_out: 18.8600006104 + scale_params: 35.6800003052 + } +} +layer { + name: "mixed_10_tower_mixed_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_mixed_conv_conv2d" + top: "mixed_10_tower_mixed_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_mixed_conv_relu" + type: "ReLU" + bottom: "mixed_10_tower_mixed_conv_conv2d_bn" + top: "mixed_10_tower_mixed_conv_conv2d_relu" +} +layer { + name: "mixed_10_tower_mixed_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_10_tower_conv_conv2d_relu" + top: "mixed_10_tower_mixed_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 1 + pad_w: 0 + kernel_h: 3 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 122.779998779 + scale_out: 18.5200004578 + scale_params: 37.3199996948 + } +} +layer { + name: "mixed_10_tower_mixed_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_mixed_conv_1_conv2d" + top: "mixed_10_tower_mixed_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_mixed_conv_1_relu" + type: "ReLU" + bottom: "mixed_10_tower_mixed_conv_1_conv2d_bn" + top: "mixed_10_tower_mixed_conv_1_conv2d_relu" +} +layer { + name: "mixed_10_tower_1_conv_conv2d" + type: "Convolution" + bottom: "ch_concat_mixed_9_chconcat" + top: "mixed_10_tower_1_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 448 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 187.419998169 + scale_out: 120.839996338 + scale_params: 92.4100036621 + } +} +layer { + name: "mixed_10_tower_1_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_1_conv_conv2d" + top: "mixed_10_tower_1_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_1_conv_relu" + type: "ReLU" + bottom: "mixed_10_tower_1_conv_conv2d_bn" + top: "mixed_10_tower_1_conv_conv2d_relu" +} +layer { + name: "mixed_10_tower_1_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_10_tower_1_conv_conv2d_relu" + top: "mixed_10_tower_1_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 120.839996338 + scale_out: 190.479995728 + scale_params: 345.420013428 + } +} +layer { + name: "mixed_10_tower_1_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_1_conv_1_conv2d" + top: "mixed_10_tower_1_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_1_conv_1_relu" + type: "ReLU" + bottom: "mixed_10_tower_1_conv_1_conv2d_bn" + top: "mixed_10_tower_1_conv_1_conv2d_relu" +} +layer { + name: "mixed_10_tower_1_mixed_conv_conv2d" + type: "Convolution" + bottom: "mixed_10_tower_1_conv_1_conv2d_relu" + top: "mixed_10_tower_1_mixed_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 0 + pad_w: 1 + kernel_h: 1 + kernel_w: 3 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 190.479995728 + scale_out: 16.7700004578 + scale_params: 44.3199996948 + } +} +layer { + name: "mixed_10_tower_1_mixed_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_1_mixed_conv_conv2d" + top: "mixed_10_tower_1_mixed_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_1_mixed_conv_relu" + type: "ReLU" + bottom: "mixed_10_tower_1_mixed_conv_conv2d_bn" + top: "mixed_10_tower_1_mixed_conv_conv2d_relu" +} +layer { + name: "mixed_10_tower_1_mixed_conv_1_conv2d" + type: "Convolution" + bottom: "mixed_10_tower_1_conv_1_conv2d_relu" + top: "mixed_10_tower_1_mixed_conv_1_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 384 + bias_term: false + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + pad_h: 1 + pad_w: 0 + kernel_h: 3 + kernel_w: 1 + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 190.479995728 + scale_out: 22.0100002289 + scale_params: 44.2700004578 + } +} +layer { + name: "mixed_10_tower_1_mixed_conv_1_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_1_mixed_conv_1_conv2d" + top: "mixed_10_tower_1_mixed_conv_1_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_1_mixed_conv_1_relu" + type: "ReLU" + bottom: "mixed_10_tower_1_mixed_conv_1_conv2d_bn" + top: "mixed_10_tower_1_mixed_conv_1_conv2d_relu" +} +layer { + name: "MAX_pool_mixed_10_pool" + type: "Pooling" + bottom: "ch_concat_mixed_9_chconcat" + top: "MAX_pool_mixed_10_pool" + pooling_param { + pool: MAX + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "mixed_10_tower_2_conv_conv2d" + type: "Convolution" + bottom: "MAX_pool_mixed_10_pool" + top: "mixed_10_tower_2_conv_conv2d" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + convolution_param { + num_output: 192 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "gaussian" + std: 0.00999999977648 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 187.419998169 + scale_out: 40.1100006104 + scale_params: 81.5699996948 + } +} +layer { + name: "mixed_10_tower_2_conv_batchnorm" + type: "BatchNorm" + bottom: "mixed_10_tower_2_conv_conv2d" + top: "mixed_10_tower_2_conv_conv2d_bn" + batch_norm_param { + } +} +layer { + name: "mixed_10_tower_2_conv_relu" + type: "ReLU" + bottom: "mixed_10_tower_2_conv_conv2d_bn" + top: "mixed_10_tower_2_conv_conv2d_relu" +} +layer { + name: "ch_concat_mixed_10_chconcat" + type: "Concat" + bottom: "mixed_10_conv_conv2d_relu" + bottom: "mixed_10_tower_mixed_conv_conv2d_relu" + bottom: "mixed_10_tower_mixed_conv_1_conv2d_relu" + bottom: "mixed_10_tower_1_mixed_conv_conv2d_relu" + bottom: "mixed_10_tower_1_mixed_conv_1_conv2d_relu" + bottom: "mixed_10_tower_2_conv_conv2d_relu" + top: "ch_concat_mixed_10_chconcat" + concat_param { + axis: 1 + } +} +layer { + name: "global_pool" + type: "Pooling" + bottom: "ch_concat_mixed_10_chconcat" + top: "global_pool" + pooling_param { + pool: AVE + pad: 0 + kernel_size: 8 + stride: 1 + } +} +layer { + name: "drop" + type: "Dropout" + bottom: "global_pool" + top: "global_pool" + dropout_param { + dropout_ratio: 0.800000011921 + } +} +layer { + name: "flatten" + type: "Flatten" + bottom: "global_pool" + top: "flatten" +} +layer { + name: "fc1" + type: "InnerProduct" + bottom: "flatten" + top: "fc1" + param { + lr_mult: 1.0 + decay_mult: 1.0 + } + param { + lr_mult: 2.0 + decay_mult: 0.0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.0 + } + } +} + diff --git a/models/intel_optimized_models/int8/resnet50_int8.prototxt b/models/intel_optimized_models/int8/resnet50_int8.prototxt new file mode 100644 index 000000000..8d6aacd66 --- /dev/null +++ b/models/intel_optimized_models/int8/resnet50_int8.prototxt @@ -0,0 +1,3035 @@ +# For INT8 reference +name: "ResNet-50" +layer { + name: "data" + type: "DummyData" + top: "data" + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape { + dim: 64 + dim: 3 + dim: 224 + dim: 224 + } + } +} +layer { + name: "data" + type: "DummyData" + top: "label" + dummy_data_param { + data_filler { + type: "constant" + } + shape { + dim: 64 + } + } +} +layer { + name: "conv1" + type: "Convolution" + bottom: "data" + top: "conv1" + convolution_param { + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } +} +layer { + name: "bn_conv1" + type: "BatchNorm" + bottom: "conv1" + top: "conv1" + batch_norm_param { + } +} +layer { + name: "scale_conv1" + type: "Scale" + bottom: "conv1" + top: "conv1" + scale_param { + bias_term: true + } +} +layer { + name: "conv1_relu" + type: "ReLU" + bottom: "conv1" + top: "conv1" + relu_param { + } +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "res2a_branch1" + type: "Convolution" + bottom: "pool1" + top: "res2a_branch1" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.38000011444 + scale_out: 5.73999977112 + scale_params: 75.9199981689 + } +} +layer { + name: "bn2a_branch1" + type: "BatchNorm" + bottom: "res2a_branch1" + top: "res2a_branch1" + batch_norm_param { + } +} +layer { + name: "scale2a_branch1" + type: "Scale" + bottom: "res2a_branch1" + top: "res2a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res2a_branch2a" + type: "Convolution" + bottom: "pool1" + top: "res2a_branch2a" + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.38000011444 + scale_out: 17.6599998474 + scale_params: 151.089996338 + } +} +layer { + name: "bn2a_branch2a" + type: "BatchNorm" + bottom: "res2a_branch2a" + top: "res2a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale2a_branch2a" + type: "Scale" + bottom: "res2a_branch2a" + top: "res2a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res2a_branch2a_relu" + type: "ReLU" + bottom: "res2a_branch2a" + top: "res2a_branch2a" + relu_param { + } +} +layer { + name: "res2a_branch2b" + type: "Convolution" + bottom: "res2a_branch2a" + top: "res2a_branch2b" + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 17.6599998474 + scale_out: 19.9799995422 + scale_params: 416.320007324 + } +} +layer { + name: "bn2a_branch2b" + type: "BatchNorm" + bottom: "res2a_branch2b" + top: "res2a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale2a_branch2b" + type: "Scale" + bottom: "res2a_branch2b" + top: "res2a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res2a_branch2b_relu" + type: "ReLU" + bottom: "res2a_branch2b" + top: "res2a_branch2b" + relu_param { + } +} +layer { + name: "res2a_branch2c" + type: "Convolution" + bottom: "res2a_branch2b" + top: "res2a_branch2c" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 19.9799995422 + scale_out: 11.5200004578 + scale_params: 72.1699981689 + } +} +layer { + name: "bn2a_branch2c" + type: "BatchNorm" + bottom: "res2a_branch2c" + top: "res2a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale2a_branch2c" + type: "Scale" + bottom: "res2a_branch2c" + top: "res2a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res2a" + type: "Eltwise" + bottom: "res2a_branch1" + bottom: "res2a_branch2c" + top: "res2a" + eltwise_param { + } +} +layer { + name: "res2a_relu" + type: "ReLU" + bottom: "res2a" + top: "res2a" + relu_param { + } +} +layer { + name: "res2b_branch2a" + type: "Convolution" + bottom: "res2a" + top: "res2b_branch2a" + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.5200004578 + scale_out: 17.9099998474 + scale_params: 192.330001831 + } +} +layer { + name: "bn2b_branch2a" + type: "BatchNorm" + bottom: "res2b_branch2a" + top: "res2b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale2b_branch2a" + type: "Scale" + bottom: "res2b_branch2a" + top: "res2b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res2b_branch2a_relu" + type: "ReLU" + bottom: "res2b_branch2a" + top: "res2b_branch2a" + relu_param { + } +} +layer { + name: "res2b_branch2b" + type: "Convolution" + bottom: "res2b_branch2a" + top: "res2b_branch2b" + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 17.9099998474 + scale_out: 19.5799999237 + scale_params: 210.529998779 + } +} +layer { + name: "bn2b_branch2b" + type: "BatchNorm" + bottom: "res2b_branch2b" + top: "res2b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale2b_branch2b" + type: "Scale" + bottom: "res2b_branch2b" + top: "res2b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res2b_branch2b_relu" + type: "ReLU" + bottom: "res2b_branch2b" + top: "res2b_branch2b" + relu_param { + } +} +layer { + name: "res2b_branch2c" + type: "Convolution" + bottom: "res2b_branch2b" + top: "res2b_branch2c" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 19.5799999237 + scale_out: 11.5200004578 + scale_params: 88.4599990845 + } +} +layer { + name: "bn2b_branch2c" + type: "BatchNorm" + bottom: "res2b_branch2c" + top: "res2b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale2b_branch2c" + type: "Scale" + bottom: "res2b_branch2c" + top: "res2b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res2b" + type: "Eltwise" + bottom: "res2a" + bottom: "res2b_branch2c" + top: "res2b" + eltwise_param { + } +} +layer { + name: "res2b_relu" + type: "ReLU" + bottom: "res2b" + top: "res2b" + relu_param { + } +} +layer { + name: "res2c_branch2a" + type: "Convolution" + bottom: "res2b" + top: "res2c_branch2a" + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.5200004578 + scale_out: 18.6000003815 + scale_params: 360.359985352 + } +} +layer { + name: "bn2c_branch2a" + type: "BatchNorm" + bottom: "res2c_branch2a" + top: "res2c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale2c_branch2a" + type: "Scale" + bottom: "res2c_branch2a" + top: "res2c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res2c_branch2a_relu" + type: "ReLU" + bottom: "res2c_branch2a" + top: "res2c_branch2a" + relu_param { + } +} +layer { + name: "res2c_branch2b" + type: "Convolution" + bottom: "res2c_branch2a" + top: "res2c_branch2b" + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 18.6000003815 + scale_out: 13.5799999237 + scale_params: 308.029998779 + } +} +layer { + name: "bn2c_branch2b" + type: "BatchNorm" + bottom: "res2c_branch2b" + top: "res2c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale2c_branch2b" + type: "Scale" + bottom: "res2c_branch2b" + top: "res2c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res2c_branch2b_relu" + type: "ReLU" + bottom: "res2c_branch2b" + top: "res2c_branch2b" + relu_param { + } +} +layer { + name: "res2c_branch2c" + type: "Convolution" + bottom: "res2c_branch2b" + top: "res2c_branch2c" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 13.5799999237 + scale_out: 11.5200004578 + scale_params: 103.910003662 + } +} +layer { + name: "bn2c_branch2c" + type: "BatchNorm" + bottom: "res2c_branch2c" + top: "res2c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale2c_branch2c" + type: "Scale" + bottom: "res2c_branch2c" + top: "res2c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res2c" + type: "Eltwise" + bottom: "res2b" + bottom: "res2c_branch2c" + top: "res2c" + eltwise_param { + } +} +layer { + name: "res2c_relu" + type: "ReLU" + bottom: "res2c" + top: "res2c" + relu_param { + } +} +layer { + name: "res3a_branch1" + type: "Convolution" + bottom: "res2c" + top: "res3a_branch1" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.5200004578 + scale_out: 4.78000020981 + scale_params: 135.169998169 + } +} +layer { + name: "bn3a_branch1" + type: "BatchNorm" + bottom: "res3a_branch1" + top: "res3a_branch1" + batch_norm_param { + } +} +layer { + name: "scale3a_branch1" + type: "Scale" + bottom: "res3a_branch1" + top: "res3a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res3a_branch2a" + type: "Convolution" + bottom: "res2c" + top: "res3a_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.5200004578 + scale_out: 19.0499992371 + scale_params: 277.709991455 + } +} +layer { + name: "bn3a_branch2a" + type: "BatchNorm" + bottom: "res3a_branch2a" + top: "res3a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3a_branch2a" + type: "Scale" + bottom: "res3a_branch2a" + top: "res3a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3a_branch2a_relu" + type: "ReLU" + bottom: "res3a_branch2a" + top: "res3a_branch2a" + relu_param { + } +} +layer { + name: "res3a_branch2b" + type: "Convolution" + bottom: "res3a_branch2a" + top: "res3a_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 19.0499992371 + scale_out: 25.5400009155 + scale_params: 320.339996338 + } +} +layer { + name: "bn3a_branch2b" + type: "BatchNorm" + bottom: "res3a_branch2b" + top: "res3a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3a_branch2b" + type: "Scale" + bottom: "res3a_branch2b" + top: "res3a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3a_branch2b_relu" + type: "ReLU" + bottom: "res3a_branch2b" + top: "res3a_branch2b" + relu_param { + } +} +layer { + name: "res3a_branch2c" + type: "Convolution" + bottom: "res3a_branch2b" + top: "res3a_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 25.5400009155 + scale_out: 9.59000015259 + scale_params: 65.7200012207 + } +} +layer { + name: "bn3a_branch2c" + type: "BatchNorm" + bottom: "res3a_branch2c" + top: "res3a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3a_branch2c" + type: "Scale" + bottom: "res3a_branch2c" + top: "res3a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3a" + type: "Eltwise" + bottom: "res3a_branch1" + bottom: "res3a_branch2c" + top: "res3a" + eltwise_param { + } +} +layer { + name: "res3a_relu" + type: "ReLU" + bottom: "res3a" + top: "res3a" + relu_param { + } +} +layer { + name: "res3b_branch2a" + type: "Convolution" + bottom: "res3a" + top: "res3b_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.59000015259 + scale_out: 24.1900005341 + scale_params: 493.920013428 + } +} +layer { + name: "bn3b_branch2a" + type: "BatchNorm" + bottom: "res3b_branch2a" + top: "res3b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3b_branch2a" + type: "Scale" + bottom: "res3b_branch2a" + top: "res3b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3b_branch2a_relu" + type: "ReLU" + bottom: "res3b_branch2a" + top: "res3b_branch2a" + relu_param { + } +} +layer { + name: "res3b_branch2b" + type: "Convolution" + bottom: "res3b_branch2a" + top: "res3b_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 24.1900005341 + scale_out: 20.4899997711 + scale_params: 308.959991455 + } +} +layer { + name: "bn3b_branch2b" + type: "BatchNorm" + bottom: "res3b_branch2b" + top: "res3b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3b_branch2b" + type: "Scale" + bottom: "res3b_branch2b" + top: "res3b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3b_branch2b_relu" + type: "ReLU" + bottom: "res3b_branch2b" + top: "res3b_branch2b" + relu_param { + } +} +layer { + name: "res3b_branch2c" + type: "Convolution" + bottom: "res3b_branch2b" + top: "res3b_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 20.4899997711 + scale_out: 9.59000015259 + scale_params: 55.6899986267 + } +} +layer { + name: "bn3b_branch2c" + type: "BatchNorm" + bottom: "res3b_branch2c" + top: "res3b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3b_branch2c" + type: "Scale" + bottom: "res3b_branch2c" + top: "res3b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3b" + type: "Eltwise" + bottom: "res3a" + bottom: "res3b_branch2c" + top: "res3b" + eltwise_param { + } +} +layer { + name: "res3b_relu" + type: "ReLU" + bottom: "res3b" + top: "res3b" + relu_param { + } +} +layer { + name: "res3c_branch2a" + type: "Convolution" + bottom: "res3b" + top: "res3c_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.59000015259 + scale_out: 9.35999965668 + scale_params: 142.929992676 + } +} +layer { + name: "bn3c_branch2a" + type: "BatchNorm" + bottom: "res3c_branch2a" + top: "res3c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3c_branch2a" + type: "Scale" + bottom: "res3c_branch2a" + top: "res3c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3c_branch2a_relu" + type: "ReLU" + bottom: "res3c_branch2a" + top: "res3c_branch2a" + relu_param { + } +} +layer { + name: "res3c_branch2b" + type: "Convolution" + bottom: "res3c_branch2a" + top: "res3c_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.35999965668 + scale_out: 3.74000000954 + scale_params: 88.1699981689 + } +} +layer { + name: "bn3c_branch2b" + type: "BatchNorm" + bottom: "res3c_branch2b" + top: "res3c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3c_branch2b" + type: "Scale" + bottom: "res3c_branch2b" + top: "res3c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3c_branch2b_relu" + type: "ReLU" + bottom: "res3c_branch2b" + top: "res3c_branch2b" + relu_param { + } +} +layer { + name: "res3c_branch2c" + type: "Convolution" + bottom: "res3c_branch2b" + top: "res3c_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 3.74000000954 + scale_out: 9.59000015259 + scale_params: 66.2300033569 + } +} +layer { + name: "bn3c_branch2c" + type: "BatchNorm" + bottom: "res3c_branch2c" + top: "res3c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3c_branch2c" + type: "Scale" + bottom: "res3c_branch2c" + top: "res3c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3c" + type: "Eltwise" + bottom: "res3b" + bottom: "res3c_branch2c" + top: "res3c" + eltwise_param { + } +} +layer { + name: "res3c_relu" + type: "ReLU" + bottom: "res3c" + top: "res3c" + relu_param { + } +} +layer { + name: "res3d_branch2a" + type: "Convolution" + bottom: "res3c" + top: "res3d_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.59000015259 + scale_out: 7.40999984741 + scale_params: 240.589996338 + } +} +layer { + name: "bn3d_branch2a" + type: "BatchNorm" + bottom: "res3d_branch2a" + top: "res3d_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3d_branch2a" + type: "Scale" + bottom: "res3d_branch2a" + top: "res3d_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3d_branch2a_relu" + type: "ReLU" + bottom: "res3d_branch2a" + top: "res3d_branch2a" + relu_param { + } +} +layer { + name: "res3d_branch2b" + type: "Convolution" + bottom: "res3d_branch2a" + top: "res3d_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.40999984741 + scale_out: 15.0600004196 + scale_params: 314.239990234 + } +} +layer { + name: "bn3d_branch2b" + type: "BatchNorm" + bottom: "res3d_branch2b" + top: "res3d_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3d_branch2b" + type: "Scale" + bottom: "res3d_branch2b" + top: "res3d_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3d_branch2b_relu" + type: "ReLU" + bottom: "res3d_branch2b" + top: "res3d_branch2b" + relu_param { + } +} +layer { + name: "res3d_branch2c" + type: "Convolution" + bottom: "res3d_branch2b" + top: "res3d_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 15.0600004196 + scale_out: 9.59000015259 + scale_params: 113.980003357 + } +} +layer { + name: "bn3d_branch2c" + type: "BatchNorm" + bottom: "res3d_branch2c" + top: "res3d_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3d_branch2c" + type: "Scale" + bottom: "res3d_branch2c" + top: "res3d_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3d" + type: "Eltwise" + bottom: "res3c" + bottom: "res3d_branch2c" + top: "res3d" + eltwise_param { + } +} +layer { + name: "res3d_relu" + type: "ReLU" + bottom: "res3d" + top: "res3d" + relu_param { + } +} +layer { + name: "res4a_branch1" + type: "Convolution" + bottom: "res3d" + top: "res4a_branch1" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.59000015259 + scale_out: 3.70000004768 + scale_params: 213.380004883 + } +} +layer { + name: "bn4a_branch1" + type: "BatchNorm" + bottom: "res4a_branch1" + top: "res4a_branch1" + batch_norm_param { + } +} +layer { + name: "scale4a_branch1" + type: "Scale" + bottom: "res4a_branch1" + top: "res4a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res4a_branch2a" + type: "Convolution" + bottom: "res3d" + top: "res4a_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.59000015259 + scale_out: 12.7700004578 + scale_params: 254.339996338 + } +} +layer { + name: "bn4a_branch2a" + type: "BatchNorm" + bottom: "res4a_branch2a" + top: "res4a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4a_branch2a" + type: "Scale" + bottom: "res4a_branch2a" + top: "res4a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4a_branch2a_relu" + type: "ReLU" + bottom: "res4a_branch2a" + top: "res4a_branch2a" + relu_param { + } +} +layer { + name: "res4a_branch2b" + type: "Convolution" + bottom: "res4a_branch2a" + top: "res4a_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 12.7700004578 + scale_out: 15.3699998856 + scale_params: 473.709991455 + } +} +layer { + name: "bn4a_branch2b" + type: "BatchNorm" + bottom: "res4a_branch2b" + top: "res4a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4a_branch2b" + type: "Scale" + bottom: "res4a_branch2b" + top: "res4a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4a_branch2b_relu" + type: "ReLU" + bottom: "res4a_branch2b" + top: "res4a_branch2b" + relu_param { + } +} +layer { + name: "res4a_branch2c" + type: "Convolution" + bottom: "res4a_branch2b" + top: "res4a_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 15.3699998856 + scale_out: 7.42999982834 + scale_params: 75.6200027466 + } +} +layer { + name: "bn4a_branch2c" + type: "BatchNorm" + bottom: "res4a_branch2c" + top: "res4a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4a_branch2c" + type: "Scale" + bottom: "res4a_branch2c" + top: "res4a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4a" + type: "Eltwise" + bottom: "res4a_branch1" + bottom: "res4a_branch2c" + top: "res4a" + eltwise_param { + } +} +layer { + name: "res4a_relu" + type: "ReLU" + bottom: "res4a" + top: "res4a" + relu_param { + } +} +layer { + name: "res4b_branch2a" + type: "Convolution" + bottom: "res4a" + top: "res4b_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 12.2600002289 + scale_params: 325.369995117 + } +} +layer { + name: "bn4b_branch2a" + type: "BatchNorm" + bottom: "res4b_branch2a" + top: "res4b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4b_branch2a" + type: "Scale" + bottom: "res4b_branch2a" + top: "res4b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4b_branch2a_relu" + type: "ReLU" + bottom: "res4b_branch2a" + top: "res4b_branch2a" + relu_param { + } +} +layer { + name: "res4b_branch2b" + type: "Convolution" + bottom: "res4b_branch2a" + top: "res4b_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 12.2600002289 + scale_out: 6.44000005722 + scale_params: 131.820007324 + } +} +layer { + name: "bn4b_branch2b" + type: "BatchNorm" + bottom: "res4b_branch2b" + top: "res4b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4b_branch2b" + type: "Scale" + bottom: "res4b_branch2b" + top: "res4b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4b_branch2b_relu" + type: "ReLU" + bottom: "res4b_branch2b" + top: "res4b_branch2b" + relu_param { + } +} +layer { + name: "res4b_branch2c" + type: "Convolution" + bottom: "res4b_branch2b" + top: "res4b_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 6.44000005722 + scale_out: 7.42999982834 + scale_params: 67.4400024414 + } +} +layer { + name: "bn4b_branch2c" + type: "BatchNorm" + bottom: "res4b_branch2c" + top: "res4b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4b_branch2c" + type: "Scale" + bottom: "res4b_branch2c" + top: "res4b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4b" + type: "Eltwise" + bottom: "res4a" + bottom: "res4b_branch2c" + top: "res4b" + eltwise_param { + } +} +layer { + name: "res4b_relu" + type: "ReLU" + bottom: "res4b" + top: "res4b" + relu_param { + } +} +layer { + name: "res4c_branch2a" + type: "Convolution" + bottom: "res4b" + top: "res4c_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 11.529999733 + scale_params: 369.480010986 + } +} +layer { + name: "bn4c_branch2a" + type: "BatchNorm" + bottom: "res4c_branch2a" + top: "res4c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4c_branch2a" + type: "Scale" + bottom: "res4c_branch2a" + top: "res4c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4c_branch2a_relu" + type: "ReLU" + bottom: "res4c_branch2a" + top: "res4c_branch2a" + relu_param { + } +} +layer { + name: "res4c_branch2b" + type: "Convolution" + bottom: "res4c_branch2a" + top: "res4c_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.529999733 + scale_out: 6.94999980927 + scale_params: 139.050003052 + } +} +layer { + name: "bn4c_branch2b" + type: "BatchNorm" + bottom: "res4c_branch2b" + top: "res4c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4c_branch2b" + type: "Scale" + bottom: "res4c_branch2b" + top: "res4c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4c_branch2b_relu" + type: "ReLU" + bottom: "res4c_branch2b" + top: "res4c_branch2b" + relu_param { + } +} +layer { + name: "res4c_branch2c" + type: "Convolution" + bottom: "res4c_branch2b" + top: "res4c_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 6.94999980927 + scale_out: 7.42999982834 + scale_params: 76.9700012207 + } +} +layer { + name: "bn4c_branch2c" + type: "BatchNorm" + bottom: "res4c_branch2c" + top: "res4c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4c_branch2c" + type: "Scale" + bottom: "res4c_branch2c" + top: "res4c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4c" + type: "Eltwise" + bottom: "res4b" + bottom: "res4c_branch2c" + top: "res4c" + eltwise_param { + } +} +layer { + name: "res4c_relu" + type: "ReLU" + bottom: "res4c" + top: "res4c" + relu_param { + } +} +layer { + name: "res4d_branch2a" + type: "Convolution" + bottom: "res4c" + top: "res4d_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 10.7299995422 + scale_params: 312.220001221 + } +} +layer { + name: "bn4d_branch2a" + type: "BatchNorm" + bottom: "res4d_branch2a" + top: "res4d_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4d_branch2a" + type: "Scale" + bottom: "res4d_branch2a" + top: "res4d_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4d_branch2a_relu" + type: "ReLU" + bottom: "res4d_branch2a" + top: "res4d_branch2a" + relu_param { + } +} +layer { + name: "res4d_branch2b" + type: "Convolution" + bottom: "res4d_branch2a" + top: "res4d_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 10.7299995422 + scale_out: 5.40000009537 + scale_params: 201.61000061 + } +} +layer { + name: "bn4d_branch2b" + type: "BatchNorm" + bottom: "res4d_branch2b" + top: "res4d_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4d_branch2b" + type: "Scale" + bottom: "res4d_branch2b" + top: "res4d_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4d_branch2b_relu" + type: "ReLU" + bottom: "res4d_branch2b" + top: "res4d_branch2b" + relu_param { + } +} +layer { + name: "res4d_branch2c" + type: "Convolution" + bottom: "res4d_branch2b" + top: "res4d_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 5.40000009537 + scale_out: 7.42999982834 + scale_params: 77.1500015259 + } +} +layer { + name: "bn4d_branch2c" + type: "BatchNorm" + bottom: "res4d_branch2c" + top: "res4d_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4d_branch2c" + type: "Scale" + bottom: "res4d_branch2c" + top: "res4d_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4d" + type: "Eltwise" + bottom: "res4c" + bottom: "res4d_branch2c" + top: "res4d" + eltwise_param { + } +} +layer { + name: "res4d_relu" + type: "ReLU" + bottom: "res4d" + top: "res4d" + relu_param { + } +} +layer { + name: "res4e_branch2a" + type: "Convolution" + bottom: "res4d" + top: "res4e_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 11.7600002289 + scale_params: 293.720001221 + } +} +layer { + name: "bn4e_branch2a" + type: "BatchNorm" + bottom: "res4e_branch2a" + top: "res4e_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4e_branch2a" + type: "Scale" + bottom: "res4e_branch2a" + top: "res4e_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4e_branch2a_relu" + type: "ReLU" + bottom: "res4e_branch2a" + top: "res4e_branch2a" + relu_param { + } +} +layer { + name: "res4e_branch2b" + type: "Convolution" + bottom: "res4e_branch2a" + top: "res4e_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.7600002289 + scale_out: 6.51999998093 + scale_params: 185.36000061 + } +} +layer { + name: "bn4e_branch2b" + type: "BatchNorm" + bottom: "res4e_branch2b" + top: "res4e_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4e_branch2b" + type: "Scale" + bottom: "res4e_branch2b" + top: "res4e_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4e_branch2b_relu" + type: "ReLU" + bottom: "res4e_branch2b" + top: "res4e_branch2b" + relu_param { + } +} +layer { + name: "res4e_branch2c" + type: "Convolution" + bottom: "res4e_branch2b" + top: "res4e_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 6.51999998093 + scale_out: 7.42999982834 + scale_params: 98.8199996948 + } +} +layer { + name: "bn4e_branch2c" + type: "BatchNorm" + bottom: "res4e_branch2c" + top: "res4e_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4e_branch2c" + type: "Scale" + bottom: "res4e_branch2c" + top: "res4e_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4e" + type: "Eltwise" + bottom: "res4d" + bottom: "res4e_branch2c" + top: "res4e" + eltwise_param { + } +} +layer { + name: "res4e_relu" + type: "ReLU" + bottom: "res4e" + top: "res4e" + relu_param { + } +} +layer { + name: "res4f_branch2a" + type: "Convolution" + bottom: "res4e" + top: "res4f_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 16.2900009155 + scale_params: 300.049987793 + } +} +layer { + name: "bn4f_branch2a" + type: "BatchNorm" + bottom: "res4f_branch2a" + top: "res4f_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4f_branch2a" + type: "Scale" + bottom: "res4f_branch2a" + top: "res4f_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4f_branch2a_relu" + type: "ReLU" + bottom: "res4f_branch2a" + top: "res4f_branch2a" + relu_param { + } +} +layer { + name: "res4f_branch2b" + type: "Convolution" + bottom: "res4f_branch2a" + top: "res4f_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 16.2900009155 + scale_out: 5.01999998093 + scale_params: 240.550003052 + } +} +layer { + name: "bn4f_branch2b" + type: "BatchNorm" + bottom: "res4f_branch2b" + top: "res4f_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4f_branch2b" + type: "Scale" + bottom: "res4f_branch2b" + top: "res4f_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4f_branch2b_relu" + type: "ReLU" + bottom: "res4f_branch2b" + top: "res4f_branch2b" + relu_param { + } +} +layer { + name: "res4f_branch2c" + type: "Convolution" + bottom: "res4f_branch2b" + top: "res4f_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 5.01999998093 + scale_out: 7.42999982834 + scale_params: 93.3000030518 + } +} +layer { + name: "bn4f_branch2c" + type: "BatchNorm" + bottom: "res4f_branch2c" + top: "res4f_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4f_branch2c" + type: "Scale" + bottom: "res4f_branch2c" + top: "res4f_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4f" + type: "Eltwise" + bottom: "res4e" + bottom: "res4f_branch2c" + top: "res4f" + eltwise_param { + } +} +layer { + name: "res4f_relu" + type: "ReLU" + bottom: "res4f" + top: "res4f" + relu_param { + } +} +layer { + name: "res5a_branch1" + type: "Convolution" + bottom: "res4f" + top: "res5a_branch1" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 0.939999997616 + scale_params: 45.0 + } +} +layer { + name: "bn5a_branch1" + type: "BatchNorm" + bottom: "res5a_branch1" + top: "res5a_branch1" + batch_norm_param { + } +} +layer { + name: "scale5a_branch1" + type: "Scale" + bottom: "res5a_branch1" + top: "res5a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res5a_branch2a" + type: "Convolution" + bottom: "res4f" + top: "res5a_branch2a" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.42999982834 + scale_out: 21.5699996948 + scale_params: 375.869995117 + } +} +layer { + name: "bn5a_branch2a" + type: "BatchNorm" + bottom: "res5a_branch2a" + top: "res5a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale5a_branch2a" + type: "Scale" + bottom: "res5a_branch2a" + top: "res5a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res5a_branch2a_relu" + type: "ReLU" + bottom: "res5a_branch2a" + top: "res5a_branch2a" + relu_param { + } +} +layer { + name: "res5a_branch2b" + type: "Convolution" + bottom: "res5a_branch2a" + top: "res5a_branch2b" + convolution_param { + num_output: 512 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 21.5699996948 + scale_out: 25.2000007629 + scale_params: 228.160003662 + } +} +layer { + name: "bn5a_branch2b" + type: "BatchNorm" + bottom: "res5a_branch2b" + top: "res5a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale5a_branch2b" + type: "Scale" + bottom: "res5a_branch2b" + top: "res5a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res5a_branch2b_relu" + type: "ReLU" + bottom: "res5a_branch2b" + top: "res5a_branch2b" + relu_param { + } +} +layer { + name: "res5a_branch2c" + type: "Convolution" + bottom: "res5a_branch2b" + top: "res5a_branch2c" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 25.2000007629 + scale_out: 1.87999999523 + scale_params: 27.1299991608 + } +} +layer { + name: "bn5a_branch2c" + type: "BatchNorm" + bottom: "res5a_branch2c" + top: "res5a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale5a_branch2c" + type: "Scale" + bottom: "res5a_branch2c" + top: "res5a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res5a" + type: "Eltwise" + bottom: "res5a_branch1" + bottom: "res5a_branch2c" + top: "res5a" + eltwise_param { + } +} +layer { + name: "res5a_relu" + type: "ReLU" + bottom: "res5a" + top: "res5a" + relu_param { + } +} +layer { + name: "res5b_branch2a" + type: "Convolution" + bottom: "res5a" + top: "res5b_branch2a" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 1.87999999523 + scale_out: 25.4400005341 + scale_params: 999.760009766 + } +} +layer { + name: "bn5b_branch2a" + type: "BatchNorm" + bottom: "res5b_branch2a" + top: "res5b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale5b_branch2a" + type: "Scale" + bottom: "res5b_branch2a" + top: "res5b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res5b_branch2a_relu" + type: "ReLU" + bottom: "res5b_branch2a" + top: "res5b_branch2a" + relu_param { + } +} +layer { + name: "res5b_branch2b" + type: "Convolution" + bottom: "res5b_branch2a" + top: "res5b_branch2b" + convolution_param { + num_output: 512 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 25.4400005341 + scale_out: 29.2800006866 + scale_params: 153.630004883 + } +} +layer { + name: "bn5b_branch2b" + type: "BatchNorm" + bottom: "res5b_branch2b" + top: "res5b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale5b_branch2b" + type: "Scale" + bottom: "res5b_branch2b" + top: "res5b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res5b_branch2b_relu" + type: "ReLU" + bottom: "res5b_branch2b" + top: "res5b_branch2b" + relu_param { + } +} +layer { + name: "res5b_branch2c" + type: "Convolution" + bottom: "res5b_branch2b" + top: "res5b_branch2c" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 29.2800006866 + scale_out: 1.87999999523 + scale_params: 35.3400001526 + } +} +layer { + name: "bn5b_branch2c" + type: "BatchNorm" + bottom: "res5b_branch2c" + top: "res5b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale5b_branch2c" + type: "Scale" + bottom: "res5b_branch2c" + top: "res5b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res5b" + type: "Eltwise" + bottom: "res5a" + bottom: "res5b_branch2c" + top: "res5b" + eltwise_param { + } +} +layer { + name: "res5b_relu" + type: "ReLU" + bottom: "res5b" + top: "res5b" + relu_param { + } +} +layer { + name: "res5c_branch2a" + type: "Convolution" + bottom: "res5b" + top: "res5c_branch2a" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 1.87999999523 + scale_out: 21.8099994659 + scale_params: 1013.09997559 + } +} +layer { + name: "bn5c_branch2a" + type: "BatchNorm" + bottom: "res5c_branch2a" + top: "res5c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale5c_branch2a" + type: "Scale" + bottom: "res5c_branch2a" + top: "res5c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res5c_branch2a_relu" + type: "ReLU" + bottom: "res5c_branch2a" + top: "res5c_branch2a" + relu_param { + } +} +layer { + name: "res5c_branch2b" + type: "Convolution" + bottom: "res5c_branch2a" + top: "res5c_branch2b" + convolution_param { + num_output: 512 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 21.8099994659 + scale_out: 14.7100000381 + scale_params: 321.25 + } +} +layer { + name: "bn5c_branch2b" + type: "BatchNorm" + bottom: "res5c_branch2b" + top: "res5c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale5c_branch2b" + type: "Scale" + bottom: "res5c_branch2b" + top: "res5c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res5c_branch2b_relu" + type: "ReLU" + bottom: "res5c_branch2b" + top: "res5c_branch2b" + relu_param { + } +} +layer { + name: "res5c_branch2c" + type: "Convolution" + bottom: "res5c_branch2b" + top: "res5c_branch2c" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.7100000381 + scale_out: 1.87999999523 + scale_params: 23.2399997711 + } +} +layer { + name: "bn5c_branch2c" + type: "BatchNorm" + bottom: "res5c_branch2c" + top: "res5c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale5c_branch2c" + type: "Scale" + bottom: "res5c_branch2c" + top: "res5c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res5c" + type: "Eltwise" + bottom: "res5b" + bottom: "res5c_branch2c" + top: "res5c" + eltwise_param { + } +} +layer { + name: "res5c_relu" + type: "ReLU" + bottom: "res5c" + top: "res5c" + relu_param { + } +} +layer { + name: "pool5" + type: "Pooling" + bottom: "res5c" + top: "pool5" + pooling_param { + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + name: "fc1000" + type: "InnerProduct" + bottom: "pool5" + top: "fc1000" + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.0 + } + } +} + diff --git a/models/intel_optimized_models/int8/resnet50_sparse_int8.prototxt b/models/intel_optimized_models/int8/resnet50_sparse_int8.prototxt new file mode 100644 index 000000000..22eb796ff --- /dev/null +++ b/models/intel_optimized_models/int8/resnet50_sparse_int8.prototxt @@ -0,0 +1,3068 @@ +# For INT8 reference +name: "ResNet-50" +layer { + name: "data" + type: "DummyData" + top: "data" + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape { + dim: 64 + dim: 3 + dim: 224 + dim: 224 + } + } +} +layer { + name: "data" + type: "DummyData" + top: "label" + dummy_data_param { + data_filler { + type: "constant" + } + shape { + dim: 64 + } + } +} +layer { + name: "conv1" + type: "Convolution" + bottom: "data" + top: "conv1" + convolution_param { + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } +} +layer { + name: "bn_conv1" + type: "BatchNorm" + bottom: "conv1" + top: "conv1" + batch_norm_param { + } +} +layer { + name: "scale_conv1" + type: "Scale" + bottom: "conv1" + top: "conv1" + scale_param { + bias_term: true + } +} +layer { + name: "conv1_relu" + type: "ReLU" + bottom: "conv1" + top: "conv1" + relu_param { + } +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "res2a_branch1" + type: "Convolution" + bottom: "pool1" + top: "res2a_branch1" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.38000011444 + scale_out: 6.03000020981 + scale_params: 75.9199981689 + } +} +layer { + name: "bn2a_branch1" + type: "BatchNorm" + bottom: "res2a_branch1" + top: "res2a_branch1" + batch_norm_param { + } +} +layer { + name: "scale2a_branch1" + type: "Scale" + bottom: "res2a_branch1" + top: "res2a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res2a_branch2a" + type: "Convolution" + bottom: "pool1" + top: "res2a_branch2a" + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.38000011444 + scale_out: 17.6599998474 + scale_params: 151.089996338 + } +} +layer { + name: "bn2a_branch2a" + type: "BatchNorm" + bottom: "res2a_branch2a" + top: "res2a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale2a_branch2a" + type: "Scale" + bottom: "res2a_branch2a" + top: "res2a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res2a_branch2a_relu" + type: "ReLU" + bottom: "res2a_branch2a" + top: "res2a_branch2a" + relu_param { + } +} +layer { + name: "res2a_branch2b" + type: "Convolution" + bottom: "res2a_branch2a" + top: "res2a_branch2b" + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 17.6599998474 + scale_out: 19.9799995422 + scale_params: 416.320007324 + } +} +layer { + name: "bn2a_branch2b" + type: "BatchNorm" + bottom: "res2a_branch2b" + top: "res2a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale2a_branch2b" + type: "Scale" + bottom: "res2a_branch2b" + top: "res2a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res2a_branch2b_relu" + type: "ReLU" + bottom: "res2a_branch2b" + top: "res2a_branch2b" + relu_param { + } +} +layer { + name: "res2a_branch2c" + type: "Convolution" + bottom: "res2a_branch2b" + top: "res2a_branch2c" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 19.9799995422 + scale_out: 12.1099996567 + scale_params: 72.1699981689 + } +} +layer { + name: "bn2a_branch2c" + type: "BatchNorm" + bottom: "res2a_branch2c" + top: "res2a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale2a_branch2c" + type: "Scale" + bottom: "res2a_branch2c" + top: "res2a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res2a" + type: "Eltwise" + bottom: "res2a_branch1" + bottom: "res2a_branch2c" + top: "res2a" + eltwise_param { + } +} +layer { + name: "res2a_relu" + type: "ReLU" + bottom: "res2a" + top: "res2a" + relu_param { + } +} +layer { + name: "res2b_branch2a" + type: "Convolution" + bottom: "res2a" + top: "res2b_branch2a" + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 12.1099996567 + scale_out: 17.9099998474 + scale_params: 192.330001831 + } +} +layer { + name: "bn2b_branch2a" + type: "BatchNorm" + bottom: "res2b_branch2a" + top: "res2b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale2b_branch2a" + type: "Scale" + bottom: "res2b_branch2a" + top: "res2b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res2b_branch2a_relu" + type: "ReLU" + bottom: "res2b_branch2a" + top: "res2b_branch2a" + relu_param { + } +} +layer { + name: "res2b_branch2b" + type: "Convolution" + bottom: "res2b_branch2a" + top: "res2b_branch2b" + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 17.9099998474 + scale_out: 19.5799999237 + scale_params: 210.529998779 + } +} +layer { + name: "bn2b_branch2b" + type: "BatchNorm" + bottom: "res2b_branch2b" + top: "res2b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale2b_branch2b" + type: "Scale" + bottom: "res2b_branch2b" + top: "res2b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res2b_branch2b_relu" + type: "ReLU" + bottom: "res2b_branch2b" + top: "res2b_branch2b" + relu_param { + } +} +layer { + name: "res2b_branch2c" + type: "Convolution" + bottom: "res2b_branch2b" + top: "res2b_branch2c" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 19.5799999237 + scale_out: 12.1099996567 + scale_params: 88.4599990845 + } +} +layer { + name: "bn2b_branch2c" + type: "BatchNorm" + bottom: "res2b_branch2c" + top: "res2b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale2b_branch2c" + type: "Scale" + bottom: "res2b_branch2c" + top: "res2b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res2b" + type: "Eltwise" + bottom: "res2a" + bottom: "res2b_branch2c" + top: "res2b" + eltwise_param { + } +} +layer { + name: "res2b_relu" + type: "ReLU" + bottom: "res2b" + top: "res2b" + relu_param { + } +} +layer { + name: "res2b_p" + type: "Pooling" + bottom: "res2b" + top: "res2b_p" + pooling_param { + pool: MAX + kernel_size: 1 + stride: 2 + } +} +layer { + name: "res2c_branch2a" + type: "Convolution" + bottom: "res2b" + top: "res2c_branch2a" + convolution_param { + num_output: 64 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 12.1099996567 + scale_out: 18.6000003815 + scale_params: 360.359985352 + } +} +layer { + name: "bn2c_branch2a" + type: "BatchNorm" + bottom: "res2c_branch2a" + top: "res2c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale2c_branch2a" + type: "Scale" + bottom: "res2c_branch2a" + top: "res2c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res2c_branch2a_relu" + type: "ReLU" + bottom: "res2c_branch2a" + top: "res2c_branch2a" + relu_param { + } +} +layer { + name: "res2c_branch2b" + type: "Convolution" + bottom: "res2c_branch2a" + top: "res2c_branch2b" + convolution_param { + num_output: 64 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 18.6000003815 + scale_out: 16.9200000763 + scale_params: 308.029998779 + } +} +layer { + name: "bn2c_branch2b" + type: "BatchNorm" + bottom: "res2c_branch2b" + top: "res2c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale2c_branch2b" + type: "Scale" + bottom: "res2c_branch2b" + top: "res2c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res2c_branch2b_relu" + type: "ReLU" + bottom: "res2c_branch2b" + top: "res2c_branch2b" + relu_param { + } +} +layer { + name: "res2c_branch2c" + type: "Convolution" + bottom: "res2c_branch2b" + top: "res2c_branch2c" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 16.9200000763 + scale_out: 11.5200004578 + scale_params: 103.910003662 + } +} +layer { + name: "bn2c_branch2c" + type: "BatchNorm" + bottom: "res2c_branch2c" + top: "res2c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale2c_branch2c" + type: "Scale" + bottom: "res2c_branch2c" + top: "res2c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res2c" + type: "Eltwise" + bottom: "res2b_p" + bottom: "res2c_branch2c" + top: "res2c" + eltwise_param { + } +} +layer { + name: "res2c_relu" + type: "ReLU" + bottom: "res2c" + top: "res2c" + relu_param { + } +} +layer { + name: "res3a_branch1" + type: "Convolution" + bottom: "res2c" + top: "res3a_branch1" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.5200004578 + scale_out: 4.65000009537 + scale_params: 135.169998169 + } +} +layer { + name: "bn3a_branch1" + type: "BatchNorm" + bottom: "res3a_branch1" + top: "res3a_branch1" + batch_norm_param { + } +} +layer { + name: "scale3a_branch1" + type: "Scale" + bottom: "res3a_branch1" + top: "res3a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res3a_branch2a" + type: "Convolution" + bottom: "res2c" + top: "res3a_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.5200004578 + scale_out: 19.0499992371 + scale_params: 277.709991455 + } +} +layer { + name: "bn3a_branch2a" + type: "BatchNorm" + bottom: "res3a_branch2a" + top: "res3a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3a_branch2a" + type: "Scale" + bottom: "res3a_branch2a" + top: "res3a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3a_branch2a_relu" + type: "ReLU" + bottom: "res3a_branch2a" + top: "res3a_branch2a" + relu_param { + } +} +layer { + name: "res3a_branch2b" + type: "Convolution" + bottom: "res3a_branch2a" + top: "res3a_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 19.0499992371 + scale_out: 25.5400009155 + scale_params: 320.339996338 + } +} +layer { + name: "bn3a_branch2b" + type: "BatchNorm" + bottom: "res3a_branch2b" + top: "res3a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3a_branch2b" + type: "Scale" + bottom: "res3a_branch2b" + top: "res3a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3a_branch2b_relu" + type: "ReLU" + bottom: "res3a_branch2b" + top: "res3a_branch2b" + relu_param { + } +} +layer { + name: "res3a_branch2c" + type: "Convolution" + bottom: "res3a_branch2b" + top: "res3a_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 25.5400009155 + scale_out: 9.32999992371 + scale_params: 65.7200012207 + } +} +layer { + name: "bn3a_branch2c" + type: "BatchNorm" + bottom: "res3a_branch2c" + top: "res3a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3a_branch2c" + type: "Scale" + bottom: "res3a_branch2c" + top: "res3a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3a" + type: "Eltwise" + bottom: "res3a_branch1" + bottom: "res3a_branch2c" + top: "res3a" + eltwise_param { + } +} +layer { + name: "res3a_relu" + type: "ReLU" + bottom: "res3a" + top: "res3a" + relu_param { + } +} +layer { + name: "res3b_branch2a" + type: "Convolution" + bottom: "res3a" + top: "res3b_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.32999992371 + scale_out: 24.1900005341 + scale_params: 493.920013428 + } +} +layer { + name: "bn3b_branch2a" + type: "BatchNorm" + bottom: "res3b_branch2a" + top: "res3b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3b_branch2a" + type: "Scale" + bottom: "res3b_branch2a" + top: "res3b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3b_branch2a_relu" + type: "ReLU" + bottom: "res3b_branch2a" + top: "res3b_branch2a" + relu_param { + } +} +layer { + name: "res3b_branch2b" + type: "Convolution" + bottom: "res3b_branch2a" + top: "res3b_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 24.1900005341 + scale_out: 20.4899997711 + scale_params: 308.959991455 + } +} +layer { + name: "bn3b_branch2b" + type: "BatchNorm" + bottom: "res3b_branch2b" + top: "res3b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3b_branch2b" + type: "Scale" + bottom: "res3b_branch2b" + top: "res3b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3b_branch2b_relu" + type: "ReLU" + bottom: "res3b_branch2b" + top: "res3b_branch2b" + relu_param { + } +} +layer { + name: "res3b_branch2c" + type: "Convolution" + bottom: "res3b_branch2b" + top: "res3b_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 20.4899997711 + scale_out: 9.32999992371 + scale_params: 55.6899986267 + } +} +layer { + name: "bn3b_branch2c" + type: "BatchNorm" + bottom: "res3b_branch2c" + top: "res3b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3b_branch2c" + type: "Scale" + bottom: "res3b_branch2c" + top: "res3b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3b" + type: "Eltwise" + bottom: "res3a" + bottom: "res3b_branch2c" + top: "res3b" + eltwise_param { + } +} +layer { + name: "res3b_relu" + type: "ReLU" + bottom: "res3b" + top: "res3b" + relu_param { + } +} +layer { + name: "res3c_branch2a" + type: "Convolution" + bottom: "res3b" + top: "res3c_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.32999992371 + scale_out: 9.35999965668 + scale_params: 142.929992676 + } +} +layer { + name: "bn3c_branch2a" + type: "BatchNorm" + bottom: "res3c_branch2a" + top: "res3c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3c_branch2a" + type: "Scale" + bottom: "res3c_branch2a" + top: "res3c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3c_branch2a_relu" + type: "ReLU" + bottom: "res3c_branch2a" + top: "res3c_branch2a" + relu_param { + } +} +layer { + name: "res3c_branch2b" + type: "Convolution" + bottom: "res3c_branch2a" + top: "res3c_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.35999965668 + scale_out: 3.70000004768 + scale_params: 88.1699981689 + } +} +layer { + name: "bn3c_branch2b" + type: "BatchNorm" + bottom: "res3c_branch2b" + top: "res3c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3c_branch2b" + type: "Scale" + bottom: "res3c_branch2b" + top: "res3c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3c_branch2b_relu" + type: "ReLU" + bottom: "res3c_branch2b" + top: "res3c_branch2b" + relu_param { + } +} +layer { + name: "res3c_branch2c" + type: "Convolution" + bottom: "res3c_branch2b" + top: "res3c_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 3.70000004768 + scale_out: 9.32999992371 + scale_params: 66.2300033569 + } +} +layer { + name: "bn3c_branch2c" + type: "BatchNorm" + bottom: "res3c_branch2c" + top: "res3c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3c_branch2c" + type: "Scale" + bottom: "res3c_branch2c" + top: "res3c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3c" + type: "Eltwise" + bottom: "res3b" + bottom: "res3c_branch2c" + top: "res3c" + eltwise_param { + } +} +layer { + name: "res3c_relu" + type: "ReLU" + bottom: "res3c" + top: "res3c" + relu_param { + } +} +layer { + name: "res3c_p" + type: "Pooling" + bottom: "res3c" + top: "res3c_p" + pooling_param { + pool: MAX + kernel_size: 1 + stride: 2 + } +} +layer { + name: "res3d_branch2a" + type: "Convolution" + bottom: "res3c" + top: "res3d_branch2a" + convolution_param { + num_output: 128 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.32999992371 + scale_out: 7.23000001907 + scale_params: 240.589996338 + } +} +layer { + name: "bn3d_branch2a" + type: "BatchNorm" + bottom: "res3d_branch2a" + top: "res3d_branch2a" + batch_norm_param { + } +} +layer { + name: "scale3d_branch2a" + type: "Scale" + bottom: "res3d_branch2a" + top: "res3d_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res3d_branch2a_relu" + type: "ReLU" + bottom: "res3d_branch2a" + top: "res3d_branch2a" + relu_param { + } +} +layer { + name: "res3d_branch2b" + type: "Convolution" + bottom: "res3d_branch2a" + top: "res3d_branch2b" + convolution_param { + num_output: 128 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 7.23000001907 + scale_out: 14.6999998093 + scale_params: 314.239990234 + } +} +layer { + name: "bn3d_branch2b" + type: "BatchNorm" + bottom: "res3d_branch2b" + top: "res3d_branch2b" + batch_norm_param { + } +} +layer { + name: "scale3d_branch2b" + type: "Scale" + bottom: "res3d_branch2b" + top: "res3d_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res3d_branch2b_relu" + type: "ReLU" + bottom: "res3d_branch2b" + top: "res3d_branch2b" + relu_param { + } +} +layer { + name: "res3d_branch2c" + type: "Convolution" + bottom: "res3d_branch2b" + top: "res3d_branch2c" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.6999998093 + scale_out: 9.82999992371 + scale_params: 113.980003357 + } +} +layer { + name: "bn3d_branch2c" + type: "BatchNorm" + bottom: "res3d_branch2c" + top: "res3d_branch2c" + batch_norm_param { + } +} +layer { + name: "scale3d_branch2c" + type: "Scale" + bottom: "res3d_branch2c" + top: "res3d_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res3d" + type: "Eltwise" + bottom: "res3c_p" + bottom: "res3d_branch2c" + top: "res3d" + eltwise_param { + } +} +layer { + name: "res3d_relu" + type: "ReLU" + bottom: "res3d" + top: "res3d" + relu_param { + } +} +layer { + name: "res4a_branch1" + type: "Convolution" + bottom: "res3d" + top: "res4a_branch1" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.82999992371 + scale_out: 4.28000020981 + scale_params: 213.380004883 + } +} +layer { + name: "bn4a_branch1" + type: "BatchNorm" + bottom: "res4a_branch1" + top: "res4a_branch1" + batch_norm_param { + } +} +layer { + name: "scale4a_branch1" + type: "Scale" + bottom: "res4a_branch1" + top: "res4a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res4a_branch2a" + type: "Convolution" + bottom: "res3d" + top: "res4a_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 9.82999992371 + scale_out: 12.3900003433 + scale_params: 254.339996338 + } +} +layer { + name: "bn4a_branch2a" + type: "BatchNorm" + bottom: "res4a_branch2a" + top: "res4a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4a_branch2a" + type: "Scale" + bottom: "res4a_branch2a" + top: "res4a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4a_branch2a_relu" + type: "ReLU" + bottom: "res4a_branch2a" + top: "res4a_branch2a" + relu_param { + } +} +layer { + name: "res4a_branch2b" + type: "Convolution" + bottom: "res4a_branch2a" + top: "res4a_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 12.3900003433 + scale_out: 14.8900003433 + scale_params: 473.709991455 + } +} +layer { + name: "bn4a_branch2b" + type: "BatchNorm" + bottom: "res4a_branch2b" + top: "res4a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4a_branch2b" + type: "Scale" + bottom: "res4a_branch2b" + top: "res4a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4a_branch2b_relu" + type: "ReLU" + bottom: "res4a_branch2b" + top: "res4a_branch2b" + relu_param { + } +} +layer { + name: "res4a_branch2c" + type: "Convolution" + bottom: "res4a_branch2b" + top: "res4a_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.8900003433 + scale_out: 8.60000038147 + scale_params: 75.6200027466 + } +} +layer { + name: "bn4a_branch2c" + type: "BatchNorm" + bottom: "res4a_branch2c" + top: "res4a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4a_branch2c" + type: "Scale" + bottom: "res4a_branch2c" + top: "res4a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4a" + type: "Eltwise" + bottom: "res4a_branch1" + bottom: "res4a_branch2c" + top: "res4a" + eltwise_param { + } +} +layer { + name: "res4a_relu" + type: "ReLU" + bottom: "res4a" + top: "res4a" + relu_param { + } +} +layer { + name: "res4b_branch2a" + type: "Convolution" + bottom: "res4a" + top: "res4b_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.60000038147 + scale_out: 12.0799999237 + scale_params: 325.369995117 + } +} +layer { + name: "bn4b_branch2a" + type: "BatchNorm" + bottom: "res4b_branch2a" + top: "res4b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4b_branch2a" + type: "Scale" + bottom: "res4b_branch2a" + top: "res4b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4b_branch2a_relu" + type: "ReLU" + bottom: "res4b_branch2a" + top: "res4b_branch2a" + relu_param { + } +} +layer { + name: "res4b_branch2b" + type: "Convolution" + bottom: "res4b_branch2a" + top: "res4b_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 12.0799999237 + scale_out: 6.30999994278 + scale_params: 131.820007324 + } +} +layer { + name: "bn4b_branch2b" + type: "BatchNorm" + bottom: "res4b_branch2b" + top: "res4b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4b_branch2b" + type: "Scale" + bottom: "res4b_branch2b" + top: "res4b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4b_branch2b_relu" + type: "ReLU" + bottom: "res4b_branch2b" + top: "res4b_branch2b" + relu_param { + } +} +layer { + name: "res4b_branch2c" + type: "Convolution" + bottom: "res4b_branch2b" + top: "res4b_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 6.30999994278 + scale_out: 8.60000038147 + scale_params: 67.4400024414 + } +} +layer { + name: "bn4b_branch2c" + type: "BatchNorm" + bottom: "res4b_branch2c" + top: "res4b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4b_branch2c" + type: "Scale" + bottom: "res4b_branch2c" + top: "res4b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4b" + type: "Eltwise" + bottom: "res4a" + bottom: "res4b_branch2c" + top: "res4b" + eltwise_param { + } +} +layer { + name: "res4b_relu" + type: "ReLU" + bottom: "res4b" + top: "res4b" + relu_param { + } +} +layer { + name: "res4c_branch2a" + type: "Convolution" + bottom: "res4b" + top: "res4c_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.60000038147 + scale_out: 11.4099998474 + scale_params: 369.480010986 + } +} +layer { + name: "bn4c_branch2a" + type: "BatchNorm" + bottom: "res4c_branch2a" + top: "res4c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4c_branch2a" + type: "Scale" + bottom: "res4c_branch2a" + top: "res4c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4c_branch2a_relu" + type: "ReLU" + bottom: "res4c_branch2a" + top: "res4c_branch2a" + relu_param { + } +} +layer { + name: "res4c_branch2b" + type: "Convolution" + bottom: "res4c_branch2a" + top: "res4c_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.4099998474 + scale_out: 6.90999984741 + scale_params: 139.050003052 + } +} +layer { + name: "bn4c_branch2b" + type: "BatchNorm" + bottom: "res4c_branch2b" + top: "res4c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4c_branch2b" + type: "Scale" + bottom: "res4c_branch2b" + top: "res4c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4c_branch2b_relu" + type: "ReLU" + bottom: "res4c_branch2b" + top: "res4c_branch2b" + relu_param { + } +} +layer { + name: "res4c_branch2c" + type: "Convolution" + bottom: "res4c_branch2b" + top: "res4c_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 6.90999984741 + scale_out: 8.60000038147 + scale_params: 76.9700012207 + } +} +layer { + name: "bn4c_branch2c" + type: "BatchNorm" + bottom: "res4c_branch2c" + top: "res4c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4c_branch2c" + type: "Scale" + bottom: "res4c_branch2c" + top: "res4c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4c" + type: "Eltwise" + bottom: "res4b" + bottom: "res4c_branch2c" + top: "res4c" + eltwise_param { + } +} +layer { + name: "res4c_relu" + type: "ReLU" + bottom: "res4c" + top: "res4c" + relu_param { + } +} +layer { + name: "res4d_branch2a" + type: "Convolution" + bottom: "res4c" + top: "res4d_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.60000038147 + scale_out: 10.7299995422 + scale_params: 312.220001221 + } +} +layer { + name: "bn4d_branch2a" + type: "BatchNorm" + bottom: "res4d_branch2a" + top: "res4d_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4d_branch2a" + type: "Scale" + bottom: "res4d_branch2a" + top: "res4d_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4d_branch2a_relu" + type: "ReLU" + bottom: "res4d_branch2a" + top: "res4d_branch2a" + relu_param { + } +} +layer { + name: "res4d_branch2b" + type: "Convolution" + bottom: "res4d_branch2a" + top: "res4d_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 10.7299995422 + scale_out: 5.40000009537 + scale_params: 201.61000061 + } +} +layer { + name: "bn4d_branch2b" + type: "BatchNorm" + bottom: "res4d_branch2b" + top: "res4d_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4d_branch2b" + type: "Scale" + bottom: "res4d_branch2b" + top: "res4d_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4d_branch2b_relu" + type: "ReLU" + bottom: "res4d_branch2b" + top: "res4d_branch2b" + relu_param { + } +} +layer { + name: "res4d_branch2c" + type: "Convolution" + bottom: "res4d_branch2b" + top: "res4d_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 5.40000009537 + scale_out: 8.60000038147 + scale_params: 77.1500015259 + } +} +layer { + name: "bn4d_branch2c" + type: "BatchNorm" + bottom: "res4d_branch2c" + top: "res4d_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4d_branch2c" + type: "Scale" + bottom: "res4d_branch2c" + top: "res4d_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4d" + type: "Eltwise" + bottom: "res4c" + bottom: "res4d_branch2c" + top: "res4d" + eltwise_param { + } +} +layer { + name: "res4d_relu" + type: "ReLU" + bottom: "res4d" + top: "res4d" + relu_param { + } +} +layer { + name: "res4e_branch2a" + type: "Convolution" + bottom: "res4d" + top: "res4e_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.60000038147 + scale_out: 11.75 + scale_params: 293.720001221 + } +} +layer { + name: "bn4e_branch2a" + type: "BatchNorm" + bottom: "res4e_branch2a" + top: "res4e_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4e_branch2a" + type: "Scale" + bottom: "res4e_branch2a" + top: "res4e_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4e_branch2a_relu" + type: "ReLU" + bottom: "res4e_branch2a" + top: "res4e_branch2a" + relu_param { + } +} +layer { + name: "res4e_branch2b" + type: "Convolution" + bottom: "res4e_branch2a" + top: "res4e_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 11.75 + scale_out: 6.51999998093 + scale_params: 185.36000061 + } +} +layer { + name: "bn4e_branch2b" + type: "BatchNorm" + bottom: "res4e_branch2b" + top: "res4e_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4e_branch2b" + type: "Scale" + bottom: "res4e_branch2b" + top: "res4e_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4e_branch2b_relu" + type: "ReLU" + bottom: "res4e_branch2b" + top: "res4e_branch2b" + relu_param { + } +} +layer { + name: "res4e_branch2c" + type: "Convolution" + bottom: "res4e_branch2b" + top: "res4e_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 6.51999998093 + scale_out: 8.60000038147 + scale_params: 98.8199996948 + } +} +layer { + name: "bn4e_branch2c" + type: "BatchNorm" + bottom: "res4e_branch2c" + top: "res4e_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4e_branch2c" + type: "Scale" + bottom: "res4e_branch2c" + top: "res4e_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4e" + type: "Eltwise" + bottom: "res4d" + bottom: "res4e_branch2c" + top: "res4e" + eltwise_param { + } +} +layer { + name: "res4e_relu" + type: "ReLU" + bottom: "res4e" + top: "res4e" + relu_param { + } +} +layer { + name: "res4e_p" + type: "Pooling" + bottom: "res4e" + top: "res4e_p" + pooling_param { + pool: MAX + kernel_size: 1 + stride: 2 + } +} +layer { + name: "res4f_branch2a" + type: "Convolution" + bottom: "res4e" + top: "res4f_branch2a" + convolution_param { + num_output: 256 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.60000038147 + scale_out: 16.2900009155 + scale_params: 300.049987793 + } +} +layer { + name: "bn4f_branch2a" + type: "BatchNorm" + bottom: "res4f_branch2a" + top: "res4f_branch2a" + batch_norm_param { + } +} +layer { + name: "scale4f_branch2a" + type: "Scale" + bottom: "res4f_branch2a" + top: "res4f_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res4f_branch2a_relu" + type: "ReLU" + bottom: "res4f_branch2a" + top: "res4f_branch2a" + relu_param { + } +} +layer { + name: "res4f_branch2b" + type: "Convolution" + bottom: "res4f_branch2a" + top: "res4f_branch2b" + convolution_param { + num_output: 256 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 16.2900009155 + scale_out: 16.6200008392 + scale_params: 240.550003052 + } +} +layer { + name: "bn4f_branch2b" + type: "BatchNorm" + bottom: "res4f_branch2b" + top: "res4f_branch2b" + batch_norm_param { + } +} +layer { + name: "scale4f_branch2b" + type: "Scale" + bottom: "res4f_branch2b" + top: "res4f_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res4f_branch2b_relu" + type: "ReLU" + bottom: "res4f_branch2b" + top: "res4f_branch2b" + relu_param { + } +} +layer { + name: "res4f_branch2c" + type: "Convolution" + bottom: "res4f_branch2b" + top: "res4f_branch2c" + convolution_param { + num_output: 1024 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 16.6200008392 + scale_out: 8.5 + scale_params: 93.3000030518 + } +} +layer { + name: "bn4f_branch2c" + type: "BatchNorm" + bottom: "res4f_branch2c" + top: "res4f_branch2c" + batch_norm_param { + } +} +layer { + name: "scale4f_branch2c" + type: "Scale" + bottom: "res4f_branch2c" + top: "res4f_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res4f" + type: "Eltwise" + bottom: "res4e_p" + bottom: "res4f_branch2c" + top: "res4f" + eltwise_param { + } +} +layer { + name: "res4f_relu" + type: "ReLU" + bottom: "res4f" + top: "res4f" + relu_param { + } +} +layer { + name: "res5a_branch1" + type: "Convolution" + bottom: "res4f" + top: "res5a_branch1" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.5 + scale_out: 0.939999997616 + scale_params: 45.0 + } +} +layer { + name: "bn5a_branch1" + type: "BatchNorm" + bottom: "res5a_branch1" + top: "res5a_branch1" + batch_norm_param { + } +} +layer { + name: "scale5a_branch1" + type: "Scale" + bottom: "res5a_branch1" + top: "res5a_branch1" + scale_param { + bias_term: true + } +} +layer { + name: "res5a_branch2a" + type: "Convolution" + bottom: "res4f" + top: "res5a_branch2a" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 8.5 + scale_out: 21.5699996948 + scale_params: 375.869995117 + } +} +layer { + name: "bn5a_branch2a" + type: "BatchNorm" + bottom: "res5a_branch2a" + top: "res5a_branch2a" + batch_norm_param { + } +} +layer { + name: "scale5a_branch2a" + type: "Scale" + bottom: "res5a_branch2a" + top: "res5a_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res5a_branch2a_relu" + type: "ReLU" + bottom: "res5a_branch2a" + top: "res5a_branch2a" + relu_param { + } +} +layer { + name: "res5a_branch2b" + type: "Convolution" + bottom: "res5a_branch2a" + top: "res5a_branch2b" + convolution_param { + num_output: 512 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 21.5699996948 + scale_out: 25.2000007629 + scale_params: 228.160003662 + } +} +layer { + name: "bn5a_branch2b" + type: "BatchNorm" + bottom: "res5a_branch2b" + top: "res5a_branch2b" + batch_norm_param { + } +} +layer { + name: "scale5a_branch2b" + type: "Scale" + bottom: "res5a_branch2b" + top: "res5a_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res5a_branch2b_relu" + type: "ReLU" + bottom: "res5a_branch2b" + top: "res5a_branch2b" + relu_param { + } +} +layer { + name: "res5a_branch2c" + type: "Convolution" + bottom: "res5a_branch2b" + top: "res5a_branch2c" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 25.2000007629 + scale_out: 1.87999999523 + scale_params: 27.1299991608 + } +} +layer { + name: "bn5a_branch2c" + type: "BatchNorm" + bottom: "res5a_branch2c" + top: "res5a_branch2c" + batch_norm_param { + } +} +layer { + name: "scale5a_branch2c" + type: "Scale" + bottom: "res5a_branch2c" + top: "res5a_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res5a" + type: "Eltwise" + bottom: "res5a_branch1" + bottom: "res5a_branch2c" + top: "res5a" + eltwise_param { + } +} +layer { + name: "res5a_relu" + type: "ReLU" + bottom: "res5a" + top: "res5a" + relu_param { + } +} +layer { + name: "res5b_branch2a" + type: "Convolution" + bottom: "res5a" + top: "res5b_branch2a" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 1.87999999523 + scale_out: 25.4400005341 + scale_params: 999.760009766 + } +} +layer { + name: "bn5b_branch2a" + type: "BatchNorm" + bottom: "res5b_branch2a" + top: "res5b_branch2a" + batch_norm_param { + } +} +layer { + name: "scale5b_branch2a" + type: "Scale" + bottom: "res5b_branch2a" + top: "res5b_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res5b_branch2a_relu" + type: "ReLU" + bottom: "res5b_branch2a" + top: "res5b_branch2a" + relu_param { + } +} +layer { + name: "res5b_branch2b" + type: "Convolution" + bottom: "res5b_branch2a" + top: "res5b_branch2b" + convolution_param { + num_output: 512 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 25.4400005341 + scale_out: 26.6200008392 + scale_params: 153.630004883 + } +} +layer { + name: "bn5b_branch2b" + type: "BatchNorm" + bottom: "res5b_branch2b" + top: "res5b_branch2b" + batch_norm_param { + } +} +layer { + name: "scale5b_branch2b" + type: "Scale" + bottom: "res5b_branch2b" + top: "res5b_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res5b_branch2b_relu" + type: "ReLU" + bottom: "res5b_branch2b" + top: "res5b_branch2b" + relu_param { + } +} +layer { + name: "res5b_branch2c" + type: "Convolution" + bottom: "res5b_branch2b" + top: "res5b_branch2c" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 26.6200008392 + scale_out: 1.87999999523 + scale_params: 35.3400001526 + } +} +layer { + name: "bn5b_branch2c" + type: "BatchNorm" + bottom: "res5b_branch2c" + top: "res5b_branch2c" + batch_norm_param { + } +} +layer { + name: "scale5b_branch2c" + type: "Scale" + bottom: "res5b_branch2c" + top: "res5b_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res5b" + type: "Eltwise" + bottom: "res5a" + bottom: "res5b_branch2c" + top: "res5b" + eltwise_param { + } +} +layer { + name: "res5b_relu" + type: "ReLU" + bottom: "res5b" + top: "res5b" + relu_param { + } +} +layer { + name: "res5c_branch2a" + type: "Convolution" + bottom: "res5b" + top: "res5c_branch2a" + convolution_param { + num_output: 512 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 1.87999999523 + scale_out: 21.8099994659 + scale_params: 1013.09997559 + } +} +layer { + name: "bn5c_branch2a" + type: "BatchNorm" + bottom: "res5c_branch2a" + top: "res5c_branch2a" + batch_norm_param { + } +} +layer { + name: "scale5c_branch2a" + type: "Scale" + bottom: "res5c_branch2a" + top: "res5c_branch2a" + scale_param { + bias_term: true + } +} +layer { + name: "res5c_branch2a_relu" + type: "ReLU" + bottom: "res5c_branch2a" + top: "res5c_branch2a" + relu_param { + } +} +layer { + name: "res5c_branch2b" + type: "Convolution" + bottom: "res5c_branch2a" + top: "res5c_branch2b" + convolution_param { + num_output: 512 + bias_term: false + pad: 1 + kernel_size: 3 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 21.8099994659 + scale_out: 14.7100000381 + scale_params: 321.25 + } +} +layer { + name: "bn5c_branch2b" + type: "BatchNorm" + bottom: "res5c_branch2b" + top: "res5c_branch2b" + batch_norm_param { + } +} +layer { + name: "scale5c_branch2b" + type: "Scale" + bottom: "res5c_branch2b" + top: "res5c_branch2b" + scale_param { + bias_term: true + } +} +layer { + name: "res5c_branch2b_relu" + type: "ReLU" + bottom: "res5c_branch2b" + top: "res5c_branch2b" + relu_param { + } +} +layer { + name: "res5c_branch2c" + type: "Convolution" + bottom: "res5c_branch2b" + top: "res5c_branch2c" + convolution_param { + num_output: 2048 + bias_term: false + pad: 0 + kernel_size: 1 + stride: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.20000000298 + } + } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.7100000381 + scale_out: 1.87999999523 + scale_params: 23.2399997711 + } +} +layer { + name: "bn5c_branch2c" + type: "BatchNorm" + bottom: "res5c_branch2c" + top: "res5c_branch2c" + batch_norm_param { + } +} +layer { + name: "scale5c_branch2c" + type: "Scale" + bottom: "res5c_branch2c" + top: "res5c_branch2c" + scale_param { + bias_term: true + } +} +layer { + name: "res5c" + type: "Eltwise" + bottom: "res5b" + bottom: "res5c_branch2c" + top: "res5c" + eltwise_param { + } +} +layer { + name: "res5c_relu" + type: "ReLU" + bottom: "res5c" + top: "res5c" + relu_param { + } +} +layer { + name: "pool5" + type: "Pooling" + bottom: "res5c" + top: "pool5" + pooling_param { + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + name: "fc1000" + type: "InnerProduct" + bottom: "pool5" + top: "fc1000" + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.0 + } + } +} + diff --git a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy_mkl2017.prototxt b/models/intel_optimized_models/int8/ssd_int8.prototxt similarity index 61% rename from models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy_mkl2017.prototxt rename to models/intel_optimized_models/int8/ssd_int8.prototxt index 6d03b44f3..4a0ed0332 100644 --- a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy_mkl2017.prototxt +++ b/models/intel_optimized_models/int8/ssd_int8.prototxt @@ -1,24 +1,51 @@ -name: "VGG_VOC0712_SSD_300x300_deploy" -input: "data" -input_shape { - dim: 1 - dim: 3 - dim: 300 - dim: 300 +# For INT8 reference +name: "VGG_VOC0712_SSD_300x300_test" +layer { + name: "data" + type: "DummyData" + top: "data" + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape { + dim: 32 + dim: 3 + dim: 300 + dim: 300 + } + } +} +layer { + name: "data" + type: "DummyData" + top: "label" + dummy_data_param { + data_filler { + type: "constant" + value: 1 + } + shape { + dim: 1 + dim: 1 + dim: 1 + dim: 8 + } + } } layer { - engine: "MKL2017" name: "conv1_1" type: "Convolution" bottom: "data" top: "conv1_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 64 @@ -29,30 +56,28 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } } layer { - engine: "MKL2017" name: "relu1_1" type: "ReLU" bottom: "conv1_1" top: "conv1_1" } layer { - engine: "MKL2017" name: "conv1_2" type: "Convolution" bottom: "conv1_1" top: "conv1_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 64 @@ -63,19 +88,26 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.319999992847 + scale_out: 0.0799999982119 + scale_params: 454.859985352 + } } layer { - engine: "MKL2017" name: "relu1_2" type: "ReLU" bottom: "conv1_2" top: "conv1_2" } layer { - engine: "MKL2017" name: "pool1" type: "Pooling" bottom: "conv1_2" @@ -87,18 +119,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv2_1" type: "Convolution" bottom: "pool1" top: "conv2_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 128 @@ -109,30 +140,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0799999982119 + scale_out: 0.0599999986589 + scale_params: 299.019989014 + } } layer { - engine: "MKL2017" name: "relu2_1" type: "ReLU" bottom: "conv2_1" top: "conv2_1" } layer { - engine: "MKL2017" name: "conv2_2" type: "Convolution" bottom: "conv2_1" top: "conv2_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 128 @@ -143,19 +181,26 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0599999986589 + scale_out: 0.0500000007451 + scale_params: 540.909973145 + } } layer { - engine: "MKL2017" name: "relu2_2" type: "ReLU" bottom: "conv2_2" top: "conv2_2" } layer { - engine: "MKL2017" name: "pool2" type: "Pooling" bottom: "conv2_2" @@ -167,18 +212,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv3_1" type: "Convolution" bottom: "pool2" top: "conv3_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -189,30 +233,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0500000007451 + scale_out: 0.0399999991059 + scale_params: 256.5 + } } layer { - engine: "MKL2017" name: "relu3_1" type: "ReLU" bottom: "conv3_1" top: "conv3_1" } layer { - engine: "MKL2017" name: "conv3_2" type: "Convolution" bottom: "conv3_1" top: "conv3_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -223,30 +274,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0399999991059 + scale_out: 0.0500000007451 + scale_params: 306.799987793 + } } layer { - engine: "MKL2017" name: "relu3_2" type: "ReLU" bottom: "conv3_2" top: "conv3_2" } layer { - engine: "MKL2017" name: "conv3_3" type: "Convolution" bottom: "conv3_2" top: "conv3_3" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -257,19 +315,26 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0500000007451 + scale_out: 0.0599999986589 + scale_params: 352.630004883 + } } layer { - engine: "MKL2017" name: "relu3_3" type: "ReLU" bottom: "conv3_3" top: "conv3_3" } layer { - engine: "MKL2017" name: "pool3" type: "Pooling" bottom: "conv3_3" @@ -281,18 +346,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv4_1" type: "Convolution" bottom: "pool3" top: "conv4_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -303,30 +367,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0599999986589 + scale_out: 0.0799999982119 + scale_params: 478.589996338 + } } layer { - engine: "MKL2017" name: "relu4_1" type: "ReLU" bottom: "conv4_1" top: "conv4_1" } layer { - engine: "MKL2017" name: "conv4_2" type: "Convolution" bottom: "conv4_1" top: "conv4_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -337,30 +408,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.0799999982119 + scale_out: 0.180000007153 + scale_params: 485.910003662 + } } layer { - engine: "MKL2017" name: "relu4_2" type: "ReLU" bottom: "conv4_2" top: "conv4_2" } layer { - engine: "MKL2017" name: "conv4_3" type: "Convolution" bottom: "conv4_2" top: "conv4_3" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -371,19 +449,26 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.180000007153 + scale_out: 0.40000000596 + scale_params: 552.33001709 + } } layer { - engine: "MKL2017" name: "relu4_3" type: "ReLU" bottom: "conv4_3" top: "conv4_3" } layer { - engine: "MKL2017" name: "pool4" type: "Pooling" bottom: "conv4_3" @@ -395,18 +480,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv5_1" type: "Convolution" bottom: "pool4" top: "conv5_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -417,31 +501,38 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } dilation: 1 } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.40000000596 + scale_out: 0.550000011921 + scale_params: 766.260009766 + } } layer { - engine: "MKL2017" name: "relu5_1" type: "ReLU" bottom: "conv5_1" top: "conv5_1" } layer { - engine: "MKL2017" name: "conv5_2" type: "Convolution" bottom: "conv5_1" top: "conv5_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -452,31 +543,38 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } dilation: 1 } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 0.550000011921 + scale_out: 1.16999995708 + scale_params: 838.429992676 + } } layer { - engine: "MKL2017" name: "relu5_2" type: "ReLU" bottom: "conv5_2" top: "conv5_2" } layer { - engine: "MKL2017" name: "conv5_3" type: "Convolution" bottom: "conv5_2" top: "conv5_3" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -487,44 +585,50 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } dilation: 1 } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 1.16999995708 + scale_out: 1.78999996185 + scale_params: 717.200012207 + } } layer { - engine: "MKL2017" name: "relu5_3" type: "ReLU" bottom: "conv5_3" top: "conv5_3" } layer { - engine: "MKL2017" name: "pool5" type: "Pooling" bottom: "conv5_3" top: "pool5" pooling_param { pool: MAX + pad: 1 kernel_size: 3 stride: 1 - pad: 1 } } layer { - engine: "MKL2017" name: "fc6" type: "Convolution" bottom: "pool5" top: "fc6" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 1024 @@ -535,31 +639,38 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } dilation: 6 } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 1.78999996185 + scale_out: 5.80999994278 + scale_params: 581.219970703 + } } layer { - engine: "MKL2017" name: "relu6" type: "ReLU" bottom: "fc6" top: "fc6" } layer { - engine: "MKL2017" name: "fc7" type: "Convolution" bottom: "fc6" top: "fc7" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 1024 @@ -569,30 +680,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 5.80999994278 + scale_out: 23.5200004578 + scale_params: 937.08001709 + } } layer { - engine: "MKL2017" name: "relu7" type: "ReLU" bottom: "fc7" top: "fc7" } layer { - engine: "MKL2017" name: "conv6_1" type: "Convolution" bottom: "fc7" top: "conv6_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -604,30 +722,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 23.5200004578 + scale_out: 41.3400001526 + scale_params: 590.469970703 + } } layer { - engine: "MKL2017" name: "conv6_1_relu" type: "ReLU" bottom: "conv6_1" top: "conv6_1" } layer { - engine: "MKL2017" name: "conv6_2" type: "Convolution" bottom: "conv6_1" top: "conv6_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 512 @@ -639,30 +764,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 41.3400001526 + scale_out: 32.3899993896 + scale_params: 1789.36999512 + } } layer { - engine: "MKL2017" name: "conv6_2_relu" type: "ReLU" bottom: "conv6_2" top: "conv6_2" } layer { - engine: "MKL2017" name: "conv7_1" type: "Convolution" bottom: "conv6_2" top: "conv7_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 128 @@ -674,30 +806,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 32.3899993896 + scale_out: 20.6700000763 + scale_params: 882.909973145 + } } layer { - engine: "MKL2017" name: "conv7_1_relu" type: "ReLU" bottom: "conv7_1" top: "conv7_1" } layer { - engine: "MKL2017" name: "conv7_2" type: "Convolution" bottom: "conv7_1" top: "conv7_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -709,30 +848,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 20.6700000763 + scale_out: 14.25 + scale_params: 1246.82995605 + } } layer { - engine: "MKL2017" name: "conv7_2_relu" type: "ReLU" bottom: "conv7_2" top: "conv7_2" } layer { - engine: "MKL2017" name: "conv8_1" type: "Convolution" bottom: "conv7_2" top: "conv8_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 128 @@ -744,30 +890,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.25 + scale_out: 18.6299991608 + scale_params: 646.679992676 + } } layer { - engine: "MKL2017" name: "conv8_1_relu" type: "ReLU" bottom: "conv8_1" top: "conv8_1" } layer { - engine: "MKL2017" name: "conv8_2" type: "Convolution" bottom: "conv8_1" top: "conv8_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -779,30 +932,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 18.6299991608 + scale_out: 18.4300003052 + scale_params: 1516.22998047 + } } layer { - engine: "MKL2017" name: "conv8_2_relu" type: "ReLU" bottom: "conv8_2" top: "conv8_2" } layer { - engine: "MKL2017" name: "conv9_1" type: "Convolution" bottom: "conv8_2" top: "conv9_1" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 128 @@ -814,30 +974,37 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 18.4300003052 + scale_out: 16.2800006866 + scale_params: 864.780029297 + } } layer { - engine: "MKL2017" name: "conv9_1_relu" type: "ReLU" bottom: "conv9_1" top: "conv9_1" } layer { - engine: "MKL2017" name: "conv9_2" type: "Convolution" bottom: "conv9_1" top: "conv9_2" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 256 @@ -849,12 +1016,20 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 16.2800006866 + scale_out: 10.6199998856 + scale_params: 1733.91003418 + } } layer { - engine: "MKL2017" name: "conv9_2_relu" type: "ReLU" bottom: "conv9_2" @@ -869,7 +1044,7 @@ layer { across_spatial: false scale_filler { type: "constant" - value: 20 + value: 20.0 } channel_shared: false } @@ -880,12 +1055,12 @@ layer { bottom: "conv4_3_norm" top: "conv4_3_norm_mbox_loc" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 16 @@ -897,9 +1072,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 22.3600006104 + scale_out: 9.88000011444 + scale_params: 247.979995728 + } } layer { name: "conv4_3_norm_mbox_loc_perm" @@ -928,12 +1112,12 @@ layer { bottom: "conv4_3_norm" top: "conv4_3_norm_mbox_conf" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 84 @@ -945,10 +1129,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } - engine: "CAFFE" + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 22.3600006104 + scale_out: 9.13000011444 + scale_params: 793.659973145 + } } layer { name: "conv4_3_norm_mbox_conf_perm" @@ -980,30 +1172,29 @@ layer { prior_box_param { min_size: 30.0 max_size: 60.0 - aspect_ratio: 2 + aspect_ratio: 2.0 flip: true clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 8 + variance: 0.10000000149 + variance: 0.10000000149 + variance: 0.20000000298 + variance: 0.20000000298 + step: 8.0 offset: 0.5 } } layer { - engine: "MKL2017" name: "fc7_mbox_loc" type: "Convolution" bottom: "fc7" top: "fc7_mbox_loc" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 24 @@ -1015,9 +1206,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 23.5200004578 + scale_out: 28.1800003052 + scale_params: 1580.34997559 + } } layer { name: "fc7_mbox_loc_perm" @@ -1046,12 +1246,12 @@ layer { bottom: "fc7" top: "fc7_mbox_conf" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 126 @@ -1063,10 +1263,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } - engine: "CAFFE" + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 23.5200004578 + scale_out: 4.11999988556 + scale_params: 975.270019531 + } } layer { name: "fc7_mbox_conf_perm" @@ -1098,31 +1306,30 @@ layer { prior_box_param { min_size: 60.0 max_size: 111.0 - aspect_ratio: 2 - aspect_ratio: 3 + aspect_ratio: 2.0 + aspect_ratio: 3.0 flip: true clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 16 + variance: 0.10000000149 + variance: 0.10000000149 + variance: 0.20000000298 + variance: 0.20000000298 + step: 16.0 offset: 0.5 } } layer { - engine: "MKL2017" name: "conv6_2_mbox_loc" type: "Convolution" bottom: "conv6_2" top: "conv6_2_mbox_loc" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 24 @@ -1134,9 +1341,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 32.3899993896 + scale_out: 30.3400001526 + scale_params: 1448.85998535 + } } layer { name: "conv6_2_mbox_loc_perm" @@ -1165,12 +1381,12 @@ layer { bottom: "conv6_2" top: "conv6_2_mbox_conf" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 126 @@ -1182,10 +1398,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } - engine: "CAFFE" + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 32.3899993896 + scale_out: 4.40999984741 + scale_params: 886.849975586 + } } layer { name: "conv6_2_mbox_conf_perm" @@ -1217,15 +1441,15 @@ layer { prior_box_param { min_size: 111.0 max_size: 162.0 - aspect_ratio: 2 - aspect_ratio: 3 + aspect_ratio: 2.0 + aspect_ratio: 3.0 flip: true clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 32 + variance: 0.10000000149 + variance: 0.10000000149 + variance: 0.20000000298 + variance: 0.20000000298 + step: 32.0 offset: 0.5 } } @@ -1235,12 +1459,12 @@ layer { bottom: "conv7_2" top: "conv7_2_mbox_loc" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 24 @@ -1252,9 +1476,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.25 + scale_out: 26.8600006104 + scale_params: 1228.0300293 + } } layer { name: "conv7_2_mbox_loc_perm" @@ -1278,18 +1511,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv7_2_mbox_conf" type: "Convolution" bottom: "conv7_2" top: "conv7_2_mbox_conf" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 126 @@ -1301,9 +1533,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 14.25 + scale_out: 4.65999984741 + scale_params: 896.140014648 + } } layer { name: "conv7_2_mbox_conf_perm" @@ -1335,31 +1576,30 @@ layer { prior_box_param { min_size: 162.0 max_size: 213.0 - aspect_ratio: 2 - aspect_ratio: 3 + aspect_ratio: 2.0 + aspect_ratio: 3.0 flip: true clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 64 + variance: 0.10000000149 + variance: 0.10000000149 + variance: 0.20000000298 + variance: 0.20000000298 + step: 64.0 offset: 0.5 } } layer { - engine: "MKL2017" name: "conv8_2_mbox_loc" type: "Convolution" bottom: "conv8_2" top: "conv8_2_mbox_loc" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 16 @@ -1371,9 +1611,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 18.4300003052 + scale_out: 26.6599998474 + scale_params: 1359.68994141 + } } layer { name: "conv8_2_mbox_loc_perm" @@ -1397,18 +1646,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv8_2_mbox_conf" type: "Convolution" bottom: "conv8_2" top: "conv8_2_mbox_conf" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 84 @@ -1420,9 +1668,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 18.4300003052 + scale_out: 5.67999982834 + scale_params: 1086.95996094 + } } layer { name: "conv8_2_mbox_conf_perm" @@ -1454,14 +1711,14 @@ layer { prior_box_param { min_size: 213.0 max_size: 264.0 - aspect_ratio: 2 + aspect_ratio: 2.0 flip: true clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 100 + variance: 0.10000000149 + variance: 0.10000000149 + variance: 0.20000000298 + variance: 0.20000000298 + step: 100.0 offset: 0.5 } } @@ -1471,12 +1728,12 @@ layer { bottom: "conv9_2" top: "conv9_2_mbox_loc" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 16 @@ -1488,9 +1745,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 10.6199998856 + scale_out: 35.0900001526 + scale_params: 1117.32995605 + } } layer { name: "conv9_2_mbox_loc_perm" @@ -1514,18 +1780,17 @@ layer { } } layer { - engine: "MKL2017" name: "conv9_2_mbox_conf" type: "Convolution" bottom: "conv9_2" top: "conv9_2_mbox_conf" param { - lr_mult: 1 - decay_mult: 1 + lr_mult: 1.0 + decay_mult: 1.0 } param { - lr_mult: 2 - decay_mult: 0 + lr_mult: 2.0 + decay_mult: 0.0 } convolution_param { num_output: 84 @@ -1537,9 +1802,18 @@ layer { } bias_filler { type: "constant" - value: 0 + value: 0.0 } } + quantization_param { + precision: DYNAMIC_FIXED_POINT + bw_layer_in: 8 + bw_layer_out: 8 + bw_params: 8 + scale_in: 10.6199998856 + scale_out: 5.92000007629 + scale_params: 539.520019531 + } } layer { name: "conv9_2_mbox_conf_perm" @@ -1571,14 +1845,14 @@ layer { prior_box_param { min_size: 264.0 max_size: 315.0 - aspect_ratio: 2 + aspect_ratio: 2.0 flip: true clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 300 + variance: 0.10000000149 + variance: 0.10000000149 + variance: 0.20000000298 + variance: 0.20000000298 + step: 300.0 offset: 0.5 } } @@ -1595,7 +1869,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1610,7 +1883,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1625,5 +1897,59 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } +layer { + name: "mbox_conf_reshape" + type: "Reshape" + bottom: "mbox_conf" + top: "mbox_conf_reshape" + reshape_param { + shape { + dim: 0 + dim: -1 + dim: 21 + } + } +} +layer { + name: "mbox_conf_softmax" + type: "Softmax" + bottom: "mbox_conf_reshape" + top: "mbox_conf_softmax" + softmax_param { + axis: 2 + } +} +layer { + name: "mbox_conf_flatten" + type: "Flatten" + bottom: "mbox_conf_softmax" + top: "mbox_conf_flatten" + flatten_param { + axis: 1 + } +} +layer { + name: "detection_out" + type: "DetectionOutput" + bottom: "mbox_loc" + bottom: "mbox_conf_flatten" + bottom: "mbox_priorbox" + top: "detection_out" + include { + phase: TEST + } + detection_output_param { + num_classes: 21 + share_location: true + background_label_id: 0 + nms_param { + nms_threshold: 0.449999988079 + top_k: 400 + } + code_type: CENTER_SIZE + keep_top_k: 200 + confidence_threshold: 0.00999999977648 + } +} + diff --git a/models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/solver.prototxt b/models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/solver.prototxt new file mode 100755 index 000000000..a729fdacd --- /dev/null +++ b/models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/solver.prototxt @@ -0,0 +1,19 @@ +#test accuracy / target accuracy +#Top-5: 0.887741 / 0.89 +#Top-1: 0.683879 / 0.687 +#Training was performed using server equipped with Intel(R) Xeon Phi(TM) CPU 7250 processor. +net: "models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/train_val.prototxt" +test_iter: 1000 +test_interval: 2000 +test_initialization: false +display: 40 +average_loss: 40 +base_lr: 0.065 +lr_policy: "poly" +power: 0.5 +max_iter: 90000 +momentum: 0.9 +weight_decay: 0.0002 +snapshot: 10000 +snapshot_prefix: "models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/snapshots/googlenet" +solver_mode: CPU diff --git a/models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/train_val.prototxt b/models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/train_val.prototxt new file mode 100755 index 000000000..04f505ee1 --- /dev/null +++ b/models/intel_optimized_models/multinode/googlenet_16nodes_1k_batch/train_val.prototxt @@ -0,0 +1,2434 @@ +name: "GoogleNet" +layer { + name: "data" + type: "Data" + top: "data" + top: "label" + include { + phase: TRAIN + } + transform_param { + mirror: true + crop_size: 224 + mean_value: 104 + mean_value: 117 + mean_value: 123 + } + data_param { +source: "examples/imagenet/ilsvrc12_train_lmdb" + batch_size: 64 + backend: LMDB + shuffle: true + } +} +layer { + name: "data" + type: "Data" + top: "data" + top: "label" + include { + phase: TEST + } + transform_param { + mirror: false + crop_size: 224 + mean_value: 104 + mean_value: 117 + mean_value: 123 + } + data_param { +source: "examples/imagenet/ilsvrc12_val_lmdb" + batch_size: 50 + backend: LMDB + } +} +layer { + name: "conv1/7x7_s2" + type: "Convolution" + bottom: "data" + top: "conv1/7x7_s2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 3 + kernel_size: 7 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "conv1/relu_7x7" + type: "ReLU" + bottom: "conv1/7x7_s2" + top: "conv1/7x7_s2" +} +layer { + name: "pool1/3x3_s2" + type: "Pooling" + bottom: "conv1/7x7_s2" + top: "pool1/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "pool1/norm1" + type: "LRN" + bottom: "pool1/3x3_s2" + top: "pool1/norm1" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "conv2/3x3_reduce" + type: "Convolution" + bottom: "pool1/norm1" + top: "conv2/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "conv2/relu_3x3_reduce" + type: "ReLU" + bottom: "conv2/3x3_reduce" + top: "conv2/3x3_reduce" +} +layer { + name: "conv2/3x3" + type: "Convolution" + bottom: "conv2/3x3_reduce" + top: "conv2/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "conv2/relu_3x3" + type: "ReLU" + bottom: "conv2/3x3" + top: "conv2/3x3" +} +layer { + name: "conv2/norm2" + type: "LRN" + bottom: "conv2/3x3" + top: "conv2/norm2" + lrn_param { + local_size: 5 + alpha: 0.0001 + beta: 0.75 + } +} +layer { + name: "pool2/3x3_s2" + type: "Pooling" + bottom: "conv2/norm2" + top: "pool2/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_3a/1x1" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_1x1" + type: "ReLU" + bottom: "inception_3a/1x1" + top: "inception_3a/1x1" +} +layer { + name: "inception_3a/3x3_reduce" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_3a/3x3_reduce" + top: "inception_3a/3x3_reduce" +} +layer { + name: "inception_3a/3x3" + type: "Convolution" + bottom: "inception_3a/3x3_reduce" + top: "inception_3a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_3x3" + type: "ReLU" + bottom: "inception_3a/3x3" + top: "inception_3a/3x3" +} +layer { + name: "inception_3a/5x5_reduce" + type: "Convolution" + bottom: "pool2/3x3_s2" + top: "inception_3a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 16 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_3a/5x5_reduce" + top: "inception_3a/5x5_reduce" +} +layer { + name: "inception_3a/5x5" + type: "Convolution" + bottom: "inception_3a/5x5_reduce" + top: "inception_3a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_5x5" + type: "ReLU" + bottom: "inception_3a/5x5" + top: "inception_3a/5x5" +} +layer { + name: "inception_3a/pool" + type: "Pooling" + bottom: "pool2/3x3_s2" + top: "inception_3a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_3a/pool_proj" + type: "Convolution" + bottom: "inception_3a/pool" + top: "inception_3a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3a/relu_pool_proj" + type: "ReLU" + bottom: "inception_3a/pool_proj" + top: "inception_3a/pool_proj" +} +layer { + name: "inception_3a/output" + type: "Concat" + bottom: "inception_3a/1x1" + bottom: "inception_3a/3x3" + bottom: "inception_3a/5x5" + bottom: "inception_3a/pool_proj" + top: "inception_3a/output" +} +layer { + name: "inception_3b/1x1" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_1x1" + type: "ReLU" + bottom: "inception_3b/1x1" + top: "inception_3b/1x1" +} +layer { + name: "inception_3b/3x3_reduce" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_3b/3x3_reduce" + top: "inception_3b/3x3_reduce" +} +layer { + name: "inception_3b/3x3" + type: "Convolution" + bottom: "inception_3b/3x3_reduce" + top: "inception_3b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_3x3" + type: "ReLU" + bottom: "inception_3b/3x3" + top: "inception_3b/3x3" +} +layer { + name: "inception_3b/5x5_reduce" + type: "Convolution" + bottom: "inception_3a/output" + top: "inception_3b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_3b/5x5_reduce" + top: "inception_3b/5x5_reduce" +} +layer { + name: "inception_3b/5x5" + type: "Convolution" + bottom: "inception_3b/5x5_reduce" + top: "inception_3b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_5x5" + type: "ReLU" + bottom: "inception_3b/5x5" + top: "inception_3b/5x5" +} +layer { + name: "inception_3b/pool" + type: "Pooling" + bottom: "inception_3a/output" + top: "inception_3b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_3b/pool_proj" + type: "Convolution" + bottom: "inception_3b/pool" + top: "inception_3b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_3b/relu_pool_proj" + type: "ReLU" + bottom: "inception_3b/pool_proj" + top: "inception_3b/pool_proj" +} +layer { + name: "inception_3b/output" + type: "Concat" + bottom: "inception_3b/1x1" + bottom: "inception_3b/3x3" + bottom: "inception_3b/5x5" + bottom: "inception_3b/pool_proj" + top: "inception_3b/output" +} +layer { + name: "pool3/3x3_s2" + type: "Pooling" + bottom: "inception_3b/output" + top: "pool3/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_4a/1x1" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_1x1" + type: "ReLU" + bottom: "inception_4a/1x1" + top: "inception_4a/1x1" +} +layer { + name: "inception_4a/3x3_reduce" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 96 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4a/3x3_reduce" + top: "inception_4a/3x3_reduce" +} +layer { + name: "inception_4a/3x3" + type: "Convolution" + bottom: "inception_4a/3x3_reduce" + top: "inception_4a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 208 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_3x3" + type: "ReLU" + bottom: "inception_4a/3x3" + top: "inception_4a/3x3" +} +layer { + name: "inception_4a/5x5_reduce" + type: "Convolution" + bottom: "pool3/3x3_s2" + top: "inception_4a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 16 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4a/5x5_reduce" + top: "inception_4a/5x5_reduce" +} +layer { + name: "inception_4a/5x5" + type: "Convolution" + bottom: "inception_4a/5x5_reduce" + top: "inception_4a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 48 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_5x5" + type: "ReLU" + bottom: "inception_4a/5x5" + top: "inception_4a/5x5" +} +layer { + name: "inception_4a/pool" + type: "Pooling" + bottom: "pool3/3x3_s2" + top: "inception_4a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4a/pool_proj" + type: "Convolution" + bottom: "inception_4a/pool" + top: "inception_4a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4a/relu_pool_proj" + type: "ReLU" + bottom: "inception_4a/pool_proj" + top: "inception_4a/pool_proj" +} +layer { + name: "inception_4a/output" + type: "Concat" + bottom: "inception_4a/1x1" + bottom: "inception_4a/3x3" + bottom: "inception_4a/5x5" + bottom: "inception_4a/pool_proj" + top: "inception_4a/output" +} +layer { + name: "loss1/ave_pool" + type: "Pooling" + bottom: "inception_4a/output" + top: "loss1/ave_pool" + pooling_param { + pool: AVE + kernel_size: 5 + stride: 3 + } +} +layer { + name: "loss1/conv" + type: "Convolution" + bottom: "loss1/ave_pool" + top: "loss1/conv" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss1/relu_conv" + type: "ReLU" + bottom: "loss1/conv" + top: "loss1/conv" +} +layer { + name: "loss1/fc" + type: "InnerProduct" + bottom: "loss1/conv" + top: "loss1/fc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1024 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss1/relu_fc" + type: "ReLU" + bottom: "loss1/fc" + top: "loss1/fc" +} +layer { + name: "loss1/drop_fc" + type: "Dropout" + bottom: "loss1/fc" + top: "loss1/fc" + dropout_param { + dropout_ratio: 0.7 + } +} +layer { + name: "loss1/classifier" + type: "InnerProduct" + bottom: "loss1/fc" + top: "loss1/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss1/loss" + type: "SoftmaxWithLoss" + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/loss1" + loss_weight: 0.3 +} +layer { + name: "loss1/top-1" + type: "Accuracy" + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/top-1" + include { + phase: TEST + } +} +layer { + name: "loss1/top-5" + type: "Accuracy" + bottom: "loss1/classifier" + bottom: "label" + top: "loss1/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} +layer { + name: "inception_4b/1x1" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_1x1" + type: "ReLU" + bottom: "inception_4b/1x1" + top: "inception_4b/1x1" +} +layer { + name: "inception_4b/3x3_reduce" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 112 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4b/3x3_reduce" + top: "inception_4b/3x3_reduce" +} +layer { + name: "inception_4b/3x3" + type: "Convolution" + bottom: "inception_4b/3x3_reduce" + top: "inception_4b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 224 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_3x3" + type: "ReLU" + bottom: "inception_4b/3x3" + top: "inception_4b/3x3" +} +layer { + name: "inception_4b/5x5_reduce" + type: "Convolution" + bottom: "inception_4a/output" + top: "inception_4b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4b/5x5_reduce" + top: "inception_4b/5x5_reduce" +} +layer { + name: "inception_4b/5x5" + type: "Convolution" + bottom: "inception_4b/5x5_reduce" + top: "inception_4b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_5x5" + type: "ReLU" + bottom: "inception_4b/5x5" + top: "inception_4b/5x5" +} +layer { + name: "inception_4b/pool" + type: "Pooling" + bottom: "inception_4a/output" + top: "inception_4b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4b/pool_proj" + type: "Convolution" + bottom: "inception_4b/pool" + top: "inception_4b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4b/relu_pool_proj" + type: "ReLU" + bottom: "inception_4b/pool_proj" + top: "inception_4b/pool_proj" +} +layer { + name: "inception_4b/output" + type: "Concat" + bottom: "inception_4b/1x1" + bottom: "inception_4b/3x3" + bottom: "inception_4b/5x5" + bottom: "inception_4b/pool_proj" + top: "inception_4b/output" +} +layer { + name: "inception_4c/1x1" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_1x1" + type: "ReLU" + bottom: "inception_4c/1x1" + top: "inception_4c/1x1" +} +layer { + name: "inception_4c/3x3_reduce" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4c/3x3_reduce" + top: "inception_4c/3x3_reduce" +} +layer { + name: "inception_4c/3x3" + type: "Convolution" + bottom: "inception_4c/3x3_reduce" + top: "inception_4c/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_3x3" + type: "ReLU" + bottom: "inception_4c/3x3" + top: "inception_4c/3x3" +} +layer { + name: "inception_4c/5x5_reduce" + type: "Convolution" + bottom: "inception_4b/output" + top: "inception_4c/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 24 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4c/5x5_reduce" + top: "inception_4c/5x5_reduce" +} +layer { + name: "inception_4c/5x5" + type: "Convolution" + bottom: "inception_4c/5x5_reduce" + top: "inception_4c/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_5x5" + type: "ReLU" + bottom: "inception_4c/5x5" + top: "inception_4c/5x5" +} +layer { + name: "inception_4c/pool" + type: "Pooling" + bottom: "inception_4b/output" + top: "inception_4c/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4c/pool_proj" + type: "Convolution" + bottom: "inception_4c/pool" + top: "inception_4c/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4c/relu_pool_proj" + type: "ReLU" + bottom: "inception_4c/pool_proj" + top: "inception_4c/pool_proj" +} +layer { + name: "inception_4c/output" + type: "Concat" + bottom: "inception_4c/1x1" + bottom: "inception_4c/3x3" + bottom: "inception_4c/5x5" + bottom: "inception_4c/pool_proj" + top: "inception_4c/output" +} +layer { + name: "inception_4d/1x1" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 112 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_1x1" + type: "ReLU" + bottom: "inception_4d/1x1" + top: "inception_4d/1x1" +} +layer { + name: "inception_4d/3x3_reduce" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 144 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4d/3x3_reduce" + top: "inception_4d/3x3_reduce" +} +layer { + name: "inception_4d/3x3" + type: "Convolution" + bottom: "inception_4d/3x3_reduce" + top: "inception_4d/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 288 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_3x3" + type: "ReLU" + bottom: "inception_4d/3x3" + top: "inception_4d/3x3" +} +layer { + name: "inception_4d/5x5_reduce" + type: "Convolution" + bottom: "inception_4c/output" + top: "inception_4d/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4d/5x5_reduce" + top: "inception_4d/5x5_reduce" +} +layer { + name: "inception_4d/5x5" + type: "Convolution" + bottom: "inception_4d/5x5_reduce" + top: "inception_4d/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_5x5" + type: "ReLU" + bottom: "inception_4d/5x5" + top: "inception_4d/5x5" +} +layer { + name: "inception_4d/pool" + type: "Pooling" + bottom: "inception_4c/output" + top: "inception_4d/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4d/pool_proj" + type: "Convolution" + bottom: "inception_4d/pool" + top: "inception_4d/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4d/relu_pool_proj" + type: "ReLU" + bottom: "inception_4d/pool_proj" + top: "inception_4d/pool_proj" +} +layer { + name: "inception_4d/output" + type: "Concat" + bottom: "inception_4d/1x1" + bottom: "inception_4d/3x3" + bottom: "inception_4d/5x5" + bottom: "inception_4d/pool_proj" + top: "inception_4d/output" +} +layer { + name: "loss2/ave_pool" + type: "Pooling" + bottom: "inception_4d/output" + top: "loss2/ave_pool" + pooling_param { + pool: AVE + kernel_size: 5 + stride: 3 + } +} +layer { + name: "loss2/conv" + type: "Convolution" + bottom: "loss2/ave_pool" + top: "loss2/conv" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss2/relu_conv" + type: "ReLU" + bottom: "loss2/conv" + top: "loss2/conv" +} +layer { + name: "loss2/fc" + type: "InnerProduct" + bottom: "loss2/conv" + top: "loss2/fc" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1024 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "loss2/relu_fc" + type: "ReLU" + bottom: "loss2/fc" + top: "loss2/fc" +} +layer { + name: "loss2/drop_fc" + type: "Dropout" + bottom: "loss2/fc" + top: "loss2/fc" + dropout_param { + dropout_ratio: 0.7 + } +} +layer { + name: "loss2/classifier" + type: "InnerProduct" + bottom: "loss2/fc" + top: "loss2/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss2/loss" + type: "SoftmaxWithLoss" + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/loss1" + loss_weight: 0.3 +} +layer { + name: "loss2/top-1" + type: "Accuracy" + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/top-1" + include { + phase: TEST + } +} +layer { + name: "loss2/top-5" + type: "Accuracy" + bottom: "loss2/classifier" + bottom: "label" + top: "loss2/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} +layer { + name: "inception_4e/1x1" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_1x1" + type: "ReLU" + bottom: "inception_4e/1x1" + top: "inception_4e/1x1" +} +layer { + name: "inception_4e/3x3_reduce" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_4e/3x3_reduce" + top: "inception_4e/3x3_reduce" +} +layer { + name: "inception_4e/3x3" + type: "Convolution" + bottom: "inception_4e/3x3_reduce" + top: "inception_4e/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 320 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_3x3" + type: "ReLU" + bottom: "inception_4e/3x3" + top: "inception_4e/3x3" +} +layer { + name: "inception_4e/5x5_reduce" + type: "Convolution" + bottom: "inception_4d/output" + top: "inception_4e/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_4e/5x5_reduce" + top: "inception_4e/5x5_reduce" +} +layer { + name: "inception_4e/5x5" + type: "Convolution" + bottom: "inception_4e/5x5_reduce" + top: "inception_4e/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_5x5" + type: "ReLU" + bottom: "inception_4e/5x5" + top: "inception_4e/5x5" +} +layer { + name: "inception_4e/pool" + type: "Pooling" + bottom: "inception_4d/output" + top: "inception_4e/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_4e/pool_proj" + type: "Convolution" + bottom: "inception_4e/pool" + top: "inception_4e/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_4e/relu_pool_proj" + type: "ReLU" + bottom: "inception_4e/pool_proj" + top: "inception_4e/pool_proj" +} +layer { + name: "inception_4e/output" + type: "Concat" + bottom: "inception_4e/1x1" + bottom: "inception_4e/3x3" + bottom: "inception_4e/5x5" + bottom: "inception_4e/pool_proj" + top: "inception_4e/output" +} +layer { + name: "pool4/3x3_s2" + type: "Pooling" + bottom: "inception_4e/output" + top: "pool4/3x3_s2" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 2 + } +} +layer { + name: "inception_5a/1x1" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_1x1" + type: "ReLU" + bottom: "inception_5a/1x1" + top: "inception_5a/1x1" +} +layer { + name: "inception_5a/3x3_reduce" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 160 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_5a/3x3_reduce" + top: "inception_5a/3x3_reduce" +} +layer { + name: "inception_5a/3x3" + type: "Convolution" + bottom: "inception_5a/3x3_reduce" + top: "inception_5a/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 320 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_3x3" + type: "ReLU" + bottom: "inception_5a/3x3" + top: "inception_5a/3x3" +} +layer { + name: "inception_5a/5x5_reduce" + type: "Convolution" + bottom: "pool4/3x3_s2" + top: "inception_5a/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 32 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_5a/5x5_reduce" + top: "inception_5a/5x5_reduce" +} +layer { + name: "inception_5a/5x5" + type: "Convolution" + bottom: "inception_5a/5x5_reduce" + top: "inception_5a/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_5x5" + type: "ReLU" + bottom: "inception_5a/5x5" + top: "inception_5a/5x5" +} +layer { + name: "inception_5a/pool" + type: "Pooling" + bottom: "pool4/3x3_s2" + top: "inception_5a/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_5a/pool_proj" + type: "Convolution" + bottom: "inception_5a/pool" + top: "inception_5a/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5a/relu_pool_proj" + type: "ReLU" + bottom: "inception_5a/pool_proj" + top: "inception_5a/pool_proj" +} +layer { + name: "inception_5a/output" + type: "Concat" + bottom: "inception_5a/1x1" + bottom: "inception_5a/3x3" + bottom: "inception_5a/5x5" + bottom: "inception_5a/pool_proj" + top: "inception_5a/output" +} +layer { + name: "inception_5b/1x1" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/1x1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_1x1" + type: "ReLU" + bottom: "inception_5b/1x1" + top: "inception_5b/1x1" +} +layer { + name: "inception_5b/3x3_reduce" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/3x3_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 192 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_3x3_reduce" + type: "ReLU" + bottom: "inception_5b/3x3_reduce" + top: "inception_5b/3x3_reduce" +} +layer { + name: "inception_5b/3x3" + type: "Convolution" + bottom: "inception_5b/3x3_reduce" + top: "inception_5b/3x3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 384 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_3x3" + type: "ReLU" + bottom: "inception_5b/3x3" + top: "inception_5b/3x3" +} +layer { + name: "inception_5b/5x5_reduce" + type: "Convolution" + bottom: "inception_5a/output" + top: "inception_5b/5x5_reduce" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 48 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_5x5_reduce" + type: "ReLU" + bottom: "inception_5b/5x5_reduce" + top: "inception_5b/5x5_reduce" +} +layer { + name: "inception_5b/5x5" + type: "Convolution" + bottom: "inception_5b/5x5_reduce" + top: "inception_5b/5x5" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 2 + kernel_size: 5 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_5x5" + type: "ReLU" + bottom: "inception_5b/5x5" + top: "inception_5b/5x5" +} +layer { + name: "inception_5b/pool" + type: "Pooling" + bottom: "inception_5a/output" + top: "inception_5b/pool" + pooling_param { + pool: MAX + kernel_size: 3 + stride: 1 + pad: 1 + } +} +layer { + name: "inception_5b/pool_proj" + type: "Convolution" + bottom: "inception_5b/pool" + top: "inception_5b/pool_proj" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + kernel_size: 1 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } +} +layer { + name: "inception_5b/relu_pool_proj" + type: "ReLU" + bottom: "inception_5b/pool_proj" + top: "inception_5b/pool_proj" +} +layer { + name: "inception_5b/output" + type: "Concat" + bottom: "inception_5b/1x1" + bottom: "inception_5b/3x3" + bottom: "inception_5b/5x5" + bottom: "inception_5b/pool_proj" + top: "inception_5b/output" +} +layer { + name: "pool5/7x7_s1" + type: "Pooling" + bottom: "inception_5b/output" + top: "pool5/7x7_s1" + pooling_param { + pool: AVE + kernel_size: 7 + stride: 1 + } +} +layer { + name: "pool5/drop_7x7_s1" + type: "Dropout" + bottom: "pool5/7x7_s1" + top: "pool5/7x7_s1" + dropout_param { + dropout_ratio: 0.4 + } +} +layer { + name: "loss3/classifier" + type: "InnerProduct" + bottom: "pool5/7x7_s1" + top: "loss3/classifier" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} +layer { + name: "loss3/loss3" + type: "SoftmaxWithLoss" + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/loss3" + loss_weight: 1 +} +layer { + name: "loss3/top-1" + type: "Accuracy" + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/top-1" + include { + phase: TEST + } +} +layer { + name: "loss3/top-5" + type: "Accuracy" + bottom: "loss3/classifier" + bottom: "label" + top: "loss3/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/solver.prototxt b/models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/solver.prototxt new file mode 100644 index 000000000..e6ef942f4 --- /dev/null +++ b/models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/solver.prototxt @@ -0,0 +1,19 @@ +net: "models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/train_val.prototxt" +test_iter: 1000 +test_interval: 1000 +momentum: 0.9 +weight_decay: 0.0005 +power: 2 +base_lr: 7 +warmup_start_lr: 1 +warmup_iter: 3127 # 5 epochs +local_lr_auto: true +local_gw_ratio: 0.001 + +lr_policy: "poly" +gamma: 0.1 +max_iter: 40000 +display: 20 +snapshot: 5000 +solver_mode: CPU +snapshot_prefix: "vgg_16_32nodes_2k_batch" diff --git a/models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/train_val.prototxt b/models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/train_val.prototxt new file mode 100644 index 000000000..046166772 --- /dev/null +++ b/models/intel_optimized_models/multinode/vgg_16_32nodes_2k_batch/train_val.prototxt @@ -0,0 +1,613 @@ +name: "VGG_ILSVRC_16_layer" +layer { + name: "data" + type: "Data" + include { + phase: TRAIN + } + transform_param { + crop_size: 224 + mean_value: 104 + mean_value: 117 + mean_value: 124 + mirror: true + } + data_param { + source: "examples/imagenet/ilsvrc12_train_lmdb" + batch_size: 64 + backend: LMDB + shuffle: true + } + top: "data" + top: "label" +} +layer { + name: "data" + type: "Data" + include { + phase: TEST + } + transform_param { + crop_size: 224 + mean_value: 104 + mean_value: 117 + mean_value: 124 + mirror: false + } + data_param { + source: "examples/imagenet/ilsvrc12_val_lmdb" + batch_size: 50 + backend: LMDB + } + top: "data" + top: "label" +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + convolution_param { + + num_output: 64 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "relu1_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv1_1" + top: "conv1_2" + name: "conv1_2" + type: "Convolution" + convolution_param { + + num_output: 64 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "relu1_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv1_2" + top: "pool1" + name: "pool1" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool1" + top: "conv2_1" + name: "conv2_1" + type: "Convolution" + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "relu2_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv2_1" + top: "conv2_2" + name: "conv2_2" + type: "Convolution" + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "relu2_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv2_2" + top: "pool2" + name: "pool2" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool2" + top: "conv3_1" + name: "conv3_1" + type: "Convolution" + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "relu3_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv3_1" + top: "conv3_2" + name: "conv3_2" + type: "Convolution" + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "relu3_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv3_2" + top: "conv3_3" + name: "conv3_3" + type: "Convolution" + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "relu3_3" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv3_3" + top: "pool3" + name: "pool3" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool3" + top: "conv4_1" + name: "conv4_1" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "relu4_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv4_1" + top: "conv4_2" + name: "conv4_2" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "relu4_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv4_2" + top: "conv4_3" + name: "conv4_3" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "relu4_3" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv4_3" + top: "pool4" + name: "pool4" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool4" + top: "conv5_1" + name: "conv5_1" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "relu5_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv5_1" + top: "conv5_2" + name: "conv5_2" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "relu5_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv5_2" + top: "conv5_3" + name: "conv5_3" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.0 + } + } + + +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "relu5_3" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv5_3" + top: "pool5" + name: "pool5" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool5" + top: "fc6" + name: "fc6" + type: "InnerProduct" + inner_product_param { + num_output: 4096 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } + + +} +layer { + bottom: "fc6" + top: "fc6" + name: "relu6" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "fc6" + top: "fc6" + name: "drop6" + type: "Dropout" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + bottom: "fc6" + top: "fc7" + name: "fc7" + type: "InnerProduct" + inner_product_param { + num_output: 4096 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } + + +} +layer { + bottom: "fc7" + top: "fc7" + name: "relu7" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "fc7" + top: "fc7" + name: "drop7" + type: "Dropout" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc8" + bottom: "fc7" + top: "fc8" + type: "InnerProduct" + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } + + +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "fc8" + bottom: "label" + top: "loss/loss" +} +layer { + name: "accuracy/top1" + type: "Accuracy" + bottom: "fc8" + bottom: "label" + top: "accuracy@1" + include: { phase: TEST } + accuracy_param { + top_k: 1 + } +} +layer { + name: "accuracy/top5" + type: "Accuracy" + bottom: "fc8" + bottom: "label" + top: "accuracy@5" + include: { phase: TEST } + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/solver.prototxt b/models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/solver.prototxt new file mode 100644 index 000000000..23c27d292 --- /dev/null +++ b/models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/solver.prototxt @@ -0,0 +1,19 @@ +net: "models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/train_val.prototxt" +test_iter: 1000 +test_interval: 1000 +momentum: 0.9 +weight_decay: 0.0005 +power: 2 +base_lr: 14 +warmup_start_lr: 1 +warmup_iter: 1564 # 5 epochs +local_lr_auto: true +local_gw_ratio: 0.001 + +lr_policy: "poly" +gamma: 0.1 +max_iter: 20000 +display: 20 +snapshot: 5000 +solver_mode: CPU +snapshot_prefix: "vgg_16_64nodes_4k_batch" diff --git a/models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/train_val.prototxt b/models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/train_val.prototxt new file mode 100644 index 000000000..046166772 --- /dev/null +++ b/models/intel_optimized_models/multinode/vgg_16_64nodes_4k_batch/train_val.prototxt @@ -0,0 +1,613 @@ +name: "VGG_ILSVRC_16_layer" +layer { + name: "data" + type: "Data" + include { + phase: TRAIN + } + transform_param { + crop_size: 224 + mean_value: 104 + mean_value: 117 + mean_value: 124 + mirror: true + } + data_param { + source: "examples/imagenet/ilsvrc12_train_lmdb" + batch_size: 64 + backend: LMDB + shuffle: true + } + top: "data" + top: "label" +} +layer { + name: "data" + type: "Data" + include { + phase: TEST + } + transform_param { + crop_size: 224 + mean_value: 104 + mean_value: 117 + mean_value: 124 + mirror: false + } + data_param { + source: "examples/imagenet/ilsvrc12_val_lmdb" + batch_size: 50 + backend: LMDB + } + top: "data" + top: "label" +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + convolution_param { + + num_output: 64 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv1_1" + top: "conv1_1" + name: "relu1_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv1_1" + top: "conv1_2" + name: "conv1_2" + type: "Convolution" + convolution_param { + + num_output: 64 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv1_2" + top: "conv1_2" + name: "relu1_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv1_2" + top: "pool1" + name: "pool1" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool1" + top: "conv2_1" + name: "conv2_1" + type: "Convolution" + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv2_1" + top: "conv2_1" + name: "relu2_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv2_1" + top: "conv2_2" + name: "conv2_2" + type: "Convolution" + convolution_param { + + num_output: 128 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv2_2" + top: "conv2_2" + name: "relu2_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv2_2" + top: "pool2" + name: "pool2" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool2" + top: "conv3_1" + name: "conv3_1" + type: "Convolution" + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv3_1" + top: "conv3_1" + name: "relu3_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv3_1" + top: "conv3_2" + name: "conv3_2" + type: "Convolution" + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv3_2" + top: "conv3_2" + name: "relu3_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv3_2" + top: "conv3_3" + name: "conv3_3" + type: "Convolution" + convolution_param { + + num_output: 256 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv3_3" + top: "conv3_3" + name: "relu3_3" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv3_3" + top: "pool3" + name: "pool3" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool3" + top: "conv4_1" + name: "conv4_1" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv4_1" + top: "conv4_1" + name: "relu4_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv4_1" + top: "conv4_2" + name: "conv4_2" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv4_2" + top: "conv4_2" + name: "relu4_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv4_2" + top: "conv4_3" + name: "conv4_3" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv4_3" + top: "conv4_3" + name: "relu4_3" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv4_3" + top: "pool4" + name: "pool4" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool4" + top: "conv5_1" + name: "conv5_1" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv5_1" + top: "conv5_1" + name: "relu5_1" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv5_1" + top: "conv5_2" + name: "conv5_2" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } + + +} +layer { + bottom: "conv5_2" + top: "conv5_2" + name: "relu5_2" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv5_2" + top: "conv5_3" + name: "conv5_3" + type: "Convolution" + convolution_param { + + num_output: 512 + pad: 1 + kernel_size: 3 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.0 + } + } + + +} +layer { + bottom: "conv5_3" + top: "conv5_3" + name: "relu5_3" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "conv5_3" + top: "pool5" + name: "pool5" + type: "Pooling" + pooling_param { + + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + bottom: "pool5" + top: "fc6" + name: "fc6" + type: "InnerProduct" + inner_product_param { + num_output: 4096 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } + + +} +layer { + bottom: "fc6" + top: "fc6" + name: "relu6" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "fc6" + top: "fc6" + name: "drop6" + type: "Dropout" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + bottom: "fc6" + top: "fc7" + name: "fc7" + type: "InnerProduct" + inner_product_param { + num_output: 4096 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } + + +} +layer { + bottom: "fc7" + top: "fc7" + name: "relu7" + type: "ReLU" + relu_param { + + } +} +layer { + bottom: "fc7" + top: "fc7" + name: "drop7" + type: "Dropout" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc8" + bottom: "fc7" + top: "fc8" + type: "InnerProduct" + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.1 + } + } + + +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "fc8" + bottom: "label" + top: "loss/loss" +} +layer { + name: "accuracy/top1" + type: "Accuracy" + bottom: "fc8" + bottom: "label" + top: "accuracy@1" + include: { phase: TEST } + accuracy_param { + top_k: 1 + } +} +layer { + name: "accuracy/top5" + type: "Accuracy" + bottom: "fc8" + bottom: "label" + top: "accuracy@5" + include: { phase: TEST } + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/resnet_50/solver.prototxt b/models/intel_optimized_models/resnet_50/solver.prototxt new file mode 100644 index 000000000..5693483fd --- /dev/null +++ b/models/intel_optimized_models/resnet_50/solver.prototxt @@ -0,0 +1,18 @@ +#The prototxt files(solver.prototxt and train_val.prototxt) are copied from "models/intel_optimized_models/multinode/resnet_50_16_nodes_2k_batch", temporarily used for throughput benchmarking. It can't achieve expected accuracy for training. We'll provide the files for single node training in the future. +net: "models/intel_optimized_models/resnet_50/train_val.prototxt" +test_iter: 1000 +test_interval: 625 +test_initialization: false +display: 40 +base_lr: 0.8 +lr_policy: "multistep" +stepvalue:18750 +stepvalue:37500 +stepvalue:50000 +gamma: 0.1 +max_iter: 200 +warmup_iter: 3125 # 1281167 / 2048 * 5 epochs +warmup_start_lr: 0.1 +momentum: 0.9 +weight_decay: 0.0001 +solver_mode: CPU diff --git a/models/intel_optimized_models/resnet_50/solver_dummydata.prototxt b/models/intel_optimized_models/resnet_50/solver_dummydata.prototxt new file mode 100644 index 000000000..3ba69689f --- /dev/null +++ b/models/intel_optimized_models/resnet_50/solver_dummydata.prototxt @@ -0,0 +1,25 @@ +#This is Intel(R) optimized (in terms of time to train) version of solver for model described in the [AlexNet](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) publication. +#Original solver.prototxt can be found in /models/bvlc_alexnet/ directory of this repository. +#Differences: +#- lr_policy is set to poly instead of step +#- base_lr is decreased to 0.007 +#- max_iter is decreased to 250000 +#- power is set to 0.6 +# +#Top-5 and Top-1 results achieved with this version of solver: +#Top-5: 80.4% +#Top-1: 57.4% +#Training was performed using server equipped with Intel(R) Xeon Phi(TM) CPU 7250 processor. +net: "models/intel_optimized_models/resnet_50/train_val_dummydata.prototxt" +test_iter: 1000 +test_interval: 10000 +base_lr: 0.007 +lr_policy: "poly" +power: 0.6 +display: 1 +max_iter: 5000 +momentum: 0.9 +weight_decay: 0.0005 +snapshot: 50000 +snapshot_prefix: "models/intel_optimized_models/resnet_50/resnet_50_train" +solver_mode: CPU diff --git a/models/intel_optimized_models/resnet_50/train_val.prototxt b/models/intel_optimized_models/resnet_50/train_val.prototxt new file mode 100644 index 000000000..75bff6269 --- /dev/null +++ b/models/intel_optimized_models/resnet_50/train_val.prototxt @@ -0,0 +1,3322 @@ +name: "ResNet-50" +bn_stats_batch_size: 32 +layer { + name: "data" + type: "Data" + top: "data" + top: "label" + include { + phase: TRAIN + } + transform_param { + mirror: true + crop_size: 224 + scale: 0.0078125 + mean_value: 104 + mean_value: 117 + mean_value: 123 + random_aspect_ratio_param { + min_area_ratio: 0.08 + max_area_ratio: 1 + aspect_ratio_change: 0.75 + resize_param { + interp_mode: CUBIC + } + } + } + data_param { + source: "examples/imagenet/ilsvrc12_train_lmdb" + batch_size: 128 + backend: LMDB + prefetch: 2 + shuffle: true + } +} +layer { + name: "data" + type: "Data" + top: "data" + top: "label" + include { + phase: TEST + } + transform_param { + mirror: false + crop_size: 224 + scale: 0.0078125 + mean_value: 104 + mean_value: 117 + mean_value: 123 + random_resize_param { + min_size: 256 + max_size: 256 + resize_param { + interp_mode: CUBIC + } + } + } + data_param { + source: "examples/imagenet/ilsvrc12_val_lmdb" + batch_size: 50 + backend: LMDB + } +} + +layer { + bottom: "data" + top: "conv1" + name: "conv1" + type: "Convolution" + convolution_param { + num_output: 64 + kernel_size: 7 + pad: 3 + stride: 2 + weight_filler { + type: "msra" + variance_norm: FAN_OUT + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "conv1" + top: "conv1" + name: "bn_conv1" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "conv1" + top: "conv1" + name: "scale_conv1" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "conv1" + top: "conv1" + name: "conv1_relu" + type: "ReLU" + relu_param { + } +} + +layer { + bottom: "conv1" + top: "pool1" + name: "pool1" + type: "Pooling" + pooling_param { + kernel_size: 3 + stride: 2 + pool: MAX + } +} + +layer { + bottom: "pool1" + top: "res2a_branch1" + name: "res2a_branch1" + type: "Convolution" + convolution_param { + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2a_branch1" + top: "res2a_branch1" + name: "bn2a_branch1" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2a_branch1" + top: "res2a_branch1" + name: "scale2a_branch1" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "pool1" + top: "res2a_branch2a" + name: "res2a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2a" + name: "bn2a_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2a" + name: "scale2a_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2a" + name: "res2a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2b" + name: "res2a_branch2b" + type: "Convolution" + convolution_param { + num_output: 64 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2b" + name: "bn2a_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2b" + name: "scale2a_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2b" + name: "res2a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2c" + name: "res2a_branch2c" + type: "Convolution" + convolution_param { + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2a_branch2c" + top: "res2a_branch2c" + name: "bn2a_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2a_branch2c" + top: "res2a_branch2c" + name: "scale2a_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a_branch1" + bottom: "res2a_branch2c" + top: "res2a" + name: "res2a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res2a" + top: "res2a" + name: "res2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2a" + top: "res2b_branch2a" + name: "res2b_branch2a" + type: "Convolution" + convolution_param { + num_output: 64 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2a" + name: "bn2b_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2a" + name: "scale2b_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2a" + name: "res2b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2b" + name: "res2b_branch2b" + type: "Convolution" + convolution_param { + num_output: 64 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2b" + name: "bn2b_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2b" + name: "scale2b_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2b" + name: "res2b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2c" + name: "res2b_branch2c" + type: "Convolution" + convolution_param { + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2b_branch2c" + top: "res2b_branch2c" + name: "bn2b_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2b_branch2c" + top: "res2b_branch2c" + name: "scale2b_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a" + bottom: "res2b_branch2c" + top: "res2b" + name: "res2b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res2b" + top: "res2b" + name: "res2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2b" + top: "res2c_branch2a" + name: "res2c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2a" + name: "bn2c_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2a" + name: "scale2c_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2a" + name: "res2c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2b" + name: "res2c_branch2b" + type: "Convolution" + convolution_param { + num_output: 64 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2b" + name: "bn2c_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2b" + name: "scale2c_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2b" + name: "res2c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2c" + name: "res2c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res2c_branch2c" + top: "res2c_branch2c" + name: "bn2c_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 0 } + } +} + +layer { + bottom: "res2c_branch2c" + top: "res2c_branch2c" + name: "scale2c_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2b" + bottom: "res2c_branch2c" + top: "res2c" + name: "res2c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res2c" + top: "res2c" + name: "res2c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2c" + top: "res3a_branch1" + name: "res3a_branch1" + type: "Convolution" + convolution_param { + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3a_branch1" + top: "res3a_branch1" + name: "bn3a_branch1" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3a_branch1" + top: "res3a_branch1" + name: "scale3a_branch1" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2c" + top: "res3a_branch2a" + name: "res3a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2a" + name: "bn3a_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2a" + name: "scale3a_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2a" + name: "res3a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2b" + name: "res3a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 2 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2b" + name: "bn3a_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2b" + name: "scale3a_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2b" + name: "res3a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2c" + name: "res3a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3a_branch2c" + top: "res3a_branch2c" + name: "bn3a_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3a_branch2c" + top: "res3a_branch2c" + name: "scale3a_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a_branch1" + bottom: "res3a_branch2c" + top: "res3a" + name: "res3a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3a" + top: "res3a" + name: "res3a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3a" + top: "res3b_branch2a" + name: "res3b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2a" + name: "bn3b_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2a" + name: "scale3b_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2a" + name: "res3b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2b" + name: "res3b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2b" + name: "bn3b_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2b" + name: "scale3b_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2b" + name: "res3b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2c" + name: "res3b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3b_branch2c" + top: "res3b_branch2c" + name: "bn3b_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3b_branch2c" + top: "res3b_branch2c" + name: "scale3b_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a" + bottom: "res3b_branch2c" + top: "res3b" + name: "res3b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3b" + top: "res3b" + name: "res3b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3b" + top: "res3c_branch2a" + name: "res3c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2a" + name: "bn3c_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2a" + name: "scale3c_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2a" + name: "res3c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2b" + name: "res3c_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2b" + name: "bn3c_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2b" + name: "scale3c_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2b" + name: "res3c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2c" + name: "res3c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3c_branch2c" + top: "res3c_branch2c" + name: "bn3c_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3c_branch2c" + top: "res3c_branch2c" + name: "scale3c_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3b" + bottom: "res3c_branch2c" + top: "res3c" + name: "res3c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3c" + top: "res3c" + name: "res3c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3c" + top: "res3d_branch2a" + name: "res3d_branch2a" + type: "Convolution" + convolution_param { + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2a" + name: "bn3d_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2a" + name: "scale3d_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2a" + name: "res3d_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2b" + name: "res3d_branch2b" + type: "Convolution" + convolution_param { + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2b" + name: "bn3d_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2b" + name: "scale3d_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2b" + name: "res3d_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2c" + name: "res3d_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res3d_branch2c" + top: "res3d_branch2c" + name: "bn3d_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 0 } + } +} + +layer { + bottom: "res3d_branch2c" + top: "res3d_branch2c" + name: "scale3d_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3c" + bottom: "res3d_branch2c" + top: "res3d" + name: "res3d" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3d" + top: "res3d" + name: "res3d_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3d" + top: "res4a_branch1" + name: "res4a_branch1" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4a_branch1" + top: "res4a_branch1" + name: "bn4a_branch1" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4a_branch1" + top: "res4a_branch1" + name: "scale4a_branch1" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3d" + top: "res4a_branch2a" + name: "res4a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2a" + name: "bn4a_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2a" + name: "scale4a_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2a" + name: "res4a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2b" + name: "res4a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 2 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2b" + name: "bn4a_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2b" + name: "scale4a_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2b" + name: "res4a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2c" + name: "res4a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4a_branch2c" + top: "res4a_branch2c" + name: "bn4a_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4a_branch2c" + top: "res4a_branch2c" + name: "scale4a_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a_branch1" + bottom: "res4a_branch2c" + top: "res4a" + name: "res4a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4a" + top: "res4a" + name: "res4a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4a" + top: "res4b_branch2a" + name: "res4b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2a" + name: "bn4b_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2a" + name: "scale4b_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2a" + name: "res4b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2b" + name: "res4b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2b" + name: "bn4b_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2b" + name: "scale4b_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2b" + name: "res4b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2c" + name: "res4b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4b_branch2c" + top: "res4b_branch2c" + name: "bn4b_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4b_branch2c" + top: "res4b_branch2c" + name: "scale4b_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a" + bottom: "res4b_branch2c" + top: "res4b" + name: "res4b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4b" + top: "res4b" + name: "res4b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4b" + top: "res4c_branch2a" + name: "res4c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2a" + name: "bn4c_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2a" + name: "scale4c_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2a" + name: "res4c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2b" + name: "res4c_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2b" + name: "bn4c_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2b" + name: "scale4c_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2b" + name: "res4c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2c" + name: "res4c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4c_branch2c" + top: "res4c_branch2c" + name: "bn4c_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4c_branch2c" + top: "res4c_branch2c" + name: "scale4c_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4b" + bottom: "res4c_branch2c" + top: "res4c" + name: "res4c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4c" + top: "res4c" + name: "res4c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4c" + top: "res4d_branch2a" + name: "res4d_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2a" + name: "bn4d_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2a" + name: "scale4d_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2a" + name: "res4d_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2b" + name: "res4d_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2b" + name: "bn4d_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2b" + name: "scale4d_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2b" + name: "res4d_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2c" + name: "res4d_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4d_branch2c" + top: "res4d_branch2c" + name: "bn4d_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4d_branch2c" + top: "res4d_branch2c" + name: "scale4d_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4c" + bottom: "res4d_branch2c" + top: "res4d" + name: "res4d" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4d" + top: "res4d" + name: "res4d_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4d" + top: "res4e_branch2a" + name: "res4e_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2a" + name: "bn4e_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2a" + name: "scale4e_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2a" + name: "res4e_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2b" + name: "res4e_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2b" + name: "bn4e_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2b" + name: "scale4e_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2b" + name: "res4e_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2c" + name: "res4e_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4e_branch2c" + top: "res4e_branch2c" + name: "bn4e_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4e_branch2c" + top: "res4e_branch2c" + name: "scale4e_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4d" + bottom: "res4e_branch2c" + top: "res4e" + name: "res4e" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4e" + top: "res4e" + name: "res4e_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4e" + top: "res4f_branch2a" + name: "res4f_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2a" + name: "bn4f_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2a" + name: "scale4f_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2a" + name: "res4f_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2b" + name: "res4f_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2b" + name: "bn4f_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2b" + name: "scale4f_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2b" + name: "res4f_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2c" + name: "res4f_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res4f_branch2c" + top: "res4f_branch2c" + name: "bn4f_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 0 } + } +} + +layer { + bottom: "res4f_branch2c" + top: "res4f_branch2c" + name: "scale4f_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4e" + bottom: "res4f_branch2c" + top: "res4f" + name: "res4f" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4f" + top: "res4f" + name: "res4f_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4f" + top: "res5a_branch1" + name: "res5a_branch1" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5a_branch1" + top: "res5a_branch1" + name: "bn5a_branch1" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5a_branch1" + top: "res5a_branch1" + name: "scale5a_branch1" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4f" + top: "res5a_branch2a" + name: "res5a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2a" + name: "bn5a_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2a" + name: "scale5a_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2a" + name: "res5a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2b" + name: "res5a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 3 + pad: 1 + stride: 2 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2b" + name: "bn5a_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2b" + name: "scale5a_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2b" + name: "res5a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2c" + name: "res5a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5a_branch2c" + top: "res5a_branch2c" + name: "bn5a_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5a_branch2c" + top: "res5a_branch2c" + name: "scale5a_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a_branch1" + bottom: "res5a_branch2c" + top: "res5a" + name: "res5a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res5a" + top: "res5a" + name: "res5a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5a" + top: "res5b_branch2a" + name: "res5b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2a" + name: "bn5b_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2a" + name: "scale5b_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2a" + name: "res5b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2b" + name: "res5b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2b" + name: "bn5b_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2b" + name: "scale5b_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2b" + name: "res5b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2c" + name: "res5b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5b_branch2c" + top: "res5b_branch2c" + name: "bn5b_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5b_branch2c" + top: "res5b_branch2c" + name: "scale5b_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a" + bottom: "res5b_branch2c" + top: "res5b" + name: "res5b" + type: "Eltwise" + eltwise_param { + } +} + +layer { + bottom: "res5b" + top: "res5b" + name: "res5b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5b" + top: "res5c_branch2a" + name: "res5c_branch2a" + type: "Convolution" + convolution_param { + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2a" + name: "bn5c_branch2a" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2a" + name: "scale5c_branch2a" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2a" + name: "res5c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2b" + name: "res5c_branch2b" + type: "Convolution" + convolution_param { + num_output: 512 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2b" + name: "bn5c_branch2b" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 1 } + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2b" + name: "scale5c_branch2b" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2b" + name: "res5c_branch2b_relu" + type: "ReLU" + relu_param { + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2c" + name: "res5c_branch2c" + type: "Convolution" + convolution_param { + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "msra" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "res5c_branch2c" + top: "res5c_branch2c" + name: "bn5c_branch2c" + type: "BatchNorm" + param { lr_mult: 0 } + param { lr_mult: 0 } + param { lr_mult: 0 } + batch_norm_param { + moving_average_fraction: 0.9 + filler { value: 0 } + } +} + +layer { + bottom: "res5c_branch2c" + top: "res5c_branch2c" + name: "scale5c_branch2c" + type: "Scale" + param { decay_mult: 0 } + param { decay_mult: 0 } + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5b" + bottom: "res5c_branch2c" + top: "res5c" + name: "res5c" + type: "Eltwise" + eltwise_param { + } +} + +layer { + bottom: "res5c" + top: "res5c" + name: "res5c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5c" + top: "pool5" + name: "pool5" + type: "Pooling" + pooling_param { + kernel_size: 7 + stride: 1 + pool: AVE + } +} + +layer { + bottom: "pool5" + top: "fc1000" + name: "fc1000" + type: "InnerProduct" + inner_product_param { + num_output: 1000 + weight_filler { + type: "gaussian" + std: 0.01 + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "fc1000" + bottom: "label" + top: "loss" + name: "prob" + type: "SoftmaxWithLoss" +} +layer { + name: "loss3/top-1" + type: "Accuracy" + bottom: "fc1000" + bottom: "label" + top: "loss3/top-1" +} +layer { + name: "loss3/top-5" + type: "Accuracy" + bottom: "fc1000" + bottom: "label" + top: "loss3/top-5" + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/resnet_50/train_val_dummydata.prototxt b/models/intel_optimized_models/resnet_50/train_val_dummydata.prototxt new file mode 100644 index 000000000..15301d2b5 --- /dev/null +++ b/models/intel_optimized_models/resnet_50/train_val_dummydata.prototxt @@ -0,0 +1,3055 @@ +name: "ResNet-50" +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TRAIN + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 32 dim: 3 dim: 224 dim: 224 } + shape: { dim: 32 dim: 1 dim: 1 dim: 1 } + } +} +layer { + name: "data" + type: "DummyData" + top: "data" + top: "label" + include { + phase: TEST + } + dummy_data_param { + data_filler { + type: "constant" + value: 0.01 + } + shape: { dim: 32 dim: 3 dim: 224 dim: 224 } + shape: { dim: 32 dim: 1 dim: 1 dim: 1 } + } +} +layer { + bottom: "data" + top: "conv1" + name: "conv1" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 7 + pad: 3 + stride: 2 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "conv1" + top: "conv1" + name: "bn_conv1" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "conv1" + top: "conv1" + name: "scale_conv1" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "conv1" + top: "conv1" + name: "conv1_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "conv1" + top: "pool1" + name: "pool1" + type: "Pooling" + pooling_param { + + kernel_size: 3 + stride: 2 + pool: MAX + } +} + +layer { + bottom: "pool1" + top: "res2a_branch1" + name: "res2a_branch1" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2a_branch1" + top: "res2a_branch1" + name: "bn2a_branch1" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2a_branch1" + top: "res2a_branch1" + name: "scale2a_branch1" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "pool1" + top: "res2a_branch2a" + name: "res2a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2a" + name: "bn2a_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2a" + name: "scale2a_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2a" + name: "res2a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2a_branch2a" + top: "res2a_branch2b" + name: "res2a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2b" + name: "bn2a_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2b" + name: "scale2a_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2b" + name: "res2a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2a_branch2b" + top: "res2a_branch2c" + name: "res2a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2a_branch2c" + top: "res2a_branch2c" + name: "bn2a_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2a_branch2c" + top: "res2a_branch2c" + name: "scale2a_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a_branch1" + bottom: "res2a_branch2c" + top: "res2a" + name: "res2a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res2a" + top: "res2a" + name: "res2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2a" + top: "res2b_branch2a" + name: "res2b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2a" + name: "bn2b_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2a" + name: "scale2b_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2a" + name: "res2b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2b_branch2a" + top: "res2b_branch2b" + name: "res2b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2b" + name: "bn2b_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2b" + name: "scale2b_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2b" + name: "res2b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2b_branch2b" + top: "res2b_branch2c" + name: "res2b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2b_branch2c" + top: "res2b_branch2c" + name: "bn2b_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2b_branch2c" + top: "res2b_branch2c" + name: "scale2b_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2a" + bottom: "res2b_branch2c" + top: "res2b" + name: "res2b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res2b" + top: "res2b" + name: "res2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2b" + top: "res2c_branch2a" + name: "res2c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2a" + name: "bn2c_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2a" + name: "scale2c_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2a" + name: "res2c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2c_branch2a" + top: "res2c_branch2b" + name: "res2c_branch2b" + type: "Convolution" + convolution_param { + + num_output: 64 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2b" + name: "bn2c_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2b" + name: "scale2c_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2b" + name: "res2c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2c_branch2b" + top: "res2c_branch2c" + name: "res2c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res2c_branch2c" + top: "res2c_branch2c" + name: "bn2c_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res2c_branch2c" + top: "res2c_branch2c" + name: "scale2c_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2b" + bottom: "res2c_branch2c" + top: "res2c" + name: "res2c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res2c" + top: "res2c" + name: "res2c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res2c" + top: "res3a_branch1" + name: "res3a_branch1" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3a_branch1" + top: "res3a_branch1" + name: "bn3a_branch1" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3a_branch1" + top: "res3a_branch1" + name: "scale3a_branch1" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res2c" + top: "res3a_branch2a" + name: "res3a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2a" + name: "bn3a_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2a" + name: "scale3a_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2a" + name: "res3a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3a_branch2a" + top: "res3a_branch2b" + name: "res3a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2b" + name: "bn3a_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2b" + name: "scale3a_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2b" + name: "res3a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3a_branch2b" + top: "res3a_branch2c" + name: "res3a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3a_branch2c" + top: "res3a_branch2c" + name: "bn3a_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3a_branch2c" + top: "res3a_branch2c" + name: "scale3a_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a_branch1" + bottom: "res3a_branch2c" + top: "res3a" + name: "res3a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3a" + top: "res3a" + name: "res3a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3a" + top: "res3b_branch2a" + name: "res3b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2a" + name: "bn3b_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2a" + name: "scale3b_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2a" + name: "res3b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3b_branch2a" + top: "res3b_branch2b" + name: "res3b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2b" + name: "bn3b_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2b" + name: "scale3b_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2b" + name: "res3b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3b_branch2b" + top: "res3b_branch2c" + name: "res3b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3b_branch2c" + top: "res3b_branch2c" + name: "bn3b_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3b_branch2c" + top: "res3b_branch2c" + name: "scale3b_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3a" + bottom: "res3b_branch2c" + top: "res3b" + name: "res3b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3b" + top: "res3b" + name: "res3b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3b" + top: "res3c_branch2a" + name: "res3c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2a" + name: "bn3c_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2a" + name: "scale3c_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2a" + name: "res3c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3c_branch2a" + top: "res3c_branch2b" + name: "res3c_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2b" + name: "bn3c_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2b" + name: "scale3c_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2b" + name: "res3c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3c_branch2b" + top: "res3c_branch2c" + name: "res3c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3c_branch2c" + top: "res3c_branch2c" + name: "bn3c_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3c_branch2c" + top: "res3c_branch2c" + name: "scale3c_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3b" + bottom: "res3c_branch2c" + top: "res3c" + name: "res3c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3c" + top: "res3c" + name: "res3c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3c" + top: "res3d_branch2a" + name: "res3d_branch2a" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2a" + name: "bn3d_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2a" + name: "scale3d_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2a" + name: "res3d_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3d_branch2a" + top: "res3d_branch2b" + name: "res3d_branch2b" + type: "Convolution" + convolution_param { + + num_output: 128 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2b" + name: "bn3d_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2b" + name: "scale3d_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2b" + name: "res3d_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3d_branch2b" + top: "res3d_branch2c" + name: "res3d_branch2c" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res3d_branch2c" + top: "res3d_branch2c" + name: "bn3d_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res3d_branch2c" + top: "res3d_branch2c" + name: "scale3d_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3c" + bottom: "res3d_branch2c" + top: "res3d" + name: "res3d" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res3d" + top: "res3d" + name: "res3d_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res3d" + top: "res4a_branch1" + name: "res4a_branch1" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4a_branch1" + top: "res4a_branch1" + name: "bn4a_branch1" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4a_branch1" + top: "res4a_branch1" + name: "scale4a_branch1" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res3d" + top: "res4a_branch2a" + name: "res4a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2a" + name: "bn4a_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2a" + name: "scale4a_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2a" + name: "res4a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4a_branch2a" + top: "res4a_branch2b" + name: "res4a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2b" + name: "bn4a_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2b" + name: "scale4a_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2b" + name: "res4a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4a_branch2b" + top: "res4a_branch2c" + name: "res4a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4a_branch2c" + top: "res4a_branch2c" + name: "bn4a_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4a_branch2c" + top: "res4a_branch2c" + name: "scale4a_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a_branch1" + bottom: "res4a_branch2c" + top: "res4a" + name: "res4a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4a" + top: "res4a" + name: "res4a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4a" + top: "res4b_branch2a" + name: "res4b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2a" + name: "bn4b_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2a" + name: "scale4b_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2a" + name: "res4b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4b_branch2a" + top: "res4b_branch2b" + name: "res4b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2b" + name: "bn4b_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2b" + name: "scale4b_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2b" + name: "res4b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4b_branch2b" + top: "res4b_branch2c" + name: "res4b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4b_branch2c" + top: "res4b_branch2c" + name: "bn4b_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4b_branch2c" + top: "res4b_branch2c" + name: "scale4b_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4a" + bottom: "res4b_branch2c" + top: "res4b" + name: "res4b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4b" + top: "res4b" + name: "res4b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4b" + top: "res4c_branch2a" + name: "res4c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2a" + name: "bn4c_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2a" + name: "scale4c_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2a" + name: "res4c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4c_branch2a" + top: "res4c_branch2b" + name: "res4c_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2b" + name: "bn4c_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2b" + name: "scale4c_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2b" + name: "res4c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4c_branch2b" + top: "res4c_branch2c" + name: "res4c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4c_branch2c" + top: "res4c_branch2c" + name: "bn4c_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4c_branch2c" + top: "res4c_branch2c" + name: "scale4c_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4b" + bottom: "res4c_branch2c" + top: "res4c" + name: "res4c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4c" + top: "res4c" + name: "res4c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4c" + top: "res4d_branch2a" + name: "res4d_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2a" + name: "bn4d_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2a" + name: "scale4d_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2a" + name: "res4d_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4d_branch2a" + top: "res4d_branch2b" + name: "res4d_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2b" + name: "bn4d_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2b" + name: "scale4d_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2b" + name: "res4d_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4d_branch2b" + top: "res4d_branch2c" + name: "res4d_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4d_branch2c" + top: "res4d_branch2c" + name: "bn4d_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4d_branch2c" + top: "res4d_branch2c" + name: "scale4d_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4c" + bottom: "res4d_branch2c" + top: "res4d" + name: "res4d" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4d" + top: "res4d" + name: "res4d_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4d" + top: "res4e_branch2a" + name: "res4e_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2a" + name: "bn4e_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2a" + name: "scale4e_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2a" + name: "res4e_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4e_branch2a" + top: "res4e_branch2b" + name: "res4e_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2b" + name: "bn4e_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2b" + name: "scale4e_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2b" + name: "res4e_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4e_branch2b" + top: "res4e_branch2c" + name: "res4e_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4e_branch2c" + top: "res4e_branch2c" + name: "bn4e_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4e_branch2c" + top: "res4e_branch2c" + name: "scale4e_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4d" + bottom: "res4e_branch2c" + top: "res4e" + name: "res4e" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4e" + top: "res4e" + name: "res4e_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4e" + top: "res4f_branch2a" + name: "res4f_branch2a" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2a" + name: "bn4f_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2a" + name: "scale4f_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2a" + name: "res4f_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4f_branch2a" + top: "res4f_branch2b" + name: "res4f_branch2b" + type: "Convolution" + convolution_param { + + num_output: 256 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2b" + name: "bn4f_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2b" + name: "scale4f_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2b" + name: "res4f_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4f_branch2b" + top: "res4f_branch2c" + name: "res4f_branch2c" + type: "Convolution" + convolution_param { + + num_output: 1024 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res4f_branch2c" + top: "res4f_branch2c" + name: "bn4f_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res4f_branch2c" + top: "res4f_branch2c" + name: "scale4f_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4e" + bottom: "res4f_branch2c" + top: "res4f" + name: "res4f" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res4f" + top: "res4f" + name: "res4f_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res4f" + top: "res5a_branch1" + name: "res5a_branch1" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5a_branch1" + top: "res5a_branch1" + name: "bn5a_branch1" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5a_branch1" + top: "res5a_branch1" + name: "scale5a_branch1" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res4f" + top: "res5a_branch2a" + name: "res5a_branch2a" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 2 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2a" + name: "bn5a_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2a" + name: "scale5a_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2a" + name: "res5a_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5a_branch2a" + top: "res5a_branch2b" + name: "res5a_branch2b" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2b" + name: "bn5a_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2b" + name: "scale5a_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2b" + name: "res5a_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5a_branch2b" + top: "res5a_branch2c" + name: "res5a_branch2c" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5a_branch2c" + top: "res5a_branch2c" + name: "bn5a_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5a_branch2c" + top: "res5a_branch2c" + name: "scale5a_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a_branch1" + bottom: "res5a_branch2c" + top: "res5a" + name: "res5a" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res5a" + top: "res5a" + name: "res5a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5a" + top: "res5b_branch2a" + name: "res5b_branch2a" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2a" + name: "bn5b_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2a" + name: "scale5b_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2a" + name: "res5b_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5b_branch2a" + top: "res5b_branch2b" + name: "res5b_branch2b" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2b" + name: "bn5b_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2b" + name: "scale5b_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2b" + name: "res5b_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5b_branch2b" + top: "res5b_branch2c" + name: "res5b_branch2c" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5b_branch2c" + top: "res5b_branch2c" + name: "bn5b_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5b_branch2c" + top: "res5b_branch2c" + name: "scale5b_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5a" + bottom: "res5b_branch2c" + top: "res5b" + name: "res5b" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res5b" + top: "res5b" + name: "res5b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5b" + top: "res5c_branch2a" + name: "res5c_branch2a" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2a" + name: "bn5c_branch2a" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2a" + name: "scale5c_branch2a" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2a" + name: "res5c_branch2a_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5c_branch2a" + top: "res5c_branch2b" + name: "res5c_branch2b" + type: "Convolution" + convolution_param { + + num_output: 512 + kernel_size: 3 + pad: 1 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2b" + name: "bn5c_branch2b" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2b" + name: "scale5c_branch2b" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2b" + name: "res5c_branch2b_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5c_branch2b" + top: "res5c_branch2c" + name: "res5c_branch2c" + type: "Convolution" + convolution_param { + + num_output: 2048 + kernel_size: 1 + pad: 0 + stride: 1 + bias_term: false + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0.2 + } + } +} + +layer { + bottom: "res5c_branch2c" + top: "res5c_branch2c" + name: "bn5c_branch2c" + type: "BatchNorm" + batch_norm_param { + + + } +} + +layer { + bottom: "res5c_branch2c" + top: "res5c_branch2c" + name: "scale5c_branch2c" + type: "Scale" + scale_param { + bias_term: true + } +} + +layer { + bottom: "res5b" + bottom: "res5c_branch2c" + top: "res5c" + name: "res5c" + type: "Eltwise" + eltwise_param { + + } +} + +layer { + bottom: "res5c" + top: "res5c" + name: "res5c_relu" + type: "ReLU" + relu_param { + + } +} + +layer { + bottom: "res5c" + top: "pool5" + name: "pool5" + type: "Pooling" + pooling_param { + + kernel_size: 7 + stride: 1 + pool: AVE + } +} + +layer { + bottom: "pool5" + top: "fc1000" + name: "fc1000" + type: "InnerProduct" + inner_product_param { + num_output: 1000 + weight_filler { + type: "xavier" + } + bias_filler { + type: "constant" + value: 0 + } + } +} + +layer { + bottom: "fc1000" + bottom: "label" + top: "prob" + name: "prob" + type: "SoftmaxWithLoss" + include { + phase: TRAIN + } +} +layer { + name: "loss3/top-1" + type: "Accuracy" + bottom: "fc1000" + bottom: "label" + top: "loss3/top-1" + include { + phase: TEST + } +} +layer { + name: "loss3/top-5" + type: "Accuracy" + bottom: "fc1000" + bottom: "label" + top: "loss3/top-5" + include { + phase: TEST + } + accuracy_param { + top_k: 5 + } +} diff --git a/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/deploy.prototxt b/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/deploy.prototxt index d37915e26..658dda5c9 100644 --- a/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/deploy.prototxt +++ b/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/deploy.prototxt @@ -1326,7 +1326,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1341,7 +1340,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1356,7 +1354,6 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } layer { name: "mbox_conf_reshape" diff --git a/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/test.prototxt b/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/test.prototxt index 0eac716a0..167b34ab3 100644 --- a/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/test.prototxt +++ b/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/test.prototxt @@ -1350,7 +1350,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1365,7 +1364,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1380,7 +1378,6 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } layer { name: "mbox_conf_reshape" diff --git a/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/train.prototxt b/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/train.prototxt index d8bac9b7f..1f82b813f 100644 --- a/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/train.prototxt +++ b/models/intel_optimized_models/ssd/AlexNet/VOC0712/SSD_300x300/train.prototxt @@ -1455,7 +1455,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1470,7 +1469,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1485,7 +1483,6 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } layer { name: "mbox_loss" diff --git a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy.prototxt b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy.prototxt index dfe14b516..733229e89 100644 --- a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy.prototxt @@ -1535,7 +1535,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1550,7 +1549,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1565,7 +1563,6 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } layer { name: "mbox_conf_reshape" diff --git a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy_mkldnn.prototxt b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy_mkldnn.prototxt deleted file mode 100644 index 7d34d1aa4..000000000 --- a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/deploy_mkldnn.prototxt +++ /dev/null @@ -1,1629 +0,0 @@ -name: "VGG_VOC0712_SSD_300x300_deploy" -input: "data" -input_shape { - dim: 1 - dim: 3 - dim: 300 - dim: 300 -} -layer { - engine: "MKLDNN" - name: "conv1_1" - type: "Convolution" - bottom: "data" - top: "conv1_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 64 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu1_1" - type: "ReLU" - bottom: "conv1_1" - top: "conv1_1" -} -layer { - engine: "MKLDNN" - name: "conv1_2" - type: "Convolution" - bottom: "conv1_1" - top: "conv1_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 64 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu1_2" - type: "ReLU" - bottom: "conv1_2" - top: "conv1_2" -} -layer { - engine: "MKLDNN" - name: "pool1" - type: "Pooling" - bottom: "conv1_2" - top: "pool1" - pooling_param { - pool: MAX - kernel_size: 2 - stride: 2 - } -} -layer { - engine: "MKLDNN" - name: "conv2_1" - type: "Convolution" - bottom: "pool1" - top: "conv2_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 128 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu2_1" - type: "ReLU" - bottom: "conv2_1" - top: "conv2_1" -} -layer { - engine: "MKLDNN" - name: "conv2_2" - type: "Convolution" - bottom: "conv2_1" - top: "conv2_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 128 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu2_2" - type: "ReLU" - bottom: "conv2_2" - top: "conv2_2" -} -layer { - engine: "MKLDNN" - name: "pool2" - type: "Pooling" - bottom: "conv2_2" - top: "pool2" - pooling_param { - pool: MAX - kernel_size: 2 - stride: 2 - } -} -layer { - engine: "MKLDNN" - name: "conv3_1" - type: "Convolution" - bottom: "pool2" - top: "conv3_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu3_1" - type: "ReLU" - bottom: "conv3_1" - top: "conv3_1" -} -layer { - engine: "MKLDNN" - name: "conv3_2" - type: "Convolution" - bottom: "conv3_1" - top: "conv3_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu3_2" - type: "ReLU" - bottom: "conv3_2" - top: "conv3_2" -} -layer { - engine: "MKLDNN" - name: "conv3_3" - type: "Convolution" - bottom: "conv3_2" - top: "conv3_3" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu3_3" - type: "ReLU" - bottom: "conv3_3" - top: "conv3_3" -} -layer { - engine: "MKLDNN" - name: "pool3" - type: "Pooling" - bottom: "conv3_3" - top: "pool3" - pooling_param { - pool: MAX - kernel_size: 2 - stride: 2 - } -} -layer { - engine: "MKLDNN" - name: "conv4_1" - type: "Convolution" - bottom: "pool3" - top: "conv4_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu4_1" - type: "ReLU" - bottom: "conv4_1" - top: "conv4_1" -} -layer { - engine: "MKLDNN" - name: "conv4_2" - type: "Convolution" - bottom: "conv4_1" - top: "conv4_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu4_2" - type: "ReLU" - bottom: "conv4_2" - top: "conv4_2" -} -layer { - engine: "MKLDNN" - name: "conv4_3" - type: "Convolution" - bottom: "conv4_2" - top: "conv4_3" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu4_3" - type: "ReLU" - bottom: "conv4_3" - top: "conv4_3" -} -layer { - engine: "MKLDNN" - name: "pool4" - type: "Pooling" - bottom: "conv4_3" - top: "pool4" - pooling_param { - pool: MAX - kernel_size: 2 - stride: 2 - } -} -layer { - engine: "MKLDNN" - name: "conv5_1" - type: "Convolution" - bottom: "pool4" - top: "conv5_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - dilation: 1 - } -} -layer { - engine: "MKLDNN" - name: "relu5_1" - type: "ReLU" - bottom: "conv5_1" - top: "conv5_1" -} -layer { - engine: "MKLDNN" - name: "conv5_2" - type: "Convolution" - bottom: "conv5_1" - top: "conv5_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - dilation: 1 - } -} -layer { - engine: "MKLDNN" - name: "relu5_2" - type: "ReLU" - bottom: "conv5_2" - top: "conv5_2" -} -layer { - engine: "MKLDNN" - name: "conv5_3" - type: "Convolution" - bottom: "conv5_2" - top: "conv5_3" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - dilation: 1 - } -} -layer { - engine: "MKLDNN" - name: "relu5_3" - type: "ReLU" - bottom: "conv5_3" - top: "conv5_3" -} -layer { - engine: "MKLDNN" - name: "pool5" - type: "Pooling" - bottom: "conv5_3" - top: "pool5" - pooling_param { - pool: MAX - kernel_size: 3 - stride: 1 - pad: 1 - } -} -layer { - engine: "MKLDNN" - name: "fc6" - type: "Convolution" - bottom: "pool5" - top: "fc6" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 1024 - pad: 6 - kernel_size: 3 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - dilation: 6 - } -} -layer { - engine: "MKLDNN" - name: "relu6" - type: "ReLU" - bottom: "fc6" - top: "fc6" -} -layer { - engine: "MKLDNN" - name: "fc7" - type: "Convolution" - bottom: "fc6" - top: "fc7" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 1024 - kernel_size: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "relu7" - type: "ReLU" - bottom: "fc7" - top: "fc7" -} -layer { - engine: "MKLDNN" - name: "conv6_1" - type: "Convolution" - bottom: "fc7" - top: "conv6_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 0 - kernel_size: 1 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv6_1_relu" - type: "ReLU" - bottom: "conv6_1" - top: "conv6_1" -} -layer { - engine: "MKLDNN" - name: "conv6_2" - type: "Convolution" - bottom: "conv6_1" - top: "conv6_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 512 - pad: 1 - kernel_size: 3 - stride: 2 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv6_2_relu" - type: "ReLU" - bottom: "conv6_2" - top: "conv6_2" -} -layer { - engine: "MKLDNN" - name: "conv7_1" - type: "Convolution" - bottom: "conv6_2" - top: "conv7_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 128 - pad: 0 - kernel_size: 1 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv7_1_relu" - type: "ReLU" - bottom: "conv7_1" - top: "conv7_1" -} -layer { - engine: "MKLDNN" - name: "conv7_2" - type: "Convolution" - bottom: "conv7_1" - top: "conv7_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 1 - kernel_size: 3 - stride: 2 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv7_2_relu" - type: "ReLU" - bottom: "conv7_2" - top: "conv7_2" -} -layer { - engine: "MKLDNN" - name: "conv8_1" - type: "Convolution" - bottom: "conv7_2" - top: "conv8_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 128 - pad: 0 - kernel_size: 1 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv8_1_relu" - type: "ReLU" - bottom: "conv8_1" - top: "conv8_1" -} -layer { - engine: "MKLDNN" - name: "conv8_2" - type: "Convolution" - bottom: "conv8_1" - top: "conv8_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 0 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv8_2_relu" - type: "ReLU" - bottom: "conv8_2" - top: "conv8_2" -} -layer { - engine: "MKLDNN" - name: "conv9_1" - type: "Convolution" - bottom: "conv8_2" - top: "conv9_1" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 128 - pad: 0 - kernel_size: 1 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv9_1_relu" - type: "ReLU" - bottom: "conv9_1" - top: "conv9_1" -} -layer { - engine: "MKLDNN" - name: "conv9_2" - type: "Convolution" - bottom: "conv9_1" - top: "conv9_2" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 256 - pad: 0 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - engine: "MKLDNN" - name: "conv9_2_relu" - type: "ReLU" - bottom: "conv9_2" - top: "conv9_2" -} -layer { - name: "conv4_3_norm" - type: "Normalize" - bottom: "conv4_3" - top: "conv4_3_norm" - norm_param { - across_spatial: false - scale_filler { - type: "constant" - value: 20 - } - channel_shared: false - } -} -layer { - name: "conv4_3_norm_mbox_loc" - type: "Convolution" - bottom: "conv4_3_norm" - top: "conv4_3_norm_mbox_loc" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 16 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv4_3_norm_mbox_loc_perm" - type: "Permute" - bottom: "conv4_3_norm_mbox_loc" - top: "conv4_3_norm_mbox_loc_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv4_3_norm_mbox_loc_flat" - type: "Flatten" - bottom: "conv4_3_norm_mbox_loc_perm" - top: "conv4_3_norm_mbox_loc_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv4_3_norm_mbox_conf" - type: "Convolution" - bottom: "conv4_3_norm" - top: "conv4_3_norm_mbox_conf" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 84 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } - engine: "CAFFE" -} -layer { - name: "conv4_3_norm_mbox_conf_perm" - type: "Permute" - bottom: "conv4_3_norm_mbox_conf" - top: "conv4_3_norm_mbox_conf_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv4_3_norm_mbox_conf_flat" - type: "Flatten" - bottom: "conv4_3_norm_mbox_conf_perm" - top: "conv4_3_norm_mbox_conf_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv4_3_norm_mbox_priorbox" - type: "PriorBox" - bottom: "conv4_3_norm" - bottom: "data" - top: "conv4_3_norm_mbox_priorbox" - prior_box_param { - min_size: 30.0 - max_size: 60.0 - aspect_ratio: 2 - flip: true - clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 8 - offset: 0.5 - } -} -layer { - engine: "MKLDNN" - name: "fc7_mbox_loc" - type: "Convolution" - bottom: "fc7" - top: "fc7_mbox_loc" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 24 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "fc7_mbox_loc_perm" - type: "Permute" - bottom: "fc7_mbox_loc" - top: "fc7_mbox_loc_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "fc7_mbox_loc_flat" - type: "Flatten" - bottom: "fc7_mbox_loc_perm" - top: "fc7_mbox_loc_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "fc7_mbox_conf" - type: "Convolution" - bottom: "fc7" - top: "fc7_mbox_conf" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 126 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } - engine: "CAFFE" -} -layer { - name: "fc7_mbox_conf_perm" - type: "Permute" - bottom: "fc7_mbox_conf" - top: "fc7_mbox_conf_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "fc7_mbox_conf_flat" - type: "Flatten" - bottom: "fc7_mbox_conf_perm" - top: "fc7_mbox_conf_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "fc7_mbox_priorbox" - type: "PriorBox" - bottom: "fc7" - bottom: "data" - top: "fc7_mbox_priorbox" - prior_box_param { - min_size: 60.0 - max_size: 111.0 - aspect_ratio: 2 - aspect_ratio: 3 - flip: true - clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 16 - offset: 0.5 - } -} -layer { - engine: "MKLDNN" - name: "conv6_2_mbox_loc" - type: "Convolution" - bottom: "conv6_2" - top: "conv6_2_mbox_loc" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 24 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv6_2_mbox_loc_perm" - type: "Permute" - bottom: "conv6_2_mbox_loc" - top: "conv6_2_mbox_loc_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv6_2_mbox_loc_flat" - type: "Flatten" - bottom: "conv6_2_mbox_loc_perm" - top: "conv6_2_mbox_loc_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv6_2_mbox_conf" - type: "Convolution" - bottom: "conv6_2" - top: "conv6_2_mbox_conf" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 126 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } - engine: "CAFFE" -} -layer { - name: "conv6_2_mbox_conf_perm" - type: "Permute" - bottom: "conv6_2_mbox_conf" - top: "conv6_2_mbox_conf_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv6_2_mbox_conf_flat" - type: "Flatten" - bottom: "conv6_2_mbox_conf_perm" - top: "conv6_2_mbox_conf_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv6_2_mbox_priorbox" - type: "PriorBox" - bottom: "conv6_2" - bottom: "data" - top: "conv6_2_mbox_priorbox" - prior_box_param { - min_size: 111.0 - max_size: 162.0 - aspect_ratio: 2 - aspect_ratio: 3 - flip: true - clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 32 - offset: 0.5 - } -} -layer { - name: "conv7_2_mbox_loc" - type: "Convolution" - bottom: "conv7_2" - top: "conv7_2_mbox_loc" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 24 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv7_2_mbox_loc_perm" - type: "Permute" - bottom: "conv7_2_mbox_loc" - top: "conv7_2_mbox_loc_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv7_2_mbox_loc_flat" - type: "Flatten" - bottom: "conv7_2_mbox_loc_perm" - top: "conv7_2_mbox_loc_flat" - flatten_param { - axis: 1 - } -} -layer { - engine: "MKLDNN" - name: "conv7_2_mbox_conf" - type: "Convolution" - bottom: "conv7_2" - top: "conv7_2_mbox_conf" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 126 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv7_2_mbox_conf_perm" - type: "Permute" - bottom: "conv7_2_mbox_conf" - top: "conv7_2_mbox_conf_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv7_2_mbox_conf_flat" - type: "Flatten" - bottom: "conv7_2_mbox_conf_perm" - top: "conv7_2_mbox_conf_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv7_2_mbox_priorbox" - type: "PriorBox" - bottom: "conv7_2" - bottom: "data" - top: "conv7_2_mbox_priorbox" - prior_box_param { - min_size: 162.0 - max_size: 213.0 - aspect_ratio: 2 - aspect_ratio: 3 - flip: true - clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 64 - offset: 0.5 - } -} -layer { - engine: "MKLDNN" - name: "conv8_2_mbox_loc" - type: "Convolution" - bottom: "conv8_2" - top: "conv8_2_mbox_loc" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 16 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv8_2_mbox_loc_perm" - type: "Permute" - bottom: "conv8_2_mbox_loc" - top: "conv8_2_mbox_loc_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv8_2_mbox_loc_flat" - type: "Flatten" - bottom: "conv8_2_mbox_loc_perm" - top: "conv8_2_mbox_loc_flat" - flatten_param { - axis: 1 - } -} -layer { - engine: "MKLDNN" - name: "conv8_2_mbox_conf" - type: "Convolution" - bottom: "conv8_2" - top: "conv8_2_mbox_conf" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 84 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv8_2_mbox_conf_perm" - type: "Permute" - bottom: "conv8_2_mbox_conf" - top: "conv8_2_mbox_conf_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv8_2_mbox_conf_flat" - type: "Flatten" - bottom: "conv8_2_mbox_conf_perm" - top: "conv8_2_mbox_conf_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv8_2_mbox_priorbox" - type: "PriorBox" - bottom: "conv8_2" - bottom: "data" - top: "conv8_2_mbox_priorbox" - prior_box_param { - min_size: 213.0 - max_size: 264.0 - aspect_ratio: 2 - flip: true - clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 100 - offset: 0.5 - } -} -layer { - name: "conv9_2_mbox_loc" - type: "Convolution" - bottom: "conv9_2" - top: "conv9_2_mbox_loc" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 16 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv9_2_mbox_loc_perm" - type: "Permute" - bottom: "conv9_2_mbox_loc" - top: "conv9_2_mbox_loc_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv9_2_mbox_loc_flat" - type: "Flatten" - bottom: "conv9_2_mbox_loc_perm" - top: "conv9_2_mbox_loc_flat" - flatten_param { - axis: 1 - } -} -layer { - engine: "MKLDNN" - name: "conv9_2_mbox_conf" - type: "Convolution" - bottom: "conv9_2" - top: "conv9_2_mbox_conf" - param { - lr_mult: 1 - decay_mult: 1 - } - param { - lr_mult: 2 - decay_mult: 0 - } - convolution_param { - num_output: 84 - pad: 1 - kernel_size: 3 - stride: 1 - weight_filler { - type: "xavier" - } - bias_filler { - type: "constant" - value: 0 - } - } -} -layer { - name: "conv9_2_mbox_conf_perm" - type: "Permute" - bottom: "conv9_2_mbox_conf" - top: "conv9_2_mbox_conf_perm" - permute_param { - order: 0 - order: 2 - order: 3 - order: 1 - } -} -layer { - name: "conv9_2_mbox_conf_flat" - type: "Flatten" - bottom: "conv9_2_mbox_conf_perm" - top: "conv9_2_mbox_conf_flat" - flatten_param { - axis: 1 - } -} -layer { - name: "conv9_2_mbox_priorbox" - type: "PriorBox" - bottom: "conv9_2" - bottom: "data" - top: "conv9_2_mbox_priorbox" - prior_box_param { - min_size: 264.0 - max_size: 315.0 - aspect_ratio: 2 - flip: true - clip: false - variance: 0.1 - variance: 0.1 - variance: 0.2 - variance: 0.2 - step: 300 - offset: 0.5 - } -} -layer { - name: "mbox_loc" - type: "Concat" - bottom: "conv4_3_norm_mbox_loc_flat" - bottom: "fc7_mbox_loc_flat" - bottom: "conv6_2_mbox_loc_flat" - bottom: "conv7_2_mbox_loc_flat" - bottom: "conv8_2_mbox_loc_flat" - bottom: "conv9_2_mbox_loc_flat" - top: "mbox_loc" - concat_param { - axis: 1 - } - engine: "CAFFE" -} -layer { - name: "mbox_conf" - type: "Concat" - bottom: "conv4_3_norm_mbox_conf_flat" - bottom: "fc7_mbox_conf_flat" - bottom: "conv6_2_mbox_conf_flat" - bottom: "conv7_2_mbox_conf_flat" - bottom: "conv8_2_mbox_conf_flat" - bottom: "conv9_2_mbox_conf_flat" - top: "mbox_conf" - concat_param { - axis: 1 - } - engine: "CAFFE" -} -layer { - name: "mbox_priorbox" - type: "Concat" - bottom: "conv4_3_norm_mbox_priorbox" - bottom: "fc7_mbox_priorbox" - bottom: "conv6_2_mbox_priorbox" - bottom: "conv7_2_mbox_priorbox" - bottom: "conv8_2_mbox_priorbox" - bottom: "conv9_2_mbox_priorbox" - top: "mbox_priorbox" - concat_param { - axis: 2 - } - engine: "CAFFE" -} diff --git a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/test.prototxt b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/test.prototxt index 38152e56a..a9d4e83a9 100644 --- a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/test.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/test.prototxt @@ -1559,7 +1559,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1574,7 +1573,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1589,7 +1587,6 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } layer { name: "mbox_conf_reshape" diff --git a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/train.prototxt b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/train.prototxt index 451a5bad9..ee6685520 100644 --- a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/train.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300/train.prototxt @@ -1664,7 +1664,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_conf" @@ -1679,7 +1678,6 @@ layer { concat_param { axis: 1 } - engine: "CAFFE" } layer { name: "mbox_priorbox" @@ -1694,7 +1692,6 @@ layer { concat_param { axis: 2 } - engine: "CAFFE" } layer { name: "mbox_loss" diff --git a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300_webcam/test.prototxt b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300_webcam/test.prototxt index eaff4c56e..720ffd850 100644 --- a/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300_webcam/test.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/VOC0712/SSD_300x300_webcam/test.prototxt @@ -1552,7 +1552,6 @@ layer { top: "mbox_loc" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1567,7 +1566,6 @@ layer { top: "mbox_conf" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1582,7 +1580,6 @@ layer { top: "mbox_priorbox" concat_param { axis: 2 - engine: CAFFE } } layer { diff --git a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/deploy.prototxt b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/deploy.prototxt index fb56a59f1..1ae54d997 100644 --- a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/deploy.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/deploy.prototxt @@ -1534,7 +1534,6 @@ layer { top: "mbox_loc" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1549,7 +1548,6 @@ layer { top: "mbox_conf" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1564,7 +1562,6 @@ layer { top: "mbox_priorbox" concat_param { axis: 2 - engine: CAFFE } } layer { diff --git a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/test.prototxt b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/test.prototxt index 97e83c7f0..4d8704801 100644 --- a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/test.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/test.prototxt @@ -1559,7 +1559,6 @@ layer { top: "mbox_loc" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1574,7 +1573,6 @@ layer { top: "mbox_conf" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1589,7 +1587,6 @@ layer { top: "mbox_priorbox" concat_param { axis: 2 - engine: CAFFE } } layer { diff --git a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/train.prototxt b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/train.prototxt index ef92f1da9..698e0f669 100644 --- a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/train.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300/train.prototxt @@ -1664,7 +1664,6 @@ layer { top: "mbox_loc" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1679,7 +1678,6 @@ layer { top: "mbox_conf" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1694,7 +1692,6 @@ layer { top: "mbox_priorbox" concat_param { axis: 2 - engine: CAFFE } } layer { diff --git a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300_webcam/test.prototxt b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300_webcam/test.prototxt index c78dcccb3..4c9a9db88 100644 --- a/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300_webcam/test.prototxt +++ b/models/intel_optimized_models/ssd/VGGNet/coco/SSD_300x300_webcam/test.prototxt @@ -1552,7 +1552,6 @@ layer { top: "mbox_loc" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1567,7 +1566,6 @@ layer { top: "mbox_conf" concat_param { axis: 1 - engine: CAFFE } } layer { @@ -1582,7 +1580,6 @@ layer { top: "mbox_priorbox" concat_param { axis: 2 - engine: CAFFE } } layer { diff --git a/python/caffe/_caffe.cpp b/python/caffe/_caffe.cpp index afafe71d8..533c67295 100644 --- a/python/caffe/_caffe.cpp +++ b/python/caffe/_caffe.cpp @@ -57,6 +57,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "caffe/layers/python_layer.hpp" #include "caffe/sgd_solvers.hpp" +#ifdef USE_MLSL +#include "caffe/multinode/mlsl.hpp" +#endif + // Temporary solution for numpy < 1.7 versions: old macro, no promises. // You're strongly advised to upgrade to >= 1.7. #ifndef NPY_ARRAY_C_CONTIGUOUS @@ -89,6 +93,37 @@ const int NPY_DTYPE = NPY_FLOAT32; void set_mode_cpu() { Caffe::set_mode(Caffe::CPU); } void set_mode_gpu() { Caffe::set_mode(Caffe::GPU); } +#ifdef USE_MLSL +void InitMultinode() { + int argc = 0; + char **argv = NULL; + mn::init(&argc, &argv); +} +#endif + +int NodeId() { +#if USE_MLSL + return mn::get_node_id(); +#else + return 0; +#endif +} + +int NumNodes() { +#if USE_MLSL + return mn::get_nodes_count(); +#else + return 1; +#endif +} + +void Barrier() { +#if USE_MLSL + mn::Distribution * distrib = mn::get_distrib(); + distrib->barrier(); +#endif +} + void InitLog() { ::google::InitGoogleLogging(""); ::google::InstallFailureSignalHandler(); @@ -344,6 +379,13 @@ BOOST_PYTHON_MODULE(_caffe) { bp::scope().attr("__version__") = AS_STRING(CAFFE_VERSION); +#ifdef USE_MLSL + InitMultinode(); +#endif + bp::def("_node_id", &NodeId); + bp::def("_num_nodes", &NumNodes); + bp::def("_barrier", &Barrier); + // Caffe utility functions bp::def("init_log", &InitLog); bp::def("init_log", &InitLogLevel); diff --git a/scripts/benchmark_config_template.json b/scripts/benchmark_config_template.json new file mode 100644 index 000000000..440939c62 --- /dev/null +++ b/scripts/benchmark_config_template.json @@ -0,0 +1,38 @@ +{ + "params":{ + "topology" : "your topology like alexnet/googlenet/googlenet_v2/resnet_50/all", + "hostfile" : "/your/hostfile", + "network" : "tcp or opa", + "netmask" : "your ethernet card name like eth0", + "dummy_data_use" : true, + "scal_test" : false, + "caffe_bin" : "", + "engine" : "choose CAFFE, MKL2017 or MKLDNN" + }, + "batch_size_table" : { + "alexnet" : { + "bdw" : "1024", + "skx" : "1024", + "knl" : "512", + "knm" : "1024" + }, + "googlenet" : { + "bdw" : "128", + "skx" : "144", + "knl" : "144", + "knm" : "144" + }, + "googlenet_v2" : { + "bdw" : "128", + "skx" : "192", + "knl" : "192", + "knm" : "128" + }, + "resnet_50" : { + "bdw" : "32", + "skx" : "96", + "knl" : "64", + "knm" : "64" + } + } +} diff --git a/scripts/build_intelcaffe.sh b/scripts/build_intelcaffe.sh index c2e9a25a5..a29da73dc 100755 --- a/scripts/build_intelcaffe.sh +++ b/scripts/build_intelcaffe.sh @@ -6,6 +6,7 @@ function usage echo "Usage:" echo " $script_name [--multinode] [--compiler icc/gcc] [--rebuild] " echo " [--boost_root boost_install_dir] [--layer_timing]" + echo " [--debug]" echo "" echo " Parameters:" echo " multinode: specify it to build caffe for multinode. build for single" @@ -18,6 +19,7 @@ function usage echo " boost in directory of caffe source and build it." echo " layer_timing: build caffe for multinode with CAFFE_PER_LAYER_TIMINGS flag." echo " by default, the flag is NOT included for build." + echo " debug: build caffe with debug flag. by default, the option is off." } function check_dependency @@ -39,9 +41,6 @@ function build_caffe_gcc if [ $is_multinode_ -eq 1 ]; then echo "USE_MLSL := 1" >> Makefile.config - if [ $is_layer_timing -eq 1 ]; then - echo "CAFFE_PER_LAYER_TIMINGS := 1" >> Makefile.config - fi mlslvars_sh=`find external/mlsl/ -name mlslvars.sh` if [ -f $mlslvars_sh ]; then @@ -49,6 +48,18 @@ function build_caffe_gcc fi fi + if [ $is_layer_timing -eq 1 ]; then + echo "CAFFE_PER_LAYER_TIMINGS := 1" >> Makefile.config + fi + + if [ $debug -eq 1 ]; then + echo "DEBUG := 1" >> Makefile.config + fi + + if [ "$boost_root" != "" ]; then + echo "BOOST_ROOT := $boost_root" >> Makefile.config + fi + if [ $is_rebuild -eq 1 ]; then make clean fi @@ -90,9 +101,14 @@ function build_caffe_icc cmake_params="-DCPU_ONLY=1 -DBOOST_ROOT=$boost_root" if [ $is_multinode_ -eq 1 ]; then cmake_params+=" -DUSE_MLSL=1" - if [ $is_layer_timing -eq 1 ]; then - cmake_params+=" -DCAFFE_PER_LAYER_TIMINGS=1" - fi + fi + + if [ $is_layer_timing -eq 1 ]; then + cmake_params+=" -DCAFFE_PER_LAYER_TIMINGS=1" + fi + + if [ $debug -eq 1 ]; then + cmake_params+=" -DDEBUG=1" fi build_dir=$root_dir/build @@ -123,6 +139,7 @@ function sync_caffe_dir root_dir=$(cd $(dirname $(dirname $0)); pwd) +debug=0 is_layer_timing=0 boost_root="" is_rebuild=0 @@ -153,6 +170,9 @@ do usage exit 0 ;; + --debug) + debug=1 + ;; *) echo "Unknown option: $key" usage diff --git a/scripts/calibrator.py b/scripts/calibrator.py new file mode 100644 index 000000000..4bda3bb8d --- /dev/null +++ b/scripts/calibrator.py @@ -0,0 +1,412 @@ +#!/usr/bin/env python +# +# All modification made by Intel Corporation: Copyright (c) 2018 Intel Corporation +# +# All contributions by the University of California: +# Copyright (c) 2014, 2015, The Regents of the University of California (Regents) +# All rights reserved. +# +# All other contributions: +# Copyright (c) 2014, 2015, the respective contributors +# All rights reserved. +# For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Intel Corporation nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +import os +import sys +import copy +import argparse + +caffe_root = "../" +sys.path.insert(0, caffe_root + 'python') + +import caffe +from caffe.proto import caffe_pb2 +import google.protobuf.text_format as txtf + + +def check_existence(path): + try: + return os.path.exists(path) + except Exception as e: + raise ("Failed to check {} existence due to {}".format(path, str(e))) + + +def setup_env(): + os.chdir(os.path.dirname(os.path.abspath(params.root))) + caffe.set_mode_cpu() + + +def read_prototxt(prototxt): + try: + if not check_existence(prototxt): + return None + net = caffe_pb2.NetParameter() + with open(prototxt) as f: + txtf.Merge(f.read(), net) + + return net + + except Exception as e: + print ("Failed to read {} due to {}".format(prototxt, e)) + + +def get_bottom_layers(top_name, net, start): + bottom_layers = [] + for index, value in enumerate(net.layer[start:]): + for sub_index, sub_value in enumerate(value.bottom): + if sub_value == top_name: + bottom_layers.append((index, value.name, value.type)) + + return bottom_layers + + +def get_top_layers(l, net, end): + top_layers = [] + for layerIndex in range(0, end): + reverse_layer_index = end - layerIndex - 1 + for blobIndex in range(0, len(net.layer[reverse_layer_index].top)): + if net.layer[reverse_layer_index].top[blobIndex] in l.bottom: + top_layers.append((reverse_layer_index, net.layer[reverse_layer_index].name, + net.layer[reverse_layer_index].type)) + return top_layers + + +def get_all_top_layers(l, net, end, skip_layers, interesting_layers): + all_top_layers = [] + top_layers = get_top_layers(l, net, end) + while True: + if len(top_layers) == 0: + break + + processed_layers = top_layers # sync topLayers change + for (li, ln, lt) in processed_layers: + if lt in skip_layers: + top_layers.remove((li, ln, lt)) + continue + if lt in interesting_layers: + lp = (li, ln, lt) + top_layers.remove(lp) + if lp not in all_top_layers: + all_top_layers.append(lp) + continue + + new_top_layers = get_top_layers(net.layer[li], net, li) + top_layers.remove((li, ln, lt)) + top_layers.extend(new_top_layers) + + return all_top_layers + + +def get_all_bottom_layers(top_name, net, start, skip_layers, interesting_layers): + all_bottom_layers = [] + bottom_layers = get_bottom_layers(top_name, net, start) + while True: + if len(bottom_layers) == 0: + break + + processed_layers = bottom_layers # sync bottom_layers change + for (li, ln, lt) in processed_layers: + if lt in skip_layers: + bottom_layers.remove((li, ln, lt)) + continue + if lt in interesting_layers: + lp = (li, ln, lt) + bottom_layers.remove(lp) + if lp not in all_bottom_layers: + all_bottom_layers.append(lp) + continue + + new_bottom_layers = get_bottom_layers(ln, net, li + 1) + bottom_layers.remove((li, ln, lt)) + bottom_layers.extend(new_bottom_layers) + + return all_bottom_layers + + +def get_fusion_conv_names(compiled_model): + compiled_net = caffe_pb2.NetParameter() + with open(compiled_model) as f: + s = f.read() + txtf.Merge(s, compiled_net) + return [(layer.name, layer.bottom[1]) for _, layer in enumerate(compiled_net.layer) + if layer.type == 'Convolution' and len(layer.bottom) > 1] + + +def filter_fusion_layers(net, fusion_layer, conv_layer): + if not fusion_layer or not conv_layer: + return [] + interesting_layers = ['ReLU'] + skip_layers = ['Convolution', 'Eltwise', 'Concat'] + output_with_relu_layer = [(l.name, net.layer[index].top[0]) for l, index in conv_layer + if len(get_all_bottom_layers(net.layer[index].top[0], net, index + 1, + skip_layers, interesting_layers)) == 0] + output_without_dict = {v: k for (k, v) in output_with_relu_layer} + for layer_name, top_name in fusion_layer: + if top_name in output_without_dict.keys(): + del output_without_dict[top_name] + + return output_without_dict.values() + + +def check_relu_existence(net, start, end, exclude_layer): + if net.layer[start].type == 'Convolution' and net.layer[start].name in exclude_layer: + return False + + for i in net.layer[start + 1: end]: + if i.type == 'ReLU': + return True + return False + + +def transform_convolutions(model_path, compiled_model_path): + net = caffe_pb2.NetParameter() + with open(model_path) as f: + s = f.read() + txtf.Merge(s, net) + + fusion_layer = get_fusion_conv_names(compiled_model_path) + new_net = copy.deepcopy(net) + + convolution_layers = [(value, index) for index, value in enumerate(net.layer) if value.type == 'Convolution'] + + interesting_layers = ['ReLU'] + skip_layers = ['Convolution', 'Eltwise', 'Concat'] + + u8_max = 255 + s8_max = 127 + u8_layers = filter_fusion_layers(net, fusion_layer, convolution_layers) + for (l, index) in convolution_layers: + outputwith_relu = get_all_bottom_layers(net.layer[index].top[0], net, index + 1, skip_layers, + interesting_layers) + conv_relu_flag = check_relu_existence(net, index, + convolution_layers[convolution_layers.index((l, index)) + 1][1] + if (l, index) != convolution_layers[-1] + else len(net.layer), [i[0] for i in fusion_layer]) + inputwith_relu = get_all_top_layers(l, net, index, skip_layers, interesting_layers) + + for si in range(0, len(new_net.layer[index].quantization_param.scale_out)): + if len(outputwith_relu) > 0 or l.name in u8_layers or conv_relu_flag: # u8 + new_net.layer[index].quantization_param.scale_out[si] = round(u8_max / new_net.layer[index]. + quantization_param.scale_out[si], 2) + else: # s8 + new_net.layer[index].quantization_param.scale_out[si] = round(s8_max / new_net.layer[index]. + quantization_param.scale_out[si], 2) + + for si in range(0, len(new_net.layer[index].quantization_param.scale_in)): + if len(inputwith_relu) > 0 or l.type == 'Convolution': # u8 + new_net.layer[index].quantization_param.scale_in[si] = round(u8_max / new_net.layer[index]. + quantization_param.scale_in[si], 2) + else: + new_net.layer[index].ClearField('quantization_param') + continue + + for si in range(0, len(new_net.layer[index].quantization_param.scale_params)): + new_net.layer[index].quantization_param.scale_params[si] = round(s8_max / new_net.layer[index]. + quantization_param.scale_params[si], 2) + + with open(model_path, 'w') as f: + f.write(str(new_net)) + + +def generate_sample(sample_path, input_model, weights, + quantized_model, detection, iterations=1, error_margin=1, power=0): + cmd = '{0} quantize -model {1} -weights {2} -model_quantized {3} -iterations {4} ' \ + '-trimming_mode dynamic_fixed_point -error_margin {5} -power {6}'.format(sample_path, input_model, weights, + quantized_model, iterations, + error_margin, power) + if detection: + cmd += ' --detection=1' + + os.system(cmd) + + +def get_compiled_net(caffe_bin, model_def, model_weights, detection): + output_log_name = '.compiled_net.txt' + + cmd = '{} test -model {} -weights {} -iterations 1'.format(caffe_bin, model_def, model_weights) + if detection: + cmd += ' -detection' + cmd += ' 2>&1 > {}'.format(output_log_name) + + os.system(cmd) + return os.path.abspath(output_log_name) + + +def get_the_accuracy(caffe_bin, model_def, model_weights, iterations, detection, blob_name): + output_log_name = 'calibrator_log.txt' + cmd = '{} test -model {} -weights {} -iterations {}'.format(caffe_bin, model_def, model_weights, iterations) + if detection: + cmd += ' -detection' + cmd += ' 2>&1|tee {}'.format(output_log_name) + + os.system(cmd) + + with open(output_log_name) as f: + data = f.readlines() + + for i in data[::-1]: + if i.find('{} = '.format(blob_name)) != -1: + try: + return float(i.split('=')[-1].strip()) + except Exception as e: + print 'Failed to generate accuracy due to {}'.format(str(e)) + sys.exit(-1) + + print 'Failed to get accuracy, please check the parameters and rerun the scripts.' + sys.exit(-1) + + +def remove_top_quantized_parameter(current_quantized_file): + net = read_prototxt(current_quantized_file) + for i in net.layer: + if i.type == 'Convolution' and i.HasField('quantization_param'): + i.ClearField('quantization_param') + break + + with open(current_quantized_file, 'w') as f: + f.write(str(net)) + + +def tuning_quantized_topology(base_top1_accuracy, prototxt, caffe_bin, model_weights, iterations, + is_floating_point, accuracy_loss, detection, blob_name): + if is_floating_point == 0: + print 'Updating quantization parameter...' + + transform_convolutions(prototxt, get_compiled_net(caffe_bin, prototxt, model_weights, detection)) + + current_top1_accuracy = get_the_accuracy(caffe_bin, prototxt, model_weights, iterations, detection, blob_name) + + while abs(current_top1_accuracy - base_top1_accuracy) >= accuracy_loss: + print 'Tuning... ' + print abs(current_top1_accuracy - base_top1_accuracy) + remove_top_quantized_parameter(prototxt) + current_top1_accuracy = get_the_accuracy(caffe_bin, prototxt, model_weights, iterations, detection, blob_name) + + +def check_blob_name_existence(prototxt, blob_name): + net = read_prototxt(prototxt) + if not net.layer: + print 'Please check the model prototxt integrity.' + sys.exit(-1) + + for i in net.layer[::-1]: + for _, value in enumerate(i.top): + if value == blob_name: + return True + return False + + +if __name__ == '__main__': + usage_string = 'Usage: 1.Build the caffe\n ' \ + '2.cd /path/to/caffe/scripts\n ' \ + '3.python calibrator.py ' \ + ' -r /path/to/caffe/build ' \ + ' -w pre-trained-fp32 weights ' \ + ' -m typology ' \ + ' -i iterations ' \ + ' -l acceptable accuracy loss value, the default value is 0.01(stands for 1%)' \ + ' -d 1(0 means classification while 1 means detection, the default value is 0' \ + ' -n blob name which means accuracy.\n ' + + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument('-h', '--help', action='help', help=usage_string) + + parser.add_argument('-i', '--iterations', action='store', dest='iterations', default=10, + help='equal to the number to complete one epoch.') + + parser.add_argument('-w', '--weights', action='store', dest='weights', default='', + help='pre-trained-fp32-weights.') + + parser.add_argument('-m', '--model', action='store', dest='model', default='', + help='topology definition prototxt.') + + parser.add_argument('-l', '--accuracy_loss', action='store', dest='loss', default=0.01, + help='the acceptable accuracy loss that raised by 8-Bit quantization, ' + 'default value is 0.01(1%).') + + parser.add_argument('-d', '--detection', action='store', dest='is_detection', default=0, + help='0 for classification while 1 for detection, default value is 0.') + + parser.add_argument('-r', '--root', action='store', dest='root', default='', + help='caffe build path') + + parser.add_argument('-n', '--blob_name', action='store', dest='blob_name', default='', + help='top blob name which stands for accuracy') + params = parser.parse_args() + + try: + user_input_iterations = int(params.iterations) + except: + print 'Set the iterations to the default value 1000' + user_input_iterations = 1000 + + try: + toleration = float(params.loss) + if toleration >= 1 or toleration < 0: + toleration = 0.01 + except: + print 'Set the toleration to 1%.' + toleration = 0.01 + + try: + detection_flag = 1 if int(params.is_detection) == 1 else 0 + except: + print 'Set the test type to classification.' + detection_flag = 0 + + model = os.path.abspath(params.model) + user_input_weights = os.path.abspath(params.weights) + sample = os.path.abspath(params.root + 'tools/sample') + caffe_bin_path = os.path.abspath(params.root + 'tools/caffe') + setup_env() + + if not check_existence(model) or not check_existence(user_input_weights) or not check_existence(sample) \ + or not check_existence(caffe_bin_path): + print 'Please check model/weights/sample existence.' + sys.exit(-1) + + target_blob_name = params.blob_name + if not target_blob_name or not check_blob_name_existence(model, target_blob_name): + print 'Please specify valid blob name and rerun the script.' + sys.exit(-1) + + sys.path.insert(0, params.root + '../python') + quantized_prototxt = model.rsplit('.')[0] + '_quantized.prototxt' + quantized_weights = user_input_weights.rsplit('.')[0] + '_quantized.caffemodel' + enable_floating_point = 0 + print 'Sampling...' + generate_sample(sample, model, user_input_weights, + quantized_prototxt, detection_flag, 10, 100 * toleration, enable_floating_point) + print 'Sampling done' + print 'Generating the FP32 accuracy...' + top_1 = get_the_accuracy(caffe_bin_path, model, user_input_weights, user_input_iterations, detection_flag, + target_blob_name) + print 'FP32 accuracy is: {}'.format(top_1) + tuning_quantized_topology(top_1, quantized_prototxt, caffe_bin_path, user_input_weights, user_input_iterations, + enable_floating_point, toleration, detection_flag, target_blob_name) + + print 'Updated prototxt {} is generated.'.format(quantized_prototxt) diff --git a/scripts/prepare_env.sh b/scripts/prepare_env.sh index 6c128d892..b3a57bc75 100755 --- a/scripts/prepare_env.sh +++ b/scripts/prepare_env.sh @@ -4,14 +4,18 @@ function usage { script_name=$0 echo "Usage:" - echo " $script_name [--hostfile host_file] [--compiler icc/gcc]" + echo " $script_name [--hostfile host_file] [--compiler icc/gcc] [--help] [--skip_install] [--skip_build]" echo "" echo " Parameters:" echo " host: host file includes list of nodes. Only used when you want to install dependencies for multinode" - echo " compiler: specify compiler to build intel caffe. default compiler is icc." + echo " compiler: specify compiler to build Intel Caffe. default compiler is icc." + echo " help: print usage." + echo " skip_install: skip installing dependencies for Intel Caffe." + echo " skip_build: skip building Intel Caffe." } - +skip_install=0 +skip_build=0 compiler="icc" host_file="" while [[ $# -ge 1 ]] @@ -30,6 +34,12 @@ do usage exit 0 ;; + --skip_install) + skip_install=1 + ;; + --skip_build) + skip_build=1 + ;; *) echo "Unknown option: $key" usage @@ -41,18 +51,25 @@ done script_dir=$(cd $(dirname $0); pwd) - -params="" -if [ "$host_file" != "" ] && [ -f $host_file ]; then - params+=" --hostfile $host_file" +if [ $skip_install -eq 1 ]; then + echo "Skip installing dependencies for Intel Caffe." +else + params="" + if [ "$host_file" != "" ] && [ -f $host_file ]; then + params+=" --hostfile $host_file" + fi + $script_dir/install_deps.sh $params fi -$script_dir/install_deps.sh $params -echo "Build caffe..." -params="--compiler $compiler --rebuild " -if [ "$host_file" != "" ] && [ -f $host_file ]; then - params+=" --multinode --layer_timing" +if [ $skip_build -eq 1 ]; then + echo "Skip building Intel Caffe." +else + echo "Build Caffe..." + params="--compiler $compiler --rebuild " + if [ "$host_file" != "" ] && [ -f $host_file ]; then + params+=" --multinode --layer_timing" + fi + $script_dir/build_intelcaffe.sh $params fi -$script_dir/build_intelcaffe.sh $params echo "Done." diff --git a/scripts/run_benchmark.py b/scripts/run_benchmark.py new file mode 100755 index 000000000..3da1f5434 --- /dev/null +++ b/scripts/run_benchmark.py @@ -0,0 +1,369 @@ +import subprocess +import argparse +import re +import os +import time +import json +import socket +import logging + +topology_list = ["alexnet", "googlenet", "googlenet_v2", "resnet_50", 'all'] +class CaffeBenchmark(object): + '''Used to do caffe benchmarking''' + def __init__(self, topology, bkm_batch_size, host_file = "", network = "", tcp_netmask = "", engine = "", dummy_data_use = True, caffe_bin = "", scal_test = True): + '''params initialization''' + self.topology = topology + self.host_file = host_file + self.network = network + self.tcp_netmask = tcp_netmask + self.dummy_data_use = dummy_data_use + self.engine = engine + self.caffe_bin = caffe_bin + self.scal_test = scal_test + self.num_nodes = 1 + self.cpu_model = "skx" + # flag used to mark if we have detected which cpu model we're using + self.unknown_cpu = False + self.iterations = 100 + self.caffe_root = os.path.dirname(os.path.dirname(__file__)) + # model template path + self.model_path = self.caffe_root + "models/intel_optimized_models" + # specific script used to run intelcaffe + self.caffe_run_script = self.caffe_root + "scripts/run_intelcaffe.sh" + self.bkm_batch_size = bkm_batch_size + self.check_parameters() + current_time = time.strftime("%Y%m%d%H%M%S") + logging.basicConfig(filename = 'result-benchmark-{}.log'.format(current_time),level = logging.INFO) + + def is_supported_topology(self): + '''check if input topology is supported''' + if self.topology not in topology_list: + logging.exception("The topology you specified as {} is not supported. Supported topologies are {}".format(self.topology, topology_list)) + + def calculate_numnodes(self): + '''calculate current using nodes''' + if os.path.isfile(self.host_file): + with open(self.host_file, 'r') as f: + self.num_nodes = len([line for line in f.readlines() if line.strip() != '']) + if self.num_nodes == 0: + logging.exception("Error: empty host list. Exit.") + return self.num_nodes + + def _exec_command(self, cmd): + '''execute shell command''' + return subprocess.check_output(cmd, stderr = subprocess.STDOUT, shell = True) + + def _exec_command_and_show(self, cmd): + '''execute shell command and print it out''' + def _exec_command_and_iter_show(cmd): + out = subprocess.Popen(cmd, shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE, universal_newlines = True) + for stdout_line in iter(out.stdout.readline, ""): + yield stdout_line + return_code = out.wait() + if return_code: + raise subprocess.CalledProcessError(return_code, cmd) + for line in _exec_command_and_iter_show(cmd): + print line + + + def detect_cpu(self): + '''check which IA platform currently using''' + command_name = "lscpu | grep 'Model name' | awk -F ':' '{print $2}'" + model_string = self._exec_command(command_name) + self.model_string = model_string + #will make it configurable in the future + knl_pattern = re.compile(".*72[1359]0.*") + knm_pattern = re.compile(".*72.*") + skx_pattern = re.compile(".*[86543]1.*") + bdw_pattern = re.compile(".*(E5-[421]6|E7-[84]8|E3-12|D-?15).*") + if re.match(knl_pattern, model_string): + self.cpu_model = "knl" + elif re.match(knm_pattern, model_string): + self.cpu_model = "knm" + elif re.match(skx_pattern, model_string): + self.cpu_model = "skx" + elif re.match(bdw_pattern, model_string): + self.cpu_model = "bdw" + else: + self.unknown_cpu = True + logging.info("Can't detect which cpu model currently using, will use default settings, which may not be the optimal one.") + + def obtain_model_file(self, model): + '''change original model file batch size to bkm batch size''' + prototxt_file = "train_val_dummydata.prototxt" if self.dummy_data_use else "train_val.prototxt" + dst_model_file = "/".join([self.model_path, model, '-'.join([self.cpu_model, prototxt_file])]) + if os.path.isfile(dst_model_file): + os.remove(dst_model_file) + src_model_file = "/".join([self.model_path, model, prototxt_file]) + if not os.path.isfile(src_model_file): + logging.exception("template model file {} doesn't exist.".format(src_model_file)) + batch_size_pattern = re.compile(".*shape:.*") if self.dummy_data_use else re.compile("^\s+batch_size:.*") + # we only care about train phase batch size for benchmarking + batch_size_cnt = 2 if self.dummy_data_use else 1 + if model not in self.bkm_batch_size or self.cpu_model not in self.bkm_batch_size[model]: + logging.exception("Can't find batch size of topology {} and cpu model {} within batch size table".format(model, self.cpu_model)) + new_batch_size = self.bkm_batch_size[model][self.cpu_model] + with open(src_model_file, 'r') as src_f, open(dst_model_file, 'w') as dst_f: + cnt = 0 + for line in src_f.readlines(): + if re.match(batch_size_pattern, line) and cnt < batch_size_cnt: + #change batch size + line = re.sub("[0-9]+", new_batch_size, line, count = 1) + cnt += 1 + dst_f.write(line) + return dst_model_file + + def obtain_solver_file(self, model): + '''obtain suitable solver file for training benchmark''' + solver_prototxt_file = "solver_dummydata.prototxt" if self.dummy_data_use else "solver.prototxt" + dst_solver_file = "/".join([self.model_path, model, '-'.join([self.cpu_model, solver_prototxt_file])]) + if os.path.isfile(dst_solver_file): + os.remove(dst_solver_file) + src_solver_file = "/".join([self.model_path, model, solver_prototxt_file]) + if not os.path.isfile(src_solver_file): + logging.exception("template solver file {} doesn't exist.".format(src_solver_file)) + dst_model_file = self.obtain_model_file(model) + max_iter = "200" + display_iter = "1" + net_path_pattern = re.compile(".*net:.*") + max_iter_pattern = re.compile(".*max_iter:.*") + display_pattern = re.compile(".*display:.*") + with open(src_solver_file, 'r') as src_f, open(dst_solver_file, 'w') as dst_f: + for line in src_f.readlines(): + if re.match(net_path_pattern, line): + dst_f.write('net: "{}"\n'.format(dst_model_file)) + elif re.match(max_iter_pattern, line): + dst_f.write('max_iter: {}\n'.format(max_iter)) + elif re.match(display_pattern, line): + dst_f.write('display: {}\n'.format(display_iter)) + else: + dst_f.write(line) + return dst_solver_file + + def run_specific_model(self, model): + '''run the topology you specified''' + self.calculate_numnodes() + if self.num_nodes == 1: + model_file = self.obtain_model_file(model) + exec_command = ' '.join([self.caffe_run_script, '--model_file', model_file, '--mode time', '--iteration', str(self.iterations), '--benchmark none']) + else: + solver_file = self.obtain_solver_file(model) + exec_command = ' '.join([self.caffe_run_script, '--hostfile', self.host_file, '--solver', solver_file, '--network', self.network, '--benchmark none']) + if self.network == "tcp": + exec_command += " --netmask {}".format(self.tcp_netmask) + + if self.engine != "": + exec_command += " --engine {}".format(self.engine) + if self.caffe_bin != "": + exec_command += " --caffe_bin {}".format(self.caffe_bin) + current_time = time.strftime("%Y%m%d%H%M%S") + if not self.unknown_cpu: + self.result_log_file = "-".join(["result", self.cpu_model, model, current_time + ".log"]) + else: + self.result_log_file = "-".join(["result", "unknown", model, current_time + ".log"]) + exec_command += " 2>&1 | tee {}".format(self.result_log_file) + self._exec_command_and_show(exec_command) + self.intelcaffe_log = self.obtain_intelcaffe_log() + self.calculate_fps() + + def obtain_intelcaffe_log(self): + '''obtain the logfile of 'run_intelcaffe' ''' + logging.info("Result log file: {}".format(self.result_log_file)) + if not os.path.isfile(self.result_log_file): + logging.exception("Couldn't see result log file {}".format(result_log_file)) + result_dir = '' + with open(self.result_log_file, 'r') as f: + for line in f.readlines(): + if line.startswith('Result folder:'): + result_dir = line.split('/')[-1].strip() + break + if result_dir == "": + logging.exception("Couldn't find result folder within file".format(result_file_log)) + if not self.unknown_cpu: + caffe_log_file = "-".join(["outputCluster", self.cpu_model, str(self.num_nodes) + '.txt']) + else: + caffe_log_file = "-".join(["outputCluster", "unknown", str(self.num_nodes) + '.txt']) + intelcaffe_log = "/".join([result_dir, caffe_log_file]) + logging.info('intelcaffe log: %s' % intelcaffe_log) + return intelcaffe_log + + def obtain_average_fwd_bwd_time(self): + '''obtain average iteration time of training''' + result_file = self.intelcaffe_log + if not os.path.isfile(result_file): + logging.exception("Error: result file {} does not exist...".format(result_file)) + if self.num_nodes == 1: + average_time = "" + with open(result_file, 'r') as f: + average_fwd_bwd_time_pattern = re.compile(".*Average Forward-Backward:.*") + for line in f.readlines(): + if re.match(average_fwd_bwd_time_pattern, line): + average_time = line.split()[-2] + if average_time == "": + logging.exception("Error: can't find average forward-backward time within logs, please check logs under: {}".format(result_file)) + average_time = float(average_time) + else: + start_iteration = 100 + iteration_num = 100 + total_time = 0.0 + delta_times = [] + with open(result_file, 'r') as f: + delta_time_pattern = re.compile(".*DELTA TIME.*") + for line in f.readlines(): + if re.match(delta_time_pattern, line): + delta_times.append(line.split()[-2]) + if len(delta_times) == 0: + logging.exception("Error: check if you mark 'CAFFE_PER_LAYER_TIMINGS := 1' while building caffe; also ensure you're running at least 200 iterations for multinode trainings; or check if you're running intelcaffe failed, the logs can be found under: {}".format(result_file)) + for delta_time in delta_times[start_iteration : start_iteration + iteration_num]: + total_time += float(delta_time) + average_time = total_time / iteration_num * 1000.0 + logging.info("average time: {} ms".format(str(average_time))) + return average_time + + def obtain_batch_size(self): + '''obtain global batch size for training''' + log_file = self.intelcaffe_log + if not os.path.isfile(log_file): + logging.exception("Error: log file {} does not exist...".format(log_file)) + with open(log_file, 'r') as f: + batch_size_pattern_time = re.compile(".*SetMinibatchSize.*") + batch_size_pattern_dummy = re.compile(".*dim:.*") + batch_size_pattern_real = re.compile("^\s+batch_size:.*") + batch_size = '' + for line in f.readlines(): + if re.match(batch_size_pattern_time, line) or re.match(batch_size_pattern_real, line) or re.match(batch_size_pattern_dummy, line): + batch_size = line.split()[-1] + break + if batch_size == '': + logging.exception("Can't find batch size within your log file: {}".format(log_file)) + batch_size = int(batch_size) * self.num_nodes + logging.info("global batch size: {}".format(str(batch_size))) + return float(batch_size) + + def calculate_fps(self): + '''calculate fps here''' + self.batch_size = self.obtain_batch_size() + self.average_time = self.obtain_average_fwd_bwd_time() + speed = self.batch_size * 1000.0 / self.average_time + self.speed = int(speed) + logging.info("benchmark speed: {} images/sec".format(str(self.speed))) + return speed + + def get_local_ip_lists(self): + '''get local ip lists''' + exec_command = 'ip addr' + out = self._exec_command(exec_command) + ip_pattern = re.compile(".*inet [0-9]+.*") + self.local_ips = [] + for line in out.split('\n'): + if re.match(ip_pattern, line): + ip = line.split()[1].split('/')[0] + self.local_ips.append(ip) + if len(self.local_ips) == 0: + logging.exception("Can't find available ips on local node.") + hostname = socket.gethostname() + self.local_ips.append(hostname) + + def manipulate_host_file(self): + '''put master node ip or hostname on the first one of the host ip or hostname list''' + self.get_local_ip_lists() + self.hosts = [] + with open(self.host_file, 'r') as origin_f: + for line in origin_f.readlines(): + self.hosts.append(line.rstrip().lstrip()) + for index, ip in enumerate(self.hosts): + if ip in self.local_ips: + self.hosts[0], self.hosts[index] = self.hosts[index], self.hosts[0] + break + + + def obtain_host_file(self, num_nodes): + '''obtain suitable host file to do scaling test''' + dst_host_file = 'scal_hostfile' + with open(dst_host_file, 'w') as dst_f: + for i in xrange(num_nodes): + dst_f.write(self.hosts[i] + '\n') + return dst_host_file + + def run_scal_test(self, model): + '''scaling test on multinodes''' + num_nodes = self.calculate_numnodes() + if num_nodes <= 1 or ((num_nodes & (num_nodes - 1))) != 0: + logging.exception("nodes number: {} is not a power of 2.".format(num_nodes)) + self.manipulate_host_file() + origin_hostfile = self.host_file + fps_table = {} + while num_nodes > 0: + self.host_file = self.obtain_host_file(num_nodes) + self.run_specific_model(model) + fps_table[num_nodes] = self.speed + num_nodes /= 2 + # roll back actual num_nodes for possible topology 'all' + os.remove(self.host_file) + self.host_file = origin_hostfile + self.print_scal_test_results(fps_table) + + def print_scal_test_results(self, fps_table): + '''print scaling test results out''' + logging.info('') + logging.info('-------scaling test results----------') + logging.info('num_nodes, fps(images/s), scaling efficiency') + num_nodes, total_num_nodes = 1, self.calculate_numnodes() + while num_nodes <= total_num_nodes: + scal_efficiency = round(float(fps_table[num_nodes]) / float((num_nodes * fps_table[1])), 3) + logging.info('{}, {}, {}'.format(str(num_nodes), str(fps_table[num_nodes]), str(scal_efficiency))) + num_nodes *= 2 + logging.info('') + + def run_benchmark(self): + '''run intelcaffe training benchmark''' + self.detect_cpu() + logging.info("Cpu model: {}".format(self.model_string)) + if self.topology == 'all': + for model in topology_list: + if model == 'all': + continue + logging.info("--{}".format(model)) + if self.scal_test: + self.run_scal_test(model) + else: + self.run_specific_model(model) + else: + if self.scal_test: + self.run_scal_test(self.topology) + else: + self.run_specific_model(self.topology) + + def check_parameters(self): + '''check program parameters''' + if self.topology == "": + logging.exception("Error: topology is not specified.") + self.is_supported_topology() + if self.host_file != "": + if self.network == "tcp" and self.tcp_netmask == "": + logging.exception("Error: need to specify tcp network's netmask") + +def main(): + '''main routine''' + arg_parser = argparse.ArgumentParser(description = "Used to run intelcaffe training benchmark") + arg_parser.add_argument('--configfile', help = "config file which contains the parameters you want and the batch size you want to use on all topologies and platforms") + main_args = arg_parser.parse_args() + if main_args.configfile == '' or not os.path.isfile(main_args.configfile): + logging.exception("Cant't find config file {}.".format(main_args.configfile)) + with open(main_args.configfile, 'r') as f: + config = json.load(f) + topology = config['params']['topology'] + host_file = config['params']['hostfile'] + network = config['params']['network'] + tcp_netmask = config['params']['netmask'] + engine = config['params']["engine"] + dummy_data_use = config['params']['dummy_data_use'] + scal_test = config['params']['scal_test'] + caffe_bin = config['params']['caffe_bin'] + bkm_batch_size = config['batch_size_table'] + + caffe_benchmark = CaffeBenchmark(topology, bkm_batch_size, host_file, network, tcp_netmask, engine, dummy_data_use, caffe_bin, scal_test) + caffe_benchmark.run_benchmark() + +if __name__ == "__main__": + main() diff --git a/scripts/run_benchmark.sh b/scripts/run_benchmark.sh index d73cf9987..9ee320236 100755 --- a/scripts/run_benchmark.sh +++ b/scripts/run_benchmark.sh @@ -16,7 +16,7 @@ cpu_model="skx" unknown_cpu=0 # specify default engine for running caffe benchmarks -engine="MKLDNN" +engine="" # default support single node numnodes=1 @@ -25,7 +25,10 @@ numnodes=1 intelcaffe_log_file="" # specific script used to run intelcaffe -caffe_bin="./scripts/run_intelcaffe.sh" +caffe_run_script="./scripts/run_intelcaffe.sh" + +# path of caffe binary +caffe_bin="" # iterations to run benchmark iterations=100 @@ -37,11 +40,15 @@ host_file="" network="opa" tcp_netmask="" + +data_source="dummy" + function usage { script_name=$0 echo "Usage:" echo " $script_name --topology network_topology [--hostfile host_file] [--network opa/tcp] [--netmask tcp_netmask]" + echo " [--data_source lmdb/dummy] [--caffe_bin caffe_bin_path] [--engine engine]" echo "" echo " Parameters:" echo " topology: network topology used to benchmark, support alexnet, googlenet, googlenet_v2, resnet_50" @@ -49,6 +56,10 @@ function usage echo " hostfile: host_file needed in multinodes mode, should contain list of nodes ips or hostnames" echo " network: opa(default), tcp, used in multinodes mode to specify the network type" echo " netmask: only used if network is tcp, set as the net work card name within your network" + echo " data_source: dummy(default), lmdb. data source for neural network." + echo " caffe_bin_path: specify path of caffe binary." + echo " engine: empty value(default), MKL2017 and MKLDNN. Default empty value" + echo " is to use default engine in Intel Caffe." echo "" } @@ -79,35 +90,58 @@ function calculate_numnodes function detect_cpu { + # detect cpu model model_string=`lscpu | grep "Model name" | awk -F ':' '{print $2}'` - if [[ $model_string == *"7235"* ]] || [[ $model_string == *"7285"* ]] || [[ $model_string == *"7295"* ]]; then - cpu_model="knm" - elif [[ $model_string == *"72"* ]]; then - cpu_model="knl" - elif [[ $model_string == *"8180"* ]] || [[ $model_string == *"8124"* ]]; then - cpu_model="skx" - elif [[ $model_string == *"6148"* ]]; then - cpu_model="skx" - elif [[ $model_string == *"E5-26"* ]]; then - cpu_model="bdw" + if [[ $model_string == *"Phi"* ]]; then + if [[ $model_string =~ 72(1|3|5|9)0 ]]; then + cpu_model="knl" + elif [[ $model_string == *"72"* ]]; then + cpu_model="knm" + else + unknown_cpu=1 + echo "Can't detect which cpu model currently using, will use default settings, which may not be the optimal one." + fi else - unknown_cpu=1 - echo "Can't detect which cpu model currently using, will use default settings, which may not be the optimal one." + model_num=`echo $model_string | awk '{print $4}'` + if [[ $model_num =~ ^[8|6|5|4|3]1 ]]; then + cpu_model="skx" + elif [[ $model_num =~ ^E5-[4|2|1]6|^E7-[8|4]8|^E3-12|^D[-]?15 ]]; then + cpu_model="bdw" + else + unknown_cpu=1 + echo "Can't detect which cpu model currently using, will use default settings, which may not be the optimal one." + fi fi } function run_specific_model { if [ $numnodes -eq 1 ]; then - model_file="models/intel_optimized_models/${model}/${cpu_model}/train_val_dummydata.prototxt" - exec_command="${caffe_bin} --model_file ${model_file} --mode time --iteration ${iterations} --benchmark none" + if [ "$data_source" == "dummy" ]; then + model_file="models/intel_optimized_models/${model}/${cpu_model}/train_val_dummydata.prototxt" + else + model_file="models/intel_optimized_models/${model}/${cpu_model}/train_val.prototxt" + fi + exec_command="${caffe_run_script} --model_file ${model_file} --mode time --iteration ${iterations} --benchmark none" else - solver_file="models/intel_optimized_models/${model}/${cpu_model}/solver_dummydata.prototxt" - exec_command="${caffe_bin} --hostfile $host_file --solver $solver_file --network $network --benchmark none" + if [ "$data_source" == "dummy" ]; then + solver_file="models/intel_optimized_models/${model}/${cpu_model}/solver_dummydata.prototxt" + else + solver_file="models/intel_optimized_models/${model}/${cpu_model}/solver.prototxt" + fi + + exec_command="${caffe_run_script} --hostfile $host_file --solver $solver_file --network $network --benchmark none" if [ $network == "tcp" ]; then exec_command+=" --netmask $tcp_netmask" fi fi + + if [ "$engine" != "" ]; then + exec_command+=" --engine $engine" + fi + if [ "$caffe_bin" != "" ]; then + exec_command+=" --caffe_bin $caffe_bin" + fi # Result file to save detailed run intelcaffe results if [ $unknown_cpu -eq 0 ]; then @@ -267,6 +301,18 @@ do tcp_netmask="$2" shift ;; + --engine) + engine="$2" + shift + ;; + --data_source) + data_source="$2" + shift + ;; + --caffe_bin) + caffe_bin=$2 + shift + ;; *) echo "Unknown option: $key" usage diff --git a/scripts/run_intelcaffe.sh b/scripts/run_intelcaffe.sh index d5c2f6838..1761f6e92 100755 --- a/scripts/run_intelcaffe.sh +++ b/scripts/run_intelcaffe.sh @@ -10,7 +10,7 @@ numnodes=1 mode="train" # it's assigned by detect_cpu -cpu_model="skx" +cpu_model="" # a list of nodes host_file="" @@ -54,6 +54,8 @@ mpibench_param="allreduce" script_dir=$(dirname $0) +caffe_bin="" + function usage { script_name=$0 @@ -69,6 +71,8 @@ function usage echo " [--output output_folder]" echo " [--mpibench_bin mpibench_bin]" echo " [--mpibench_param mpibench_param]" + echo " [--caffe_bin caffe_binary_path]" + echo " [--cpu cpu_model]" echo "" echo " Parameters:" echo " hostfile: host file includes list of nodes. Only used if you're running with multinode" @@ -89,29 +93,43 @@ function usage echo " output_folder: output folder for storing results" echo " mpibench_bin: IMB-MPI1 (default). relative path of binary of mpi benchmark." echo " mpibench_param: allreduce (default). parameter of mpi benchmark." + echo " caffe_binary_path: path of caffe binary." + echo " cpu_model: specify cpu model and use the optimal settings if the CPU is not" + echo " included in supported list. Value: bdw, knl, skx and knm." + echo " bdw - Broadwell, knl - Knights Landing, skx - Skylake," + echo " knm - Knights Mill." + echo "" } -declare -a cpu_list=("Intel Xeon E5-26xx (Broadwell)" "Intel Xeon Phi 72xx (Knights Landing)" - "Intel Xeon Platinum 8180 (Skylake)" "Intel Xeon 6148 (Skylake)") +declare -a cpu_list=("Intel Xeon E7-88/48xx, E5-46/26/16xx, E3-12xx, D15/D-15 (Broadwell)" + "Intel Xeon Phi 7210/30/50/90 (Knights Landing)" + "Intel Xeon Platinum 81/61/51/41/31xx (Skylake)") function detect_cpu { # detect cpu model model_string=`lscpu | grep "Model name" | awk -F ':' '{print $2}'` - if [[ $model_string == *"7235"* ]] || [[ $model_string == *"7285"* ]] || [[ $model_string == *"7295"* ]]; then - cpu_model="knm" - elif [[ $model_string == *"72"* ]]; then - cpu_model="knl" - elif [[ $model_string == *"8180"* ]] || [[ $model_string == *"8124"* ]]; then - cpu_model="skx" - elif [[ $model_string == *"6148"* ]]; then - cpu_model="skx" - elif [[ $model_string == *"E5-26"* ]]; then - cpu_model="bdw" + if [[ $model_string == *"Phi"* ]]; then + if [[ $model_string =~ 72(1|3|5|9)0 ]]; then + cpu_model="knl" + elif [[ $model_string == *"72"* ]]; then + cpu_model="knm" + else + cpu_model="unknown" + echo "CPU model :$model_string is unknown." + echo " Use default settings, which may not be the optimal one." + fi else - cpu_model="unknown" - echo "CPU model :$model_string is unknown." - echo " Use default settings, which may not be the optimal one." + model_num=`echo $model_string | awk '{print $4}'` + if [[ $model_num =~ ^[8|6|5|4|3]1 ]]; then + cpu_model="skx" + elif [[ $model_num =~ ^E5-[4|2|1]6|^E7-[8|4]8|^E3-12|^D[-]?15 ]]; then + cpu_model="bdw" + else + cpu_model="unknown" + echo "CPU model :$model_string is unknown." + echo " Use default settings, which may not be the optimal one." + fi fi } @@ -125,11 +143,11 @@ function set_numa_node # detect numa mode: cache and flat mode for KNL numa_node=($(numactl -H | grep "available" | awk -F ' ' '{print $2}')) if [ $numa_node -eq 1 ]; then - echo "Cache mode." + echo " NUMA configuration: Cache mode." # cache mode, use numa node 0 numanode=0 else - echo "Flat mode." + echo " NUMA configuration: Flat mode." numanode=1 fi } @@ -152,12 +170,12 @@ function execute_command local xeonbin_=$1 local result_dir_=$2 - if [ "${cpu_model}" == "bdw" ]; then - exec_command="$xeonbin_" - elif [ "${cpu_model}" == "skx" ]; then + if [ "${cpu_model}" == "skx" ]; then exec_command="numactl -l $xeonbin_" - else + elif [ "${cpu_model}" == "knl" ] || [ "${cpu_model}" == "knm" ]; then exec_command="numactl --preferred=$numanode $xeonbin_" + else + exec_command="$xeonbin_" fi if [ ${numnodes} -gt 1 ]; then @@ -335,7 +353,7 @@ function test_ssh_connection { host_file_=$1 if [ "$host_file_" != "" ]; then - host_list=( `cat $host_file_ | sort | uniq ` ) + host_list=( `cat $host_file_ | sort -V | uniq ` ) for host in ${host_list[@]} do hostname=`ssh $host "hostname"` @@ -349,7 +367,7 @@ function test_ssh_connection function get_model_fname { solver_file_=$1 - model_file_=$(grep -w "net:" $solver_file_ | head -n 1 | awk -F ':' '{print $2}' | sed 's/\"//g') + model_file_=$(grep -w "net:" $solver_file_ | head -n 1 | awk -F ':' '{print $2}' | sed 's/\"//g' | sed 's/\r//g') echo "$(echo $model_file_)" } @@ -357,14 +375,13 @@ function check_lmdb_files { model_file_=$1 - lmdb_dirs=(ilsvrc12_train_lmdb ilsvrc12_val_lmdb) is_missing_lmdb=0 + lmdb_dirs=($(grep -w "source:" $model_file_ | sed 's/^ *//g' | grep -v "^#" | awk -F ' ' '{print $(NF)}' | sed 's/\"//g' | sed 's/\r//g')) for lmdb_dir in "${lmdb_dirs[@]}" do - data_source_dir=$(grep -w "$lmdb_dir" $model_file_ | head -n 1 | awk -F ' ' '{print $(NF)}' | sed 's/\"//g') - echo " LMDB data source: $data_source_dir" - if [ ! -d $data_source_dir ]; then - echo "Error: LMDB data source doesn't exist ($data_source_dir)." + echo " LMDB data source: $lmdb_dir" + if [ ! -d "$lmdb_dir" ]; then + echo "Error: LMDB data source doesn't exist ($lmdb_dir)." let is_missing_lmdb=1 fi done @@ -475,6 +492,18 @@ do --help) usage ;; + --engine) + engine=$2 + shift + ;; + --caffe_bin) + caffe_bin=$2 + shift + ;; + --cpu) + cpu_model=$2 + shift + ;; *) echo "Unknown option: $key" usage @@ -484,14 +513,18 @@ do shift done -detect_cpu - echo "" echo "CPUs with optimal settings:" for ((i=0; i<${#cpu_list[@]}; i++)) do echo " ${cpu_list[$i]}" done + +# if cpu model is not specified in command, detect cpu model by "lscpu" command +if [ "$cpu_model" == "" ]; then + detect_cpu +fi + echo "" echo "Settings:" echo " CPU: $cpu_model" @@ -565,7 +598,7 @@ fi # Names to configfile, binary (executable) files # # Add check for host_file's existence to support single node if [[ $host_file != "" ]]; then - nodenames=( `cat $host_file | sort | uniq ` ) + nodenames=( `cat $host_file | sort -V | uniq ` ) if [ ${#nodenames[@]} -eq 0 ]; then echo "Error: empty host file! Exit." exit 0 @@ -601,7 +634,10 @@ if [ "${benchmark_mode}" != "none" ]; then fi if [ "${mode}" != "none" ]; then - caffe_bin="./build/tools/caffe" + if [ "$caffe_bin" == "" ]; then + caffe_bin="${root_dir}/build/tools/caffe" + fi + check_dependency $caffe_bin if [ $? -ne 0 ]; then echo "Exit." diff --git a/scripts/set_env.sh b/scripts/set_env.sh index e2816aa5a..9d7ca6013 100755 --- a/scripts/set_env.sh +++ b/scripts/set_env.sh @@ -118,10 +118,10 @@ function set_mlsl_vars fi if [ ${num_mlsl_servers} -eq -1 ]; then - if [ "${cpu_model}" == "bdw" ] || [ "${cpu_model}" == "skx" ]; then - numservers=2 - else + if [ "${cpu_model}" == "knl" ] || [ "${cpu_model}" == "knm" ]; then numservers=4 + else + numservers=2 fi else numservers=$((num_mlsl_servers)) @@ -131,10 +131,10 @@ function set_mlsl_vars export MLSL_NUM_SERVERS=${numservers} if [ ${numservers} -gt 0 ]; then - if [ "${cpu_model}" == "bdw" ] || [ "${cpu_model}" == "skx" ]; then + if [ "${cpu_model}" == "knl" ] || [ "${cpu_model}" == "knm" ]; then listep=6,7,8,9 else - listep=6,7,8,9,10,11,12,13 + listep=6,7 fi export MLSL_SERVER_AFFINITY="${listep}" echo "MLSL_SERVER_AFFINITY: ${listep}" @@ -153,17 +153,16 @@ function set_openmp_envs ppncpu=1 threadspercore=1 + cpus=`lscpu | grep "^CPU(s):" | awk '{print $2}'` cores=`lscpu | grep "Core(s) per socket:" | awk '{print $4}'` sockets=`lscpu | grep "Socket(s)" | awk '{print $2}'` maxcores=$((cores*sockets)) if [ "$internal_thread_pin" == "on" ]; then - num_internal_threads=2 - export INTERNAL_THREADS_PIN=$((maxcores-2)),$((maxcores-1)) - else - num_internal_threads=0 + export INTERNAL_THREADS_PIN=$((cpus-2)),$((cpus-1)) + echo "Pin internal threads to: $INTERNAL_THREADS_PIN" fi - numthreads=$(((maxcores-numservers-num_internal_threads)*threadspercore)) + numthreads=$(((maxcores-numservers)*threadspercore)) numthreads_per_proc=$((numthreads/ppncpu)) # OMP configuration @@ -183,7 +182,7 @@ function set_openmp_envs export OMP_NUM_THREADS=${numthreads_per_proc} export KMP_HW_SUBSET=1t - affinitystr="proclist=[0-5,$((5+numservers+reserved_cores+1))-$((maxcores-1-num_internal_threads))],granularity=thread,explicit" + affinitystr="proclist=[0-5,$((5+numservers+reserved_cores+1))-$((maxcores-1))],granularity=thread,explicit" export KMP_AFFINITY=$affinitystr else # For single node only set for KNM diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp index 4a2beb8eb..627735ee2 100644 --- a/src/caffe/blob.cpp +++ b/src/caffe/blob.cpp @@ -245,12 +245,18 @@ shared_ptr Blob::get_prv_diff_descriptor() { template void Blob::ShareData(const Blob& other) { CHECK_EQ(count_, other.count()); + // Although the count is same, we have to forcedly sync data to cpu if shape is changed. + // This is used to avoid mismatch between cpu shape and prv data. + if(this->shape() != other.shape() && other.data()) other.data()->mutable_cpu_data(); data_ = other.data(); } template void Blob::ShareDiff(const Blob& other) { CHECK_EQ(count_, other.count()); + // Although the count is same, we have to forcedly sync data to cpu if shape is changed. + // This is used to avoid mismatch between cpu shape and prv data. + if(this->shape() != other.shape() && other.diff()) other.diff()->mutable_cpu_data(); diff_ = other.diff(); } diff --git a/src/caffe/layers/base_conv_layer.cpp b/src/caffe/layers/base_conv_layer.cpp index 205be870c..bf3f7afc3 100644 --- a/src/caffe/layers/base_conv_layer.cpp +++ b/src/caffe/layers/base_conv_layer.cpp @@ -232,11 +232,13 @@ void BaseConvolutionLayer::DoReshape(const vector*>& bottom, num_ = bottom[0]->count(0, channel_axis_); CHECK_EQ(bottom[0]->shape(channel_axis_), channels_) << "Input size incompatible with convolution kernel."; +#ifdef DISABLE_CONV_SUM_FUSION // TODO: generalize to handle inputs of different shapes. for (int bottom_id = 1; bottom_id < bottom.size(); ++bottom_id) { CHECK(bottom[0]->shape() == bottom[bottom_id]->shape()) << "All inputs must have the same shape."; } +#endif // Shape the tops. bottom_shape_ = &bottom[0]->shape(); compute_output_shape(); diff --git a/src/caffe/layers/mkldnn_concat_layer.cpp b/src/caffe/layers/mkldnn_concat_layer.cpp index 7da1fb8c8..3f86c2f75 100644 --- a/src/caffe/layers/mkldnn_concat_layer.cpp +++ b/src/caffe/layers/mkldnn_concat_layer.cpp @@ -273,7 +273,8 @@ void MKLDNNConcatLayer::InitConcatFwd(const vector*>& bottom, } engine cpu_engine = CpuEngine::Instance().get_engine(); - memory::data_type data_type = memory::data_type::f32; + memory::data_type usr_dt = memory::data_type::f32; + memory::data_type prv_dt = usr_dt; // memory::format mfmt_any = memory::format::any; memory::format mfmt_nchw = memory::format::nchw; @@ -284,6 +285,25 @@ void MKLDNNConcatLayer::InitConcatFwd(const vector*>& bottom, fwd_bottom_data.clear(); fwd_input_primitives_.clear(); fwd_input_primitives_at_.clear(); + + int fl = 0; + int fl_min = 0; + float scale = 1.; + float scale_min = 1.; + for (auto i = 0; i < num_concats_; i++) { + if (const_cast(bottom[i]->prv_data()) != NULL) { + shared_ptr > mem_descr + = get_mkldnn_prv_descriptor(bottom[i]); + fl = mem_descr->get_fl(0); + if (fl_min == 0) fl_min = fl; + if(fl != 0 && fl < fl_min) fl_min = fl; + scale = mem_descr->get_scale(0); + if (scale_min == 1.) scale_min = scale; + if(scale != 1. && scale < scale_min) scale_min = scale; + } + } + + bool bottom_is_float = false; for (auto i = 0; i < num_concats_; i++) { fwd_bottom_data.push_back(boost::shared_ptr >()); @@ -308,37 +328,63 @@ void MKLDNNConcatLayer::InitConcatFwd(const vector*>& bottom, memory::format src_mfmt = mfmt_nchw; shared_ptr prv_src_mpd; shared_ptr usr_src_mpd( - new memory::primitive_desc({input_tz, data_type, mfmt_nchw}, cpu_engine)); - + new memory::primitive_desc({input_tz, usr_dt, mfmt_nchw}, cpu_engine)); + if (const_cast(bottom[i]->prv_data()) != NULL) { + fl = 0; + scale = 1.; shared_ptr > mem_descr = get_mkldnn_prv_descriptor(bottom[i]); + bottom_is_float = mem_descr->get_float(); src_mfmt = static_cast( mem_descr->prv_memory_pd()->desc().data.format); + prv_dt = static_cast(mem_descr->prv_memory_pd()->desc().data.data_type); prv_src_mpd.reset(new memory::primitive_desc( - {input_tz, data_type, src_mfmt}, cpu_engine)); + {input_tz, prv_dt, src_mfmt}, cpu_engine)); + fl = mem_descr->get_fl(0); + if(fl != 0) fl = fl_min; + scale = mem_descr->get_scale(0); + if(scale != 1.) scale = scale_min; } + std::vector fl_bottom; + fl_bottom.push_back(fl); + std::vector scale_bottom; + scale_bottom.push_back(scale); srcs_mpd.push_back(memory::primitive_desc( - {input_tz, data_type, src_mfmt}, cpu_engine)); - - fwd_bottom_data[i].reset(new MKLDNNData( - usr_src_mpd, prv_src_mpd, bottom[i], this)); - + {input_tz, prv_dt, src_mfmt}, cpu_engine)); + + if(bottom_is_float){ + fwd_bottom_data[i].reset(new MKLDNNData( + usr_src_mpd, prv_src_mpd, bottom[i], this, true, scale_bottom)); + } else{ + fwd_bottom_data[i].reset(new MKLDNNData( + usr_src_mpd, prv_src_mpd, bottom[i], this, fl_bottom)); + } fwd_input_primitives_.push_back(fwd_bottom_data[i]->create_input(false)); fwd_input_primitives_at_.push_back(*fwd_input_primitives_[i]); } shared_ptr usr_dst_mpd(new memory::primitive_desc( - {output_tz, data_type, mfmt_nchw}, cpu_engine)); + {output_tz, usr_dt, mfmt_nchw}, cpu_engine)); concatFwd_pd.reset(new concat::primitive_desc(concat_dimension, srcs_mpd)); shared_ptr prv_dst_mpd(new memory::primitive_desc( concatFwd_pd->dst_primitive_desc())); - fwd_top_data.reset(new MKLDNNData(usr_dst_mpd, prv_dst_mpd, top[0], - this)); + std::vector fl_top; + fl_top.push_back(fl_min); + std::vector scale_top; + scale_top.push_back(scale_min); + if(bottom_is_float){ + fwd_top_data.reset(new MKLDNNData(usr_dst_mpd, prv_dst_mpd, top[0], + this, true, scale_top)); + } else{ + fwd_top_data.reset(new MKLDNNData(usr_dst_mpd, prv_dst_mpd, top[0], + this, fl_top)); + } + fwd_output_memory = fwd_top_data->create_output_memory(); concatFwd.reset(new concat(*concatFwd_pd, fwd_input_primitives_at_, *fwd_output_memory)); diff --git a/src/caffe/layers/mkldnn_convolution_layer.cpp b/src/caffe/layers/mkldnn_convolution_layer.cpp index 6d0778adb..d3f462998 100644 --- a/src/caffe/layers/mkldnn_convolution_layer.cpp +++ b/src/caffe/layers/mkldnn_convolution_layer.cpp @@ -52,7 +52,7 @@ namespace caffe { template MKLDNNConvolutionLayer::MKLDNNConvolutionLayer(const LayerParameter& param) - : MKLDNNLayer(), ConvolutionLayer(param) + : MKLDNNLayer(param), ConvolutionLayer(param) , fwd_bottom_data(NULL), fwd_top_data(NULL), fwd_weights_data(NULL), fwd_bias_data(NULL) , bwdd_weights_data(NULL), bwdw_bottom_data(NULL) , bwdd_bottom_diff(NULL), bwdd_top_diff(NULL) @@ -99,6 +99,7 @@ void MKLDNNConvolutionLayer::init_properties(const vector*>& this->pad_h_ = this->pad_.cpu_data()[0]; this->kernel_w_ = this->kernel_shape_.cpu_data()[1]; this->kernel_h_ = this->kernel_shape_.cpu_data()[0]; + string _conv_algorithm = this->layer_param_.convolution_param().conv_algorithm(); if(_conv_algorithm == "direct") { @@ -120,6 +121,8 @@ void MKLDNNConvolutionLayer::LayerSetUp(const vector*>& botto , const vector*>& top) { VLOG(1) << "<< MKLDNNConvolutionLayer::LayerSetUp: " << this->layer_param_.name(); + if (this->layer_param_.has_quantization_param() && this->phase_ == TEST) this->need_quantize_ = true; + ConvolutionLayer::LayerSetUp(bottom, top); init_properties(bottom, top); this->bottom_shape_ = &bottom[0]->shape(); @@ -145,6 +148,11 @@ void MKLDNNConvolutionLayer::Reshape(const vector*>& bottom this->num_ == bottom[0]->num()) ? false : true; init_properties(bottom, top); BaseConvolutionLayer::ReshapeForMKL(bottom, top); +#ifndef DISABLE_CONV_SUM_FUSION + if (bottom.size() > 1) { + top[0]->ShareData(*bottom[1]); + } +#endif } template @@ -179,6 +187,42 @@ void MKLDNNConvolutionLayer::InitConvolutionFwd(const vector* // ---- Initialize memory descriptors (fromat = any) to create convolution descriptor ------------- memory::data_type mpcsn = memory::data_type::f32; + memory::data_type bottom_dt = this->need_quantize_ ? memory::data_type::u8 : memory::data_type::f32; + memory::data_type top_dt = memory::data_type::f32; + + if (this->need_quantize_) { + if (this->bw_layer_out_ == 8) { + if (relu) { + top_dt = memory::data_type::u8; + } + else { + top_dt = memory::data_type::s8; + } + } + else { + top_dt = memory::data_type::s32; + } + } + + bool is_sum; + if (bottom.size() > 1) { + is_sum = true; + + memory::data_type bottom_1_dt = memory::data_type::f32; + if (const_cast(bottom[1]->prv_data()) != NULL){ + + shared_ptr > bottom_1_desc = + get_mkldnn_prv_descriptor(bottom[1]); + bottom_1_dt = static_cast(bottom_1_desc->prv_memory_pd()->desc().data.data_type); + } + + if (top_dt != bottom_1_dt) { + top_dt = bottom_1_dt; + } + } + + memory::data_type weights_dt = this->need_quantize_ ? memory::data_type::s8 : memory::data_type::f32; + memory::data_type bias_dt = this->need_quantize_ ? memory::data_type::s32 : memory::data_type::f32; memory::format mfmt_any = memory::format::any; memory::dims bottom_tz = {n, ic, ih, iw}; @@ -187,27 +231,68 @@ void MKLDNNConvolutionLayer::InitConvolutionFwd(const vector* memory::dims weights_tz = (g!= 1) ? memory::dims{g, oc/g, ic/g, kh, kw} : memory::dims{oc, ic, kh, kw}; // ---- Memory descriptors for initializing of convolution primitive descriptor ------------- - memory::desc init_bottom_md({bottom_tz}, mpcsn, mfmt_any); - memory::desc init_bias_md({bias_tz}, mpcsn, mfmt_any); - memory::desc init_top_md({top_tz}, mpcsn, mfmt_any); - memory::desc init_weights_md({weights_tz}, mpcsn, mfmt_any); - + memory::desc init_bottom_md({bottom_tz}, bottom_dt, mfmt_any); + memory::desc init_bias_md({bias_tz}, bias_dt, mfmt_any); + memory::desc init_top_md({top_tz}, top_dt, mfmt_any); + memory::desc init_weights_md({weights_tz}, weights_dt, mfmt_any); + + primitive_attr attr; + if (this->need_quantize_) { + if(this->scale_in_.size() > 0) this->is_float_ = true; + int mask = 0; + std::vector scales; + int count = 1; // 1 for single channel, oc for multi channel + for(int i=0; iis_float_){ + scale = this->scale_out_[0] / (this->scale_in_[0] * this->scale_params_[i]); + } else{ + int output_shift = this->fl_layer_out_[0] - this->fl_layer_in_[0] - this->fl_params_[i]; + scale = pow(2. ,output_shift); + } + scales.push_back(scale); + } + attr.set_output_scales(mask,scales); + attr.set_int_output_round_mode(round_nearest); + } + // ---- Determining engine to use ----------------------- std::string subengines = this->layer_param_.engine(); if (subengines == "" || subengines == "MKLDNN") subengines = "MKLDNN:CPU"; EngineParser ep(subengines); unsigned subEngineIndex = 0; - shared_ptr convReluFwd_pd = NULL; mkldnn::algorithm eligibleAlgorithms[2] = {conv_algorithm, algorithm::convolution_direct}; convFwd_pd = NULL; - mkldnn::primitive_attr attr; mkldnn::post_ops ops; - + +#ifndef DISABLE_CONV_SUM_FUSION + if(relu || bottom.size() > 1) { +#else if(relu) { - float scale = 1.0f; //for fp32, scale is 1. +#endif + float scale = 1.0f; Dtype alpha = negative_slope; // negative slope for mkldnn_eltwise_relu. float beta = 1.0f; //ignored for mkldnn_eltwise_relu. +#ifndef DISABLE_CONV_SUM_FUSION + if (bottom.size() > 1) { + if (this->need_quantize_) { + float sum_scale; + if(this->is_float_){ + sum_scale = this->scale_out_[0] / + get_mkldnn_prv_descriptor(bottom[1])->get_scale(0); + } else{ + int sum_shift = + this->fl_layer_out_[0] - + get_mkldnn_prv_descriptor(bottom[1])->get_fl(0); + sum_scale = pow(2., sum_shift); + } + ops.append_sum(sum_scale); + } else { + ops.append_sum(1.0f); + } + } +#endif ops.append_eltwise(scale, eltwise_relu, alpha, beta); attr.set_post_ops(ops); } @@ -230,10 +315,13 @@ void MKLDNNConvolutionLayer::InitConvolutionFwd(const vector* for (subEngineIndex = 0; subEngineIndex < ep.getNumberOfSubEngines(); subEngineIndex++) { try { - if (relu) { - convFwd_pd.reset(new convolution_forward::primitive_desc( +#ifndef DISABLE_CONV_SUM_FUSION + if(this->need_quantize_ || relu || bottom.size() > 1) { +#else + if(relu) { +#endif + convFwd_pd.reset(new convolution_forward::primitive_desc( *convFwd_desc, attr, ep.getMKLDNNSubEngine(subEngineIndex))); - } else { convFwd_pd.reset(new convolution_forward::primitive_desc( *convFwd_desc, ep.getMKLDNNSubEngine(subEngineIndex))); @@ -258,36 +346,110 @@ void MKLDNNConvolutionLayer::InitConvolutionFwd(const vector* shared_ptr prv_fwd_top_data_memory_pd(new MemPD(convFwd_pd->dst_primitive_desc())); shared_ptr prv_fwd_weights_data_memory_pd(new MemPD(convFwd_pd->weights_primitive_desc())); + // ---- Log prv memory primitive descriptors ------------- + info_mem_pd(prv_fwd_bottom_data_memory_pd, "conv_src:" + this->layer_param_.name()); + info_mem_pd(prv_fwd_top_data_memory_pd, "conv_dst:" + this->layer_param_.name()); + // ---- Create usr memory primitive descriptors ------------- memory::format mfmt_nchw = memory::format::nchw; memory::format weights_mfmt = (g!= 1) ? memory::format::goihw : memory::format::oihw; // TODO: There should not be a problem to use this for Backward as well + shared_ptr usr_bottom_data_memory_pd(new MemPD({{bottom_tz}, mpcsn, mfmt_nchw}, cpu_engine)); shared_ptr usr_bias_data_memory_pd(new MemPD({{bias_tz}, mpcsn, memory::format::x}, cpu_engine)); shared_ptr usr_top_data_memory_pd(new MemPD({{top_tz}, mpcsn, mfmt_nchw}, cpu_engine)); shared_ptr usr_weights_data_memory_pd(new MemPD({{weights_tz}, mpcsn, weights_mfmt}, cpu_engine)); - // --- init primitive and prv_memory descriptors ---------------------- - fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_memory_pd, prv_fwd_bottom_data_memory_pd, bottom[0], this)); - fwd_bottom_data ->name = "fwd_bottom_data @ " + this->layer_param_.name(); + bool bottom_is_float = false; + if (const_cast(bottom[0]->prv_data()) != NULL) { + shared_ptr > blob_prv_mkldnn_mem_descr = get_mkldnn_prv_descriptor(bottom[0]); + bottom_is_float = blob_prv_mkldnn_mem_descr->get_float(); + } + if (this->need_quantize_){ + if(this->is_float_ || bottom_is_float){ + std::vector scale_bottom; + scale_bottom.push_back(this->scale_in_[0]); + fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_memory_pd, prv_fwd_bottom_data_memory_pd, bottom[0], this, true, scale_bottom)); + } else{ + std::vector fl_bottom; + fl_bottom.push_back(this->fl_layer_in_[0]); + fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_memory_pd, prv_fwd_bottom_data_memory_pd, bottom[0], this, fl_bottom)); + } + } else if(bottom_is_float){ + fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_memory_pd, prv_fwd_bottom_data_memory_pd, bottom[0], this, false)); + } else{ + fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_memory_pd, prv_fwd_bottom_data_memory_pd, bottom[0], this)); + } + fwd_bottom_data->name = "fwd_bottom_data @ " + this->layer_param_.name(); fwd_bottom_data_primitive = fwd_bottom_data->create_input(false); - fwd_top_data.reset(new MKLDNNData(usr_top_data_memory_pd, prv_fwd_top_data_memory_pd, top[0], this)); - fwd_top_data ->name = "fwd_top_data @ " + this->layer_param_.name(); + if (this->need_quantize_){ + if(this->is_float_ || bottom_is_float){ + std::vector scale_top; + scale_top.push_back(this->scale_out_[0]); + fwd_top_data.reset(new MKLDNNData(usr_top_data_memory_pd, prv_fwd_top_data_memory_pd, top[0], this, true, scale_top, is_sum)); + } else{ + std::vector fl_top; + fl_top.push_back(this->fl_layer_out_[0]); + fwd_top_data.reset(new MKLDNNData(usr_top_data_memory_pd, prv_fwd_top_data_memory_pd, top[0], this, fl_top, is_sum)); + } + } else if(bottom_is_float){ + fwd_top_data.reset(new MKLDNNData(usr_top_data_memory_pd, prv_fwd_top_data_memory_pd, top[0], this, false)); + } else{ + fwd_top_data.reset(new MKLDNNData(usr_top_data_memory_pd, prv_fwd_top_data_memory_pd, top[0], this)); + } + fwd_top_data->name = "fwd_top_data @ " + this->layer_param_.name(); fwd_top_data_memory = fwd_top_data->create_output_memory(); - fwd_weights_data.reset(new MKLDNNData(usr_weights_data_memory_pd, prv_fwd_weights_data_memory_pd, this->blobs_[0].get(), this)); + if (this->need_quantize_){ + int count = 1; // 1 for single channel, oc for multi channel + if(this->is_float_ || bottom_is_float){ + std::vector scale_weight; + for(int i=0; iscale_params_[i]); + } + fwd_weights_data.reset(new MKLDNNData(usr_weights_data_memory_pd, prv_fwd_weights_data_memory_pd, this->blobs_[0].get(), this, true, scale_weight)); + } else{ + std::vector fl_weight; + for(int i=0; ifl_params_[i]); + } + fwd_weights_data.reset(new MKLDNNData(usr_weights_data_memory_pd, prv_fwd_weights_data_memory_pd, this->blobs_[0].get(), this, fl_weight)); + } + } else if(bottom_is_float){ + fwd_weights_data.reset(new MKLDNNData(usr_weights_data_memory_pd, prv_fwd_weights_data_memory_pd, this->blobs_[0].get(), this, false)); + } else{ + fwd_weights_data.reset(new MKLDNNData(usr_weights_data_memory_pd, prv_fwd_weights_data_memory_pd, this->blobs_[0].get(), this)); + } fwd_weights_data->name = "fwd_weights_data @ " + this->layer_param_.name(); fwd_weights_data_primitive = fwd_weights_data->create_input(true); if (this->bias_term_) { shared_ptr prv_fwd_bias_data_memory_pd(new MemPD(convFwd_pd->bias_primitive_desc())); - fwd_bias_data.reset(new MKLDNNData(usr_bias_data_memory_pd, prv_fwd_bias_data_memory_pd, this->blobs_[1].get(), this)); + if (this->need_quantize_){ + int count = 1; // 1 for single channel, oc for multi channel + if(this->is_float_ || bottom_is_float){ + std::vector scale_bias; + for(int i=0; iscale_in_[0] * this->scale_params_[i]); + } + fwd_bias_data.reset(new MKLDNNData(usr_bias_data_memory_pd, prv_fwd_bias_data_memory_pd, this->blobs_[1].get(), this, true, scale_bias)); + } else{ + std::vector fl_bias; + for(int i=0; ifl_layer_in_[0] + this->fl_params_[i]); + } + fwd_bias_data.reset(new MKLDNNData(usr_bias_data_memory_pd, prv_fwd_bias_data_memory_pd, this->blobs_[1].get(), this, fl_bias)); + } + } else if(bottom_is_float){ + fwd_bias_data.reset(new MKLDNNData(usr_bias_data_memory_pd, prv_fwd_bias_data_memory_pd, this->blobs_[1].get(), this, false)); + } else{ + fwd_bias_data.reset(new MKLDNNData(usr_bias_data_memory_pd, prv_fwd_bias_data_memory_pd, this->blobs_[1].get(), this)); + } fwd_bias_data->name = "fwd_bias_data @ " + this->layer_param_.name(); fwd_bias_data_primitive = fwd_bias_data->create_input(true); - convFwd.reset(new convolution_forward(*convFwd_pd , *fwd_bottom_data_primitive, *fwd_weights_data_primitive , *fwd_bias_data_primitive, *fwd_top_data_memory)); @@ -319,6 +481,7 @@ void MKLDNNConvolutionLayer::Forward_cpu(const vector*>& bott , const vector*>& top) { VLOG(1) << "MKLDNNConvolutionLayer::Forward_cpu: " << this->layer_param_.name(); + if( convFwd_pd == NULL || this->reshape) InitConvolutionFwd(bottom, top); // making reorders if needed. @@ -532,7 +695,6 @@ void MKLDNNConvolutionLayer::InitConvolutionBwd(const vector* MKLDNNPrimitive bwdd_weights_data_primitive_transfer(bwdd_weights_data_primitive); bwdd_weights_data->set_mkldnn_primitive(bwdd_weights_data_primitive_transfer); - //bwdw_bottom_data->set_mkldnn_primitive(convBwdWeights); //Wrong passed primitive! (TODO: Checking!) MKLDNNPrimitive bwdw_bottom_data_primitive_transfer(bwdw_bottom_data_primitive); bwdw_bottom_data->set_mkldnn_primitive(bwdw_bottom_data_primitive_transfer); @@ -561,6 +723,8 @@ void MKLDNNConvolutionLayer::Backward_cpu(const vector*>& top , const vector*>& bottom) { VLOG(1) << "MKLDNNConvolutionLayer::Backward_cpu: " << this->layer_param_.name(); + bool top_diff_is_prv = (const_cast(top[0]->prv_diff()) != NULL); + if( convBwdData_pd == NULL || this->reshape) InitConvolutionBwd(top, propagate_down, bottom); if (propagate_down[0]) { @@ -619,6 +783,13 @@ void MKLDNNConvolutionLayer::Backward_cpu(const vector*>& top PERFORMANCE_MEASUREMENT_END_ID(perf_id_bw_); } if (this->param_propagate_down(0)) { + // We have to sync top diff to cpu explicitly. This is used to make + // bwdw_top_diff->sync_before_read() have chance to get coverted data as + // bwdd_top_diff->sync_before_read() have updated top diff's prv_data + // to self. This issue only happens when MKLDNN conv layer is followed + // by a CAFFE layer and conversion is needed. + if (!top_diff_is_prv && propagate_down[0]) + top[0]->mutable_cpu_diff(); // making reorders if needed. bwdw_top_diff->sync_before_read(); bwdw_bottom_data->sync_before_read(); diff --git a/src/caffe/layers/mkldnn_eltwise_layer.cpp b/src/caffe/layers/mkldnn_eltwise_layer.cpp index ba47f1fa5..ec4bc08f2 100644 --- a/src/caffe/layers/mkldnn_eltwise_layer.cpp +++ b/src/caffe/layers/mkldnn_eltwise_layer.cpp @@ -147,8 +147,6 @@ void MKLDNNEltwiseLayer::InitEltwiseFwd(const vector*>& botto memory::format mfmt_nchw = memory::format::nchw; // ---- Initialize memory descriptors ------------- - shared_ptr bottom_data_md, top_data_md; - std::vector bottom_data_mpd; fwd_bottom_data.clear(); fwd_bottom_data_primitives_.clear(); @@ -168,15 +166,9 @@ void MKLDNNEltwiseLayer::InitEltwiseFwd(const vector*>& botto = get_mkldnn_prv_descriptor(bottom[i]); bottom_data_mfmt = static_cast( mem_descr->prv_memory_pd()->desc().data.format); - bottom_data_md.reset(new memory::desc(mem_descr->prv_memory_pd()->desc())); prv_bottom_data_mpd.reset(new memory::primitive_desc( {{n, ic, ih, iw}, mpcsn, bottom_data_mfmt}, cpu_engine)); } - else - { - bottom_data_md.reset(new memory::desc({{n, ic, ih, iw}}, mpcsn, bottom_data_mfmt)); - } - top_data_md = bottom_data_md; bottom_data_mpd.push_back(memory::primitive_desc( {{n, ic, ih, iw}, mpcsn, bottom_data_mfmt}, cpu_engine)); diff --git a/src/caffe/layers/mkldnn_inner_product_layer.cpp b/src/caffe/layers/mkldnn_inner_product_layer.cpp index 1c7def27d..9994df789 100644 --- a/src/caffe/layers/mkldnn_inner_product_layer.cpp +++ b/src/caffe/layers/mkldnn_inner_product_layer.cpp @@ -56,7 +56,7 @@ namespace caffe { template MKLDNNInnerProductLayer::MKLDNNInnerProductLayer( const LayerParameter& param) : - MKLDNNLayer(), + MKLDNNLayer(param), InnerProductLayer(param), fwd_bottom_data(NULL), fwd_top_data(NULL), @@ -530,6 +530,7 @@ void MKLDNNInnerProductLayer::Backward_cpu(const vector*>& to #ifdef DEBUG LOG(INFO) << "MKLDNNInnerProductLayer::Backward_cpu: " << this->layer_param_.name(); #endif + bool top_diff_is_prv = (const_cast(top[0]->prv_diff()) != NULL); if( ipBwdData_pd == NULL || this->reshape) InitInnerProductBwd(top, propagate_down, bottom); @@ -590,6 +591,13 @@ void MKLDNNInnerProductLayer::Backward_cpu(const vector*>& to PERFORMANCE_MEASUREMENT_END_ID(perf_id_bw_); } if (this->param_propagate_down(0)) { + // We have to sync top diff to cpu explicitly. This is used to make + // bwdw_top_diff->sync_before_read() have chance to get coverted data as + // bwdd_top_diff->sync_before_read() have updated top diff's prv_data + // to self. This issue only happens when MKLDNN innerproduct layer is + // followed by a CAFFE layer and conversion is needed. + if (!top_diff_is_prv && propagate_down[0]) + top[0]->mutable_cpu_diff(); // making reorders if needed. bwdw_top_diff->sync_before_read(); bwdw_bottom_data->sync_before_read(); diff --git a/src/caffe/layers/mkldnn_lrn_layer.cpp b/src/caffe/layers/mkldnn_lrn_layer.cpp index 41c0f45b6..d3c3147fd 100644 --- a/src/caffe/layers/mkldnn_lrn_layer.cpp +++ b/src/caffe/layers/mkldnn_lrn_layer.cpp @@ -46,7 +46,7 @@ namespace caffe { template MKLDNNLRNLayer::MKLDNNLRNLayer(const LayerParameter& param) - : MKLDNNLayer(), Layer(param) + : MKLDNNLayer(param), Layer(param) , fwd_top_data(NULL), fwd_bottom_data(NULL) , bwd_top_diff(NULL), bwd_bottom_diff(NULL) , lrnFwd_pd(NULL), lrnBwd_pd(NULL) @@ -140,21 +140,24 @@ void MKLDNNLRNLayer::InitLRNFwd(const vector*>& bottom, const engine cpu_engine = CpuEngine::Instance().get_engine(); memory::data_type mpcsn = memory::data_type::f32; - // ---- Initialize memory descriptors ------------- memory::dims tz = {n, ic, ih, iw}; - shared_ptr top_md; - shared_ptr usr_mpd, prv_mpd; + memory::format mfmt_nchw = memory::format::nchw; + memory::format cmfmt = mfmt_nchw; + + // ---- Initialize memory descriptors ------------- + typedef typename memory::primitive_desc MemPD; // short name for memory::primitive_desc + + // ---- Create usr memory primitive descriptors ------------- + shared_ptr usr_data_memory_pd(new MemPD({{tz}, mpcsn, mfmt_nchw}, cpu_engine)); + + // ---- Create prv memory descriptors ------------------- if (bottom_data_is_prv) { shared_ptr > mem_descr = get_mkldnn_prv_descriptor(bottom[0]); - bottom_md.reset(new memory::desc(mem_descr->prv_memory_pd()->desc())); - usr_mpd = mem_descr->usr_memory_pd(); - prv_mpd = mem_descr->prv_memory_pd(); - } else { - bottom_md.reset(new memory::desc({tz}, mpcsn, memory::format::nchw)); - usr_mpd.reset(new memory::primitive_desc(*bottom_md, cpu_engine)); + cmfmt = static_cast(mem_descr->prv_memory_pd()->desc().data.format); } - top_md = bottom_md; + + bottom_md.reset(new memory::desc({tz}, mpcsn, cmfmt)); // ---- Initialize LRN primitive descriptor ------------- lrn_forward::desc lrnFwd_desc(propagation, lrn_algorithm, *bottom_md, @@ -179,20 +182,15 @@ void MKLDNNLRNLayer::InitLRNFwd(const vector*>& bottom, const CHECK(lrnFwd_pd); // ---- Create priv memory primitive descriptors stored as class members ------------- - typedef typename memory::primitive_desc MemPD; // short name for memory::primitive_desc shared_ptr prv_fwd_bottom_data_memory_pd(new MemPD(lrnFwd_pd->src_primitive_desc())); shared_ptr prv_fwd_top_data_memory_pd(new MemPD(lrnFwd_pd->dst_primitive_desc())); - - // ---- Create usr memory primitive descriptors ------------- - memory::format mfmt_nchw = memory::format::nchw; - - shared_ptr usr_data_memory_pd(new MemPD({{tz}, mpcsn, mfmt_nchw}, cpu_engine)); + shared_ptr prv_memory_pd(new MemPD(lrnFwd_pd->dst_primitive_desc())); // --- init primitive and prv_memory descriptors ---------------------- fwd_bottom_data.reset(new MKLDNNData(usr_data_memory_pd, prv_fwd_bottom_data_memory_pd, bottom[0], this)); fwd_bottom_data->name = "fwd_bottom_data @ " + this->layer_param_.name(); fwd_bottom_data_primitive = fwd_bottom_data->create_input(false); - fwd_top_data.reset(new MKLDNNData(usr_mpd, prv_fwd_top_data_memory_pd, top[0], this)); + fwd_top_data.reset(new MKLDNNData(usr_data_memory_pd, prv_fwd_top_data_memory_pd, top[0], this)); fwd_top_data->name = "fwd_top_data @ " + this->layer_param_.name(); fwd_top_data_memory = fwd_top_data->create_output_memory(); @@ -220,6 +218,7 @@ void MKLDNNLRNLayer::Forward_cpu(const vector*>& bottom VLOG(1) << "MKLDNNLRNLayer::Forward_cpu: " << this->layer_param_.name(); if( lrnFwd_pd == NULL || this->reshape) InitLRNFwd(bottom, top); + // making reorders if needed. fwd_bottom_data->sync_before_read(); // update top that head at prv diff --git a/src/caffe/layers/mkldnn_pooling_layer.cpp b/src/caffe/layers/mkldnn_pooling_layer.cpp index 239ee66af..c672dd889 100644 --- a/src/caffe/layers/mkldnn_pooling_layer.cpp +++ b/src/caffe/layers/mkldnn_pooling_layer.cpp @@ -276,12 +276,19 @@ void MKLDNNPoolingLayer::InitPoolingFwd(const vector*>& botto shared_ptr usr_bottom_data_mpd(new MemPD({{bottom_tz}, mpcsn, mfmt_nchw}, cpu_engine)); shared_ptr usr_top_data_mpd(new MemPD({{top_tz}, mpcsn, mfmt_nchw}, cpu_engine)); + std::vector fl; + std::vector scale; + bool bottom_is_float = false; if (bottom_data_is_prv) { shared_ptr > mem_descr = get_mkldnn_prv_descriptor(bottom[0]); + bottom_is_float = mem_descr->get_float(); cmfmt = static_cast(mem_descr->prv_memory_pd()->desc().data.format); mpcsn = static_cast(mem_descr->prv_memory_pd()->desc().data.data_type); + fl.push_back(mem_descr->get_fl(0)); + scale.push_back(mem_descr->get_scale(0)); } + shared_ptr init_fwd_bottom_md(new memory::desc({bottom_tz}, mpcsn, cmfmt)); shared_ptr init_fwd_top_md(new memory::desc({top_tz}, mpcsn, cmfmt)); @@ -315,9 +322,12 @@ void MKLDNNPoolingLayer::InitPoolingFwd(const vector*>& botto if (bottom_data_is_prv) { prv_fwd_bottom_data_mpd.reset(new MemPD(*init_fwd_bottom_md, engine)); prv_fwd_top_data_mpd.reset(new MemPD(*init_fwd_top_md, engine)); + // ---- Log prv memory primitive descriptors ------------- + info_mem_pd(prv_fwd_bottom_data_mpd, "pooling_src:" + this->layer_param_.name()); + info_mem_pd(prv_fwd_top_data_mpd, "pooling_dst:" + this->layer_param_.name()); } - // ---- Create prv memory --------------------- + // ---- Create priv memory --------------------- // We'll output the mask to top[1] if it's of size >1. uint32_t* mask = NULL; // suppress warnings about uninitalized variables @@ -327,10 +337,18 @@ void MKLDNNPoolingLayer::InitPoolingFwd(const vector*>& botto : max_idx_.mutable_cpu_data(); // --- init primitive and prv_memory descriptors ---------------------- - fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_mpd, prv_fwd_bottom_data_mpd, bottom[0], this)); + if(bottom_is_float){ + fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_mpd, prv_fwd_bottom_data_mpd, bottom[0], this, true, scale)); + } else { + fwd_bottom_data.reset(new MKLDNNData(usr_bottom_data_mpd, prv_fwd_bottom_data_mpd, bottom[0], this, fl)); + } fwd_bottom_data_primitive = fwd_bottom_data->create_input(false); - fwd_top_data.reset(new MKLDNNData(usr_top_data_mpd, prv_fwd_top_data_mpd, top[0], this)); + if(bottom_is_float){ + fwd_top_data.reset(new MKLDNNData(usr_top_data_mpd, prv_fwd_top_data_mpd, top[0], this, true, scale)); + } else{ + fwd_top_data.reset(new MKLDNNData(usr_top_data_mpd, prv_fwd_top_data_mpd, top[0], this, fl)); + } fwd_top_data_memory = fwd_top_data->create_output_memory(); if (propagation == prop_kind::forward_training && diff --git a/src/caffe/layers/mkldnn_relu_layer.cpp b/src/caffe/layers/mkldnn_relu_layer.cpp index e21b24a5c..364063f12 100644 --- a/src/caffe/layers/mkldnn_relu_layer.cpp +++ b/src/caffe/layers/mkldnn_relu_layer.cpp @@ -203,6 +203,21 @@ void MKLDNNReLULayer::InitReLUBwd(const vector*>& top shared_ptr usr_diff_mpd = NULL; shared_ptr prv_diff_mpd = NULL; + bool bottom_data_is_prv = (const_cast(bottom[0]->prv_data()) != NULL); + + // ---- Initialize memory descriptors ------------- + shared_ptr bottom_data_md; + shared_ptr usr_data_mpd(NULL), prv_data_mpd(NULL); + if (bottom_data_is_prv) { + shared_ptr > mem_descr + = get_mkldnn_prv_descriptor(bottom[0]); + usr_data_mpd = mem_descr->usr_memory_pd(); + prv_data_mpd = mem_descr->prv_memory_pd(); + } else { + bottom_data_md.reset(new memory::desc({{n, ic, ih, iw}}, mpcsn, memory::format::nchw)); + usr_data_mpd.reset(new memory::primitive_desc(*bottom_data_md, cpu_engine)); + } + if (top_diff_is_prv) { shared_ptr > mem_descr = get_mkldnn_prv_descriptor(top[0]); @@ -286,11 +301,15 @@ void MKLDNNReLULayer::InitReLUBwd(const vector*>& top bwd_top_diff->name = "bwd_top_diff_data @ " + this->layer_param_.name(); bwd_top_diff_primitive = bwd_top_diff->create_input(/* set_prv_ptr */ false); + bwd_bottom_data.reset(new MKLDNNData(usr_data_mpd, prv_data_mpd, bottom[0], this)); + bwd_bottom_data->name = "bwd_bottom_data @ " + this->layer_param_.name(); + bwd_bottom_data_primitive = bwd_bottom_data->create_input(/* set_prv_ptr */ false); + bwd_bottom_diff.reset(new MKLDNNDiff(usr_diff_mpd, prv_diff_mpd, bottom[0], this)); bwd_bottom_diff->name = "bwd_bottom_diff_data @ " + this->layer_param_.name(); bwd_bottom_diff_memory = bwd_bottom_diff->create_output_memory(inplace); - reluBwd.reset(new relu_backward(*reluBwd_pd, *fwd_bottom_data_primitive, *bwd_top_diff_primitive, *bwd_bottom_diff_memory)); + reluBwd.reset(new relu_backward(*reluBwd_pd, *bwd_bottom_data_primitive, *bwd_top_diff_primitive, *bwd_bottom_diff_memory)); //bwd_top_diff->set_mkldnn_primitive(reluBwd); //Wrong passed primitive! (TODO: Checking!) MKLDNNPrimitive bwd_top_diff_primitive_transfer(bwd_top_diff_primitive); bwd_top_diff->set_mkldnn_primitive(bwd_top_diff_primitive_transfer); @@ -319,6 +338,7 @@ void MKLDNNReLULayer::Backward_cpu(const vector*>& top } bwd_top_diff->sync_before_read(); + bwd_bottom_data->sync_before_read(); //For MKLDNN, it always create two memory for input and output //For Intel Caffe, if we set the inplace flag to true, input and output will use one same buffer //Then the update of output will not pass to MKLDNN diff --git a/src/caffe/layers/softmax_loss_layer.cpp b/src/caffe/layers/softmax_loss_layer.cpp index 1ac0cf6b8..b9e3fc3b8 100644 --- a/src/caffe/layers/softmax_loss_layer.cpp +++ b/src/caffe/layers/softmax_loss_layer.cpp @@ -226,7 +226,8 @@ void SoftmaxWithLossLayer::Backward_cpu(const vector*>& top, ratio = (alpha + (dim - 1) * beta); // for label true, alpha - yi (alpha + (N-1) * beta) // for label false, beta - yj (alpha + (N-1) * beta) - caffe_cpu_axpby(bottom[0]->count(), Dtype(ratio), bottom_diff, Dtype(-beta), bottom_diff); + caffe_scal(bottom[0]->count(), Dtype(ratio), bottom_diff); + caffe_add_scalar(bottom[0]->count(), Dtype(-beta), bottom_diff); } Dtype weight_sum = Dtype(0); const Dtype* weights = bottom[2]->cpu_data(); @@ -263,7 +264,8 @@ void SoftmaxWithLossLayer::Backward_cpu(const vector*>& top, ratio = (alpha + (dim - 1) * beta); // for label true, alpha - yi (alpha + (N-1) * beta) // for label false, beta - yj (alpha + (N-1) * beta) - caffe_cpu_axpby(bottom[0]->count(), Dtype(ratio), bottom_diff, Dtype(-beta), bottom_diff); + caffe_scal(bottom[0]->count(), Dtype(ratio), bottom_diff); + caffe_add_scalar(bottom[0]->count(), Dtype(-beta), bottom_diff); } int count = 0; for (int i = 0; i < outer_num_; ++i) { diff --git a/src/caffe/mkldnn_base.cpp b/src/caffe/mkldnn_base.cpp index 7f07478ba..a20c5b8ae 100644 --- a/src/caffe/mkldnn_base.cpp +++ b/src/caffe/mkldnn_base.cpp @@ -66,6 +66,39 @@ shared_ptr MKLDNNPrimitive::submit() { return mkldnn_stream; } +template +MKLDNNLayer::MKLDNNLayer(const LayerParameter ¶m) : + BaseQuantLayer() { + if (param.has_quantization_param()) { + this->precision_ = param.quantization_param().precision(); + this->rounding_ = param.quantization_param().rounding_scheme(); + switch (this->precision_) { + case QuantizationParameter_Precision_DYNAMIC_FIXED_POINT: + this->bw_layer_in_ = param.quantization_param().bw_layer_in(); + this->bw_layer_out_ = param.quantization_param().bw_layer_out(); + this->bw_params_ = param.quantization_param().bw_params(); + for (int i = 0; i < param.quantization_param().fl_layer_in_size(); i++) + this->fl_layer_in_.push_back(param.quantization_param().fl_layer_in(i)); + for (int i = 0; i < param.quantization_param().fl_layer_out_size(); i++) + this->fl_layer_out_.push_back(param.quantization_param().fl_layer_out(i)); + for (int i = 0; i < param.quantization_param().fl_params_size(); i++) + this->fl_params_.push_back(param.quantization_param().fl_params(i)); + //floating point + for (int i = 0; i < param.quantization_param().scale_in_size(); i++) + this->scale_in_.push_back(param.quantization_param().scale_in(i)); + for (int i = 0; i < param.quantization_param().scale_out_size(); i++) + this->scale_out_.push_back(param.quantization_param().scale_out(i)); + for (int i = 0; i < param.quantization_param().scale_params_size(); i++) + this->scale_params_.push_back(param.quantization_param().scale_params(i)); + + break; + default: + LOG(FATAL) << "Unknown precision mode: " << this->precision_; + break; + } + } +} + template class MKLDNNLayer; template class MKLDNNLayer; template class MKLDNNPrimitive; diff --git a/src/caffe/mkldnn_memory.cpp b/src/caffe/mkldnn_memory.cpp index 13691c4bb..d2c170ee4 100644 --- a/src/caffe/mkldnn_memory.cpp +++ b/src/caffe/mkldnn_memory.cpp @@ -46,15 +46,42 @@ template MKLDNNMemoryDescriptorBase::MKLDNNMemoryDescriptorBase(shared_ptr usr_memory_pd , shared_ptr prv_memory_pd , Blob* blob - , MKLDNNLayer* mkldnn_layer) + , MKLDNNLayer* mkldnn_layer + , bool is_float + , std::vector scale + , bool is_sum) : name("MKLDNNMemoryDescriptorBase") , _reorder_usr2prv_pd(), _reorder_prv2usr_pd(), _reorder_extprv2prv_pd() ,_prv_memory(), _internal_ptr(NULL), _usr_memory(), _cpu_ptr(NULL) , _mkldnn_layer(NULL) { - set_usr_memory_pd(usr_memory_pd); - set_prv_memory_pd(prv_memory_pd); + set_usr_memory_pd(usr_memory_pd, scale); + set_prv_memory_pd(prv_memory_pd, scale); set_mkldnn_layer(mkldnn_layer); + this->set_scale(scale); + this->set_sum(is_sum); + this->set_float(is_float); + this->_blob = blob; +} + +template +MKLDNNMemoryDescriptorBase::MKLDNNMemoryDescriptorBase(shared_ptr usr_memory_pd + , shared_ptr prv_memory_pd + , Blob* blob + , MKLDNNLayer* mkldnn_layer + , std::vector fl + , bool is_sum) + : name("MKLDNNMemoryDescriptorBase") + , _reorder_usr2prv_pd(), _reorder_prv2usr_pd(), _reorder_extprv2prv_pd() + ,_prv_memory(), _internal_ptr(NULL), _usr_memory(), _cpu_ptr(NULL) + , _mkldnn_layer(NULL) +{ + set_usr_memory_pd(usr_memory_pd, fl); + set_prv_memory_pd(prv_memory_pd, fl); + set_mkldnn_layer(mkldnn_layer); + this->set_fl(fl); + this->set_sum(is_sum); + this->set_float(false); this->_blob = blob; } @@ -74,29 +101,112 @@ void MKLDNNMemoryDescriptorBase::check_usr_with_prv_descriptors() } template -void MKLDNNMemoryDescriptorBase::create_reorder_descriptors() +void MKLDNNMemoryDescriptorBase::create_reorder_descriptors(std::vector scale, std::vector scale_ext, bool is_sum) { CHECK(_usr_memory_pd); CHECK(_prv_memory_pd); + + primitive_attr attri; + int mask = 0; + if ( *_usr_memory_pd != *_prv_memory_pd) { + std::vector scales_u2p; + for(int i=0; i( - new reorder::primitive_desc(*_usr_memory_pd, *_prv_memory_pd)); + new reorder::primitive_desc(*_usr_memory_pd, *_prv_memory_pd, attri)); + std::vector scales_p2u; + for(int i=0; i( - new reorder::primitive_desc(*_prv_memory_pd, *_usr_memory_pd)); + new reorder::primitive_desc(*_prv_memory_pd, *_usr_memory_pd, attri)); } - if ( _extprv_memory_pd && *_prv_memory_pd != *_extprv_memory_pd) { - _reorder_extprv2prv_pd = shared_ptr( - new reorder::primitive_desc(*_extprv_memory_pd, *_prv_memory_pd)); + if ( _extprv_memory_pd && (*_prv_memory_pd != *_extprv_memory_pd || scale != scale_ext)) { + if(is_sum == true && scale == scale_ext && _extprv_memory_pd->desc().data.data_type == memory::data_type::s8 && _prv_memory_pd->desc().data.data_type == memory::data_type::u8){ +#ifdef DEBUG + LOG(INFO) << "skip s8 to u8 reorder...."; +#endif + _reorder_extprv2prv_pd = NULL; + }else{ + std::vector scales_e2p; + for(int i=0; iint8 blob_prv_mkldnn_mem_descr->get_scale() will always be 0 ? + scales_e2p.push_back(shift_scale); + } + attri.set_output_scales(mask, scales_e2p); + attri.set_int_output_round_mode(round_nearest); + _reorder_extprv2prv_pd = shared_ptr(new reorder::primitive_desc(*_extprv_memory_pd, *_prv_memory_pd, attri)); + + } } } +template +void MKLDNNMemoryDescriptorBase::create_reorder_descriptors(std::vector fl, std::vector fl_ext, bool is_sum) +{ + CHECK(_usr_memory_pd); + CHECK(_prv_memory_pd); + + primitive_attr attri; + int mask = 0; + + if ( *_usr_memory_pd != *_prv_memory_pd) { + std::vector scales_u2p; + for(int i=0; i( + new reorder::primitive_desc(*_usr_memory_pd, *_prv_memory_pd, attri)); + + std::vector scales_p2u; + for(int i=0; i( + new reorder::primitive_desc(*_prv_memory_pd, *_usr_memory_pd, attri)); + } + if ( _extprv_memory_pd && (*_prv_memory_pd != *_extprv_memory_pd || fl != fl_ext)) { + if(is_sum == true && fl == fl_ext && _extprv_memory_pd->desc().data.data_type == memory::data_type::s8 && _prv_memory_pd->desc().data.data_type == memory::data_type::u8){ +#ifdef DEBUG + LOG(INFO) << "skip s8 to u8 reorder...."; +#endif + _reorder_extprv2prv_pd = NULL; + }else{ + std::vector scales_e2p; + for(int i=0; iint8 blob_prv_mkldnn_mem_descr->get_fl() will always be 0 ? + float scale = pow(2, shift_fl); + scales_e2p.push_back(scale); + } + attri.set_output_scales(mask, scales_e2p); + attri.set_int_output_round_mode(round_nearest); + _reorder_extprv2prv_pd = shared_ptr(new reorder::primitive_desc(*_extprv_memory_pd, *_prv_memory_pd, attri)); + + } + } +} template MKLDNNMemoryDescriptor::MKLDNNMemoryDescriptor(shared_ptr usr_memory_pd , shared_ptr prv_memory_pd - , Blob* blob, MKLDNNLayer* mkldnn_layer) - : MKLDNNMemoryDescriptorBase(usr_memory_pd, prv_memory_pd, blob, mkldnn_layer) + , Blob* blob, MKLDNNLayer* mkldnn_layer + , bool is_float + , std::vector scale + , bool is_sum) + : MKLDNNMemoryDescriptorBase(usr_memory_pd, prv_memory_pd, blob, mkldnn_layer, is_float, scale, is_sum) { const Dtype* prv_ptr = is_diff ? blob->prv_diff() : blob->prv_data(); @@ -106,11 +216,36 @@ template LOG(INFO) << "Format of blob-prv-memory-pd: " << blob_prv_mkldnn_mem_descr->prv_memory_pd()->desc().data.format; LOG(INFO) << "Format of this-prv-memory-pd: " << this->prv_memory_pd()->desc().data.format; #endif - if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd()) { + if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd() || blob_prv_mkldnn_mem_descr->get_scale() != this->get_scale()) { +#ifdef DEBUG + LOG(INFO) << "Formats of blob-prv-memory-pd and this-prv-memory-pd are not equal !"; +#endif + this->set_extprv_memory_pd(blob_prv_mkldnn_mem_descr->prv_memory_pd(), scale, blob_prv_mkldnn_mem_descr->get_scale(), blob_prv_mkldnn_mem_descr->get_sum()); + } + } +} + +template + MKLDNNMemoryDescriptor::MKLDNNMemoryDescriptor(shared_ptr usr_memory_pd + , shared_ptr prv_memory_pd + , Blob* blob, MKLDNNLayer* mkldnn_layer + , std::vector fl + , bool is_sum) + : MKLDNNMemoryDescriptorBase(usr_memory_pd, prv_memory_pd, blob, mkldnn_layer, fl, is_sum) +{ + const Dtype* prv_ptr = is_diff ? blob->prv_diff() : blob->prv_data(); + + if (prv_ptr != NULL) { + shared_ptr > blob_prv_mkldnn_mem_descr = get_mkldnn_prv_descriptor(blob); +#ifdef DEBUG + LOG(INFO) << "Format of blob-prv-memory-pd: " << blob_prv_mkldnn_mem_descr->prv_memory_pd()->desc().data.format; + LOG(INFO) << "Format of this-prv-memory-pd: " << this->prv_memory_pd()->desc().data.format; +#endif + if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd() || blob_prv_mkldnn_mem_descr->get_fl() != this->get_fl()) { #ifdef DEBUG LOG(INFO) << "Formats of blob-prv-memory-pd and this-prv-memory-pd are not equal !"; #endif - this->set_extprv_memory_pd(blob_prv_mkldnn_mem_descr->prv_memory_pd()); + this->set_extprv_memory_pd(blob_prv_mkldnn_mem_descr->prv_memory_pd(), fl, blob_prv_mkldnn_mem_descr->get_fl(), blob_prv_mkldnn_mem_descr->get_sum()); } } } @@ -141,8 +276,8 @@ void MKLDNNMemoryDescriptor::convert_to_prv(void* cpu_ptr) VLOG(1) << "--- MKLDNNMemoryDescriptorBase::convert_to_prv --- " << this->name; #ifdef DEBUG LOG(INFO) << "Reorder: from usr to prv."; - LOG(INFO) << "Format of _usr_memory_pd: " << this->_usr_memory_pd->desc().data.format; - LOG(INFO) << "Format of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.format; + LOG(INFO) << "Format of _usr_memory_pd: " << this->_usr_memory_pd->desc().data.format << " Data_type of _usr_memory_pd: " << this->_usr_memory_pd->desc().data.data_type; + LOG(INFO) << "Format of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.format << " Data_type of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.data_type; #endif PERFORMANCE_MEASUREMENT_BEGIN(); this->_reorder_usr2prv.submit(); @@ -180,6 +315,8 @@ void MKLDNNMemoryDescriptor::convert_from_prv(void* cpu_ptr) LOG(INFO) << "Reorder: from prv to usr."; LOG(INFO) << "Format of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.format; LOG(INFO) << "Format of _usr_memory_pd: " << this->_usr_memory_pd->desc().data.format; + LOG(INFO) << "Format of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.format << " Data_type of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.data_type; + LOG(INFO) << "Format of _usr_memory_pd: " << this->_usr_memory_pd->desc().data.format << " Data_type of _usr_memory_pd: " << this->_usr_memory_pd->desc().data.data_type; #endif PERFORMANCE_MEASUREMENT_BEGIN(); this->_reorder_prv2usr.submit(); @@ -206,19 +343,19 @@ void MKLDNNMemoryDescriptor::convert_from_extprv(shared_ptr_reorder_extprv2prv_pd == NULL) return; - if (*this->_extprv_memory_pd == *this->_prv_memory_pd) - { -#ifdef DEBUG - LOG(INFO) << "The format and data_type of _extprv_memory_pd and _prv_memory_pd is same, no need do conversion."; -#endif - return; - } +// if (*this->_extprv_memory_pd == *this->_prv_memory_pd) +// { +//#ifdef DEBUG +// LOG(INFO) << "The format and data_type of _extprv_memory_pd and _prv_memory_pd is same, no need do conversion."; +//#endif +// return; +// } create_reorder_from_extprv(aprimitive); VLOG(1) << "--- MKLDNNMemoryDescriptorBase::convert_from_extprv --- " << this->name; #ifdef DEBUG LOG(INFO) << "Reorder: from extprv to prv."; - LOG(INFO) << "Format of _extprv_memory_pd: " << this->_extprv_memory_pd->desc().data.format; - LOG(INFO) << "Format of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.format; + LOG(INFO) << "Format of _extprv_memory_pd: " << this->_extprv_memory_pd->desc().data.format << " Data_type of _extprv_memory_pd: " << this->_extprv_memory_pd->desc().data.data_type; + LOG(INFO) << "Format of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.format<< " Data_type of _prv_memory_pd: " << this->_prv_memory_pd->desc().data.data_type; #endif PERFORMANCE_MEASUREMENT_BEGIN(); this->_reorder_extprv2prv.submit(); @@ -260,6 +397,10 @@ shared_ptr MKLDNNMemoryDescriptor::get_blob_prv_primi ,bool set_prv_ptr, bool convert ,MKLDNNMemoryDescriptor* converted_in_fwd) { +#ifdef DEBUG + LOG(INFO) << "GET_BLOB_PRV_PRIMITIVE"; +#endif + if (!this->conversion_needed()) { return shared_ptr(); // TODO: may be CHECK ? } @@ -271,10 +412,12 @@ shared_ptr MKLDNNMemoryDescriptor::get_blob_prv_primi // TODO: use previously done conversion on forward - needed for training NOT_IMPLEMENTED; } - if(convert) + if(convert) { this->convert_to_prv(const_cast(is_diff ? blob->cpu_diff() : blob->cpu_data())); - else + } + else { this->create_reorder_to_prv(const_cast(is_diff ? blob->cpu_diff() : blob->cpu_data())); + } if (set_prv_ptr) { if (is_diff) { blob->set_prv_diff_descriptor(this->get_shared_ptr(), false); @@ -291,17 +434,35 @@ shared_ptr MKLDNNMemoryDescriptor::get_blob_prv_primi return this->reorder_usr2prv(); } else { shared_ptr > blob_prv_mkldnn_mem_descr = get_mkldnn_prv_descriptor(blob); - - if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd()) { - // prv in blob and in this descrptor may have different layouts - if(convert) - this->convert_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); - else - this->create_reorder_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); - return this->reorder_extprv2prv(); - } else if (blob_prv_mkldnn_mem_descr.get() != this) { - VLOG(1) << "layout OK " << blob_prv_mkldnn_mem_descr->name << " == " << this->name; - } + if(blob_prv_mkldnn_mem_descr->get_float() || this->get_float()){ + if ((*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd() || blob_prv_mkldnn_mem_descr->get_scale() != this->get_scale()) && this->_reorder_extprv2prv_pd != NULL) { + // prv in blob and in this descrptor may have different layouts + if(convert) { + LOG(INFO) << "BAD CONVERT"; + this->convert_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); + } + else { + this->create_reorder_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); + } + return this->reorder_extprv2prv(); + } else if (blob_prv_mkldnn_mem_descr.get() != this) { + VLOG(1) << "layout OK " << blob_prv_mkldnn_mem_descr->name << " == " << this->name; + } + } else{ + if ((*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd() || blob_prv_mkldnn_mem_descr->get_fl() != this->get_fl()) && this->_reorder_extprv2prv_pd != NULL) { + // prv in blob and in this descrptor may have different layouts + if(convert) { + LOG(INFO) << "BAD CONVERT"; + this->convert_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); + } + else { + this->create_reorder_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); + } + return this->reorder_extprv2prv(); + } else if (blob_prv_mkldnn_mem_descr.get() != this) { + VLOG(1) << "layout OK " << blob_prv_mkldnn_mem_descr->name << " == " << this->name; + } + } return blob_prv_mkldnn_mem_descr->aprimitive(); } NOT_IMPLEMENTED; @@ -312,6 +473,10 @@ shared_ptr MKLDNNMemoryDescriptor::get_blob_prv_primi template void MKLDNNMemoryDescriptor::sync_before_read() { +#ifdef DEBUG + LOG(INFO) << "SYNC_BEFORE_READ"; +#endif + // TODO: need to optimize code if (!this->conversion_needed()) { return; @@ -323,7 +488,7 @@ void MKLDNNMemoryDescriptor::sync_before_read() this->convert_to_prv(const_cast(is_diff ? this->_blob->cpu_diff() : this->_blob->cpu_data())); // if blob has not prv descriptor then set it to avoid conversions on next iterations if (is_diff) { - this->_blob->set_prv_diff_descriptor(this->get_shared_ptr(), false); + this->_blob->set_prv_diff_descriptor(this->get_shared_ptr(), true); // Original: // below line designated to set correspondent SyncedMemory->_head to HEAD_AT_CPU // TODO: need to optimize @@ -344,14 +509,33 @@ void MKLDNNMemoryDescriptor::sync_before_read() } else { shared_ptr > blob_prv_mkldnn_mem_descr = get_mkldnn_prv_descriptor(this->_blob); - if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd()) { - // prv in blob and in this descrptor may have different layouts - this->convert_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); - } else { - if (is_diff) { - this->_blob->mutable_prv_diff(); + if(blob_prv_mkldnn_mem_descr->get_float() || this->get_float()){ + if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd() || blob_prv_mkldnn_mem_descr->get_scale() != this->get_scale()) { + // prv in blob and in this descrptor may have different layouts +#ifdef DEBUG + LOG(INFO) << "Convert from extprv"; +#endif + this->convert_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); + } else { + if (is_diff) { + this->_blob->mutable_prv_diff(); + } else { + this->_blob->mutable_prv_data(); + } + } + } else{ + if (*blob_prv_mkldnn_mem_descr->prv_memory_pd() != *this->prv_memory_pd() || blob_prv_mkldnn_mem_descr->get_fl() != this->get_fl()) { + // prv in blob and in this descrptor may have different layouts +#ifdef DEBUG + LOG(INFO) << "Convert from extprv"; +#endif + this->convert_from_extprv(blob_prv_mkldnn_mem_descr->aprimitive()); } else { - this->_blob->mutable_prv_data(); + if (is_diff) { + this->_blob->mutable_prv_diff(); + } else { + this->_blob->mutable_prv_data(); + } } } } diff --git a/src/caffe/multinode/multi_solver.cpp b/src/caffe/multinode/multi_solver.cpp index 4f3df7838..686e076eb 100644 --- a/src/caffe/multinode/multi_solver.cpp +++ b/src/caffe/multinode/multi_solver.cpp @@ -43,67 +43,72 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include "caffe/multinode/multi_solver.hpp" +#include "caffe/util/performance.hpp" namespace caffe { #ifdef CAFFE_PER_LAYER_TIMINGS -#define LAYER_TIMING_START() do { \ - root_solver_->timer.Start(); \ +#define LAYER_TIMING_START(name, index) do { \ + if (root_solver_->net()->phase() == TRAIN) { \ + root_solver_->net()->name##_start_time_per_layer[index] = root_solver_->net()->timer.Duration(); \ + } \ }while(0) -#define LAYER_TIMING_STOP(name, index) do { \ - root_solver_->name##_time_per_layer[index] += root_solver_->timer.MicroSeconds(); \ +#define LAYER_TIMING_STOP_2(layer_time_name, name, index) do { \ + if (root_solver_->net()->phase() == TRAIN) { \ + root_solver_->net()->name##_stop_time_per_layer[index] = root_solver_->net()->timer.Duration(); \ + root_solver_->net()->layer_time_name##_time_per_layer[index] += (root_solver_->net()->name##_stop_time_per_layer[index] - root_solver_->net()->name##_start_time_per_layer[index]); \ + } \ }while(0) +#define LAYER_TIMING_STOP(name, index) LAYER_TIMING_STOP_2(name,name,index) + #ifdef FW_OVERLAP_OPT -#define LAYER_WAIT_TIMING_START() do { \ - root_solver_->wait_timer.Start(); \ +#define LAYER_WAIT_TIMING_START(index) do { \ + if (root_solver_->net()->phase() == TRAIN) { \ + root_solver_->net()->first_waitcomm_start_time_per_layer[index] = root_solver_->net()->wait_timer.Duration(); \ + } \ }while(0) -#define LAYER_WAIT_TIMING_STOP(layer_index) do { \ - root_solver_->waitcomm_time_per_layer[layer_index] += root_solver_->wait_timer.MicroSeconds(); \ +#define LAYER_WAIT_TIMING_STOP(index) do { \ + if (root_solver_->net()->phase() == TRAIN) { \ + root_solver_->net()->first_waitcomm_stop_time_per_layer[index] = root_solver_->net()->wait_timer.Duration(); \ + root_solver_->net()->waitcomm_time_per_layer[index] += (root_solver_->net()->first_waitcomm_stop_time_per_layer[index] - root_solver_->net()->first_waitcomm_start_time_per_layer[index]); \ + } \ }while(0) #define LAYER_REMOVE_UPDATE_TIME(layer_i, layer_k) do { \ - root_solver_->waitcomm_time_per_layer[layer_i] -= root_solver_->update_time_per_layer[layer_k]; \ + if (root_solver_->net()->phase() == TRAIN) { \ + root_solver_->net()->waitcomm_time_per_layer[layer_i] -= root_solver_->net()->update_time_per_layer[layer_k]; \ + } \ } while (0) #endif -#define ITER_TIMING_START() do { \ - root_solver_->timer.Start(); \ -}while(0) - -#define ITER_TIMING_STOP(name) do { \ - root_solver_->name##_time_per_iter += root_solver_->timer.MicroSeconds(); \ -}while(0) - #else -#define LAYER_TIMING_START() -#define LAYER_TIMING_STOP(name,index) +#define LAYER_TIMING_START(name, index) +#define LAYER_TIMING_STOP(name, index) +#define LAYER_TIMING_STOP_2(layer_time_name, name,index) #ifdef FW_OVERLAP_OPT -#define LAYER_WAIT_TIMING_START() -#define LAYER_WAIT_TIMING_STOP(layer_index) +#define LAYER_WAIT_TIMING_START(index) +#define LAYER_WAIT_TIMING_STOP(index) #define LAYER_REMOVE_UPDATE_TIME(layer_i, layer_k) #endif -#define ITER_TIMING_START() -#define ITER_TIMING_STOP(name) +#endif /* CAFFE_PER_LAYER_TIMINGS */ -#endif template -inline bool MultiSolver::IsSkipWaitGradient(int layer_id) { +inline bool MultiSolver::IsSkipSyncGradient(int layer_id) { Net& net = *root_solver_->net(); const std::vector>>& layers{ net.layers() }; const std::vector& layer_need_backward{ net.layer_need_backward() }; if (!layer_need_backward[layer_id] || ((layers[layer_id]->layerOp != nullptr) && !layers[layer_id]->layerOp->HasParameterSets())) { - DLOG(INFO) << "ForwardBackwardImpl: no need for apply_updates for layer # " - << layer_id << ", skip on_delwt_wait, apply_updates, on_wtinc_ready"; + DLOG(INFO) << "No need for synchronizing gradients for layer # " << layer_id; return true; } return false; @@ -111,33 +116,27 @@ inline bool MultiSolver::IsSkipWaitGradient(int layer_id) { template inline bool MultiSolver::WaitGradient(int layer_id) { -#ifndef FW_OVERLAP_OPT - LAYER_TIMING_START(); -#endif for (int j = 0; j < callbacks_.size(); ++j) { callbacks_[j]->on_delwt_wait(layer_id); } -#ifndef FW_OVERLAP_OPT - LAYER_TIMING_STOP(waitcomm, layer_id); - return true; -#else + +#ifdef FW_OVERLAP_OPT return layer_finished_flags_[layer_id]; +#else + return true; #endif } template inline void MultiSolver::UpdateGradient(int layer_id) { #ifdef FW_OVERLAP_OPT - if (layer_finished_flags_[layer_id]) { + CHECK(layer_finished_flags_[layer_id]); #endif - LAYER_TIMING_START(); + PERFORMANCE_MEASUREMENT_BEGIN(); for (int j = 0; j < callbacks_.size(); ++j) { callbacks_[j]->apply_updates(layer_id); } - LAYER_TIMING_STOP(update, layer_id); -#ifdef FW_OVERLAP_OPT - } -#endif + PERFORMANCE_MEASUREMENT_END_STATIC("weights_update"); } template @@ -150,30 +149,35 @@ Dtype MultiSolver::ForwardBackwardImpl(bool first, bool last) { for (int i = 0; i < layers.size(); ++i) { #ifdef FW_OVERLAP_OPT if (first) { - LAYER_WAIT_TIMING_START(); + LAYER_WAIT_TIMING_START(i); while (layer_finished_flags_[i] == false) { - if (IsSkipWaitGradient(i)) - break; - + if (IsSkipSyncGradient(i)) + break; if (WaitGradient(i)) { // The function call cannot be moved out of while loop. Otherwise, // at first iteration, additional UpdateGradient will be called, // even if no gradient is synced. + LAYER_TIMING_START(first_update, i); UpdateGradient(i); + LAYER_TIMING_STOP_2(update, first_update, i); + // The update time for layer i must be removed from waitcomm time // for layer i LAYER_REMOVE_UPDATE_TIME(i, i); break; } - + // wait and update gradient for next layers for (int k=i+1; k::ForwardBackwardImpl(bool first, bool last) { } } } - LAYER_WAIT_TIMING_STOP(i); // set flag to false after updating gradient layer_finished_flags_[i] = false; } #endif - LAYER_TIMING_START(); loss += net.ForwardFromTo(i, i); - LAYER_TIMING_STOP(forward, i); } - + // Clear parameter diffs after communication is finished (that is, after // calling WaitGradientComm) if (first) { - ITER_TIMING_START(); root_solver_->net()->ClearParamDiffs(); - ITER_TIMING_STOP(cleardiffs); } for (int i = layers.size() - 1; i >= 0; --i) { if (!layer_need_backward[i]) { continue; } - - LAYER_TIMING_START(); + net.BackwardFromTo(i, i); - LAYER_TIMING_STOP(backward, i); - if (last && (layers[i]->layerOp != nullptr) - && layers[i]->layerOp->HasParameterSets()) { - LAYER_TIMING_START(); + LAYER_TIMING_START(startcomm, i); + if (last && IsSkipSyncGradient(i) == false) { for (int j = 0; j < callbacks_.size(); ++j) { callbacks_[j]->on_backward_finished(i); } - LAYER_TIMING_STOP(startcomm, i); } + LAYER_TIMING_STOP(startcomm, i); } - #ifdef FW_OVERLAP_OPT int iter = root_solver_->iter(); int max_iter = root_solver_->param().max_iter(); @@ -233,11 +228,13 @@ Dtype MultiSolver::ForwardBackwardImpl(bool first, bool last) { if (last_iter_wait_flag) { for (int i = 0; i < layers.size(); ++i) { - if (IsSkipWaitGradient(i)) + LAYER_TIMING_START(waitcomm, i); + if (IsSkipSyncGradient(i)) { + LAYER_TIMING_STOP(waitcomm, i); continue; + } #ifdef FW_OVERLAP_OPT - LAYER_WAIT_TIMING_START(); while ( #endif WaitGradient(i) @@ -245,11 +242,11 @@ Dtype MultiSolver::ForwardBackwardImpl(bool first, bool last) { == false) #endif ; + LAYER_TIMING_STOP(waitcomm, i); -#ifdef FW_OVERLAP_OPT - LAYER_WAIT_TIMING_STOP(i); -#endif + LAYER_TIMING_START(update, i); UpdateGradient(i); + LAYER_TIMING_STOP(update, i); } } diff --git a/src/caffe/net.cpp b/src/caffe/net.cpp index 0afc6d31f..646b66b8d 100644 --- a/src/caffe/net.cpp +++ b/src/caffe/net.cpp @@ -64,10 +64,50 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "caffe/util/remove_batch_norm.hpp" #include "caffe/util/apply_bn_stats_batch_size.hpp" + PERFORMANCE_CREATE_MONITOR(); namespace caffe { +#ifdef CAFFE_PER_LAYER_TIMINGS + +#define LAYER_TIMING_START(name, index) do { \ + if (this->phase() == TRAIN) { \ + this->name##_start_time_per_layer[index] = this->timer.Duration(); \ + } \ +}while(0) + +#define LAYER_TIMING_STOP(name, index) do { \ + if (this->phase() == TRAIN) { \ + this->name##_stop_time_per_layer[index] = this->timer.Duration(); \ + this->name##_time_per_layer[index] += (this->name##_stop_time_per_layer[index] - this->name##_start_time_per_layer[index]); \ + } \ +}while(0) + + +#define ITER_TIMING_START() do { \ + if (this->phase() == TRAIN) { \ + this->timer.Start(); \ + } \ +}while(0) + +#define ITER_TIMING_STOP(name) do { \ + if (this->phase() == TRAIN) { \ + this->name##_time_per_iter += this->timer.MicroSeconds(); \ + } \ +}while(0) + +#else + +#define LAYER_TIMING_START(name,index) +#define LAYER_TIMING_STOP(name,index) + +#define ITER_TIMING_START() +#define ITER_TIMING_STOP(name) + +#endif /* CAFFE_PER_LAYER_TIMINGS */ + + template Net::Net(const NetParameter& param, const Net* root_net) : root_net_(root_net) { @@ -474,6 +514,10 @@ void Net::Init(const NetParameter& in_param) { } #endif /* USE_MLSL */ +#ifdef CAFFE_PER_LAYER_TIMINGS + InitTimers(); +#endif + LOG_IF(INFO, Caffe::root_solver()) << "Network initialization done."; } @@ -529,9 +573,20 @@ void Net::CompileNet(const NetParameter& param, param_temp2.clear_layer(); // Remove layers CompilationRuleTwo(param_temp, ¶m_temp2); +#ifdef DISABLE_CONV_SUM_FUSION param_compiled->CopyFrom(param_temp2); param_compiled->clear_layer(); // Remove layers CompilationRuleThree(param_temp2, param_compiled); +#else + NetParameter param_temp3; + param_temp3.CopyFrom(param_temp2); + param_temp3.clear_layer(); + CompilationRuleThree(param_temp2, ¶m_temp3); + + param_compiled->CopyFrom(param_temp3); + param_compiled->clear_layer(); + CompilationRuleFour(param_temp3, param_compiled); +#endif } template @@ -699,6 +754,7 @@ void Net::CompilationRuleTwo(const NetParameter& param, use_negative_slope = true; } else { layer_param->mutable_convolution_param()->set_relu(true); + layer_param->mutable_convolution_param()->set_negative_slope(0); } if(param.state().phase() == TRAIN && !use_negative_slope) { if(i+1 < param.layer_size()) { @@ -832,6 +888,71 @@ void Net::CompilationRuleThree(const NetParameter& param, return; } +template +void Net::CompilationRuleFour(const NetParameter& param, + NetParameter* param_compiled) { + // only apply this rule for inference(TEST) phase + if (param.state().phase() != TEST || param.engine().compare("MKLDNN") != 0) { + param_compiled->CopyFrom(param); + return; + } + string blob_need_to_insert; + LayerParameter* need_to_convert_layer = NULL; + for (int i = 0; i < param.layer_size(); i++) { + LayerParameter* layer_param = + (const_cast(param)).mutable_layer(i); + if (layer_param->type().compare("Convolution") == 0 + && (layer_param->has_engine() == false + || (layer_param->has_engine() == true + && layer_param->engine().compare("MKLDNN") ==0))) { + std::vector child_layers_params; + Net::GetBlobConsumers(child_layers_params, layer_param->top(0), + param, + i + 1 < param.layer_size() ? i + 1 : i); + + if (child_layers_params[0]->type().compare("Eltwise") == 0) { + std::vector grand_child_layers_params; + + Net::GetBlobConsumers(grand_child_layers_params, + child_layers_params[0]->top(0), param, + i + 1 < param.layer_size() ? i + 1 : i); + const LayerParameter& grand_child_layer_param = + grand_child_layers_params.size() > 0 + ? *(grand_child_layers_params[0]) + : *layer_param; + + if (grand_child_layer_param.type().compare("ReLU") != 0) { + param_compiled->add_layer()->CopyFrom(*layer_param); + continue; + } + + if (child_layers_params[0]->bottom(0) == layer_param->top(0) ) { + param_compiled->add_layer()->CopyFrom(*layer_param); + need_to_convert_layer = layer_param; + continue; + } + + const_cast(layer_param->top(0)) = + grand_child_layer_param.top(0); + if (need_to_convert_layer != NULL) { + layer_param->add_bottom( + const_cast(need_to_convert_layer->top(0))); + need_to_convert_layer = NULL; + } else { + layer_param->add_bottom( + const_cast(child_layers_params[0]->bottom(0))); + } + + i += 2; // skip next eltwise and relu + } + } + + param_compiled->add_layer()->CopyFrom(*layer_param); + } + + return; +} + template void Net::GetBlobConsumers( std::vector& consumer_blobs, @@ -988,6 +1109,106 @@ bool Net::StateMeetsRule(const NetState& state, return true; } +template +vector Net::FindMax(Blob* blob, bool is_single) { + const Dtype* data = blob->cpu_data(); + int cnt = blob->count(); + vector max_vals; + Dtype max_val = (Dtype)(-10); + + int index = 0; + if(blob->shape().size() == 4) { + if(is_single) { + max_vals = vector(1, Dtype(-10)); + for (int i = 0; i < cnt; ++i) { + max_val = std::max(max_val, (Dtype)fabs(data[i])); + } + max_vals.at(0) = max_val; + } else { // output_channel * input_channel * kernel_height * kernel_width + int height = blob->shape(2); + int width = blob->shape(3); + int channel = blob->shape(0); + max_vals = vector(channel, Dtype(-10)); + int step = blob->shape(1) * height * width; + for (int i = 0; i < cnt; ++i) { + if((i + 1) % step == 0) { + max_vals.at(index) = std::max(max_val, (Dtype)fabs(data[i])); + ++index; + } else { + max_val = std::max(max_val, (Dtype)fabs(data[i])); + } + } + } + } else { + if(is_single) { + max_vals = vector(1, Dtype(-10)); + for (int i = 0; i < cnt; ++i) { + max_val = std::max(max_val, (Dtype)fabs(data[i])); + } + max_vals.at(0) = max_val; + } else { // output_channel * input_channel + int channel = blob->shape(0); + max_vals = vector(channel, Dtype(-10)); + int step = blob->shape(1); + for (int i = 0; i < cnt; ++i) { + if((i + 1) % step == 0) { + max_vals.at(index) = std::max(max_val, (Dtype)fabs(data[i])); + ++index; + } else { + max_val = std::max(max_val, (Dtype)fabs(data[i])); + } + } + } + } + + return max_vals; +} + +template +void Net::RangeInLayers(vector* layer_name, + vector* max_in, vector* max_out, vector>* max_param, string scaling) { + // Initialize vector elements, if needed. + if(layer_name->size()==0) { + for (int layer_id = 0; layer_id < layers_.size(); ++layer_id) { + if (strcmp(layers_[layer_id]->type(), "Convolution") == 0) { + layer_name->push_back(this->layer_names()[layer_id]); + max_in->push_back(0); + max_out->push_back(0); + if (scaling == "single") { + max_param->push_back(vector(1, 0)); + } + else { + int param_shape = (&(*layers_[layer_id]->blobs()[0]))->shape(0); + max_param->push_back(vector(param_shape, 0)); + } + } + } + } + // Find maximal values. + int index = 0; + vector max_vals; + for (int layer_id = 0; layer_id < layers_.size(); ++layer_id) { + if (strcmp(layers_[layer_id]->type(), "Convolution") == 0) { + max_vals = FindMax(bottom_vecs_[layer_id][0]); + max_in->at(index) = std::max(max_in->at(index), max_vals.at(0)); + + max_vals = FindMax(top_vecs_[layer_id][0]); + max_out->at(index) = std::max(max_out->at(index), max_vals.at(0)); + + // Consider the weights only, ignore the bias + if (scaling == "single") { + max_vals = FindMax(&(*layers_[layer_id]->blobs()[0])); + max_param->at(index).at(0) = std::max(max_param->at(index).at(0), max_vals.at(0)); + } else { + max_vals = FindMax(&(*layers_[layer_id]->blobs()[0]), false); + for(int i = 0; i < max_vals.size(); ++i) + max_param->at(index).at(i) = std::max(max_param->at(index).at(i), max_vals.at(i)); + } + index++; + } + } +} + // Helper for Net::Init: add a new top blob to the net. template void Net::AppendTop(const NetParameter& param, const int layer_id, @@ -1157,12 +1378,13 @@ Dtype Net::ForwardFromTo(int start, int end) { CHECK_LT(end, layers_.size()); Dtype loss = 0; for (int i = start; i <= end; ++i) { + LAYER_TIMING_START(forward, i); PERFORMANCE_MEASUREMENT_BEGIN(); - // LOG(ERROR) << "Forwarding " << layer_names_[i]; Dtype layer_loss = layers_[i]->Forward(bottom_vecs_[i], top_vecs_[i]); PERFORMANCE_MEASUREMENT_END((std::string("FW_") + layer_names_[i]).c_str()); + LAYER_TIMING_STOP(forward, i); loss += layer_loss; if (debug_info_) { ForwardDebugInfo(i); } @@ -1208,13 +1430,15 @@ void Net::BackwardFromTo(int start, int end) { CHECK_LT(start, layers_.size()); for (int i = start; i >= end; --i) { if (layer_need_backward_[i]) { + + LAYER_TIMING_START(backward, i); PERFORMANCE_MEASUREMENT_BEGIN(); layers_[i]->Backward( top_vecs_[i], bottom_need_backward_[i], bottom_vecs_[i]); PERFORMANCE_MEASUREMENT_END((std::string("BW_")+layer_names_[i]).c_str()); - + LAYER_TIMING_STOP(backward, i); if (debug_info_) { BackwardDebugInfo(i); } } } @@ -1721,9 +1945,11 @@ void Net::ClearParamDiffs(int learnable_param_id) { template void Net::ClearParamDiffs() { + ITER_TIMING_START(); for (int i = 0; i < learnable_params_.size(); ++i) { ClearParamDiffs(i); } + ITER_TIMING_STOP(cleardiffs); } template @@ -1784,6 +2010,351 @@ const shared_ptr > Net::layer_by_name( return layer_ptr; } +#ifdef CAFFE_PER_LAYER_TIMINGS + +template +void Net::InitTimers() { + int layer_count = layers().size(); + + this->forward_time_per_layer.resize(layer_count, 0.0); + this->backward_time_per_layer.resize(layer_count, 0.0); + this->update_time_per_layer.resize(layer_count, 0.0); + this->cleardiffs_time_per_iter = 0.0; + + this->forward_time_per_layer_total.resize(layer_count, 0.0); + this->backward_time_per_layer_total.resize(layer_count, 0.0); + this->update_time_per_layer_total.resize(layer_count, 0.0); + this->cleardiffs_time_per_iter_total = 0.0; + + this->forward_start_time_per_layer.resize(layer_count, 0.0); + this->forward_stop_time_per_layer.resize(layer_count, 0.0); + this->backward_start_time_per_layer.resize(layer_count, 0.0); + this->backward_stop_time_per_layer.resize(layer_count, 0.0); + this->update_start_time_per_layer.resize(layer_count, 0.0); + this->update_stop_time_per_layer.resize(layer_count, 0.0); + +#ifdef USE_MLSL + this->startcomm_time_per_layer.resize(layer_count, 0.0); + this->waitcomm_time_per_layer.resize(layer_count, 0.0); + + this->startcomm_time_per_layer_total.resize(layer_count, 0.0); + this->waitcomm_time_per_layer_total.resize(layer_count, 0.0); + + this->startcomm_start_time_per_layer.resize(layer_count, 0.0); + this->startcomm_stop_time_per_layer.resize(layer_count, 0.0); + +#ifdef FW_OVERLAP_OPT + this->first_update_start_time_per_layer.resize(layer_count, 0.0); + this->first_update_stop_time_per_layer.resize(layer_count, 0.0); + this->first_waitcomm_start_time_per_layer.resize(layer_count, 0.0); + this->first_waitcomm_stop_time_per_layer.resize(layer_count, 0.0); +#endif + + this->waitcomm_start_time_per_layer.resize(layer_count, 0.0); + this->waitcomm_stop_time_per_layer.resize(layer_count, 0.0); +#endif + + timer.InitTime(); +#ifdef FW_OVERLAP_OPT + wait_timer.InitTime(timer); +#endif +} + +template +void Net::ResetTimers() { + std::transform(this->forward_time_per_layer_total.begin(), + this->forward_time_per_layer_total.end(), + this->forward_time_per_layer.begin(), + this->forward_time_per_layer_total.begin(), + std::plus()); + + std::transform(this->backward_time_per_layer_total.begin(), + this->backward_time_per_layer_total.end(), + this->backward_time_per_layer.begin(), + this->backward_time_per_layer_total.begin(), + std::plus()); + + std::transform(this->update_time_per_layer_total.begin(), + this->update_time_per_layer_total.end(), + this->update_time_per_layer.begin(), + this->update_time_per_layer_total.begin(), + std::plus()); + this->cleardiffs_time_per_iter_total += this->cleardiffs_time_per_iter; +#ifdef USE_MLSL + std::transform(this->startcomm_time_per_layer_total.begin(), + this->startcomm_time_per_layer_total.end(), + this->startcomm_time_per_layer.begin(), + this->startcomm_time_per_layer_total.begin(), + std::plus()); + + std::transform(this->waitcomm_time_per_layer_total.begin(), + this->waitcomm_time_per_layer_total.end(), + this->waitcomm_time_per_layer.begin(), + this->waitcomm_time_per_layer_total.begin(), + std::plus()); +#endif + + std::fill(this->forward_time_per_layer.begin(), + this->forward_time_per_layer.end(), 0.0); + std::fill(this->backward_time_per_layer.begin(), + this->backward_time_per_layer.end(), 0.0); + std::fill(this->update_time_per_layer.begin(), + this->update_time_per_layer.end(), 0.0); + this->cleardiffs_time_per_iter = 0.0; +#ifdef USE_MLSL + std::fill(this->startcomm_time_per_layer.begin(), + this->startcomm_time_per_layer.end(), 0.0); + std::fill(this->waitcomm_time_per_layer.begin(), + this->waitcomm_time_per_layer.end(), 0.0); +#endif +} + +template +void Net::PrintTimers(bool printTotal) { +#ifdef USE_MLSL + if (mn::get_node_id() != 0) + return; +#endif + + LOG(WARNING) << std::endl; + LOG(WARNING) << "####################################################"; + + std::vector& forward_timers = printTotal ? + forward_time_per_layer_total : forward_time_per_layer; + std::vector& backward_timers = printTotal ? + backward_time_per_layer_total : backward_time_per_layer; + std::vector& update_timers = printTotal ? + update_time_per_layer_total : update_time_per_layer; + double cleardiffs_timer = printTotal ? + cleardiffs_time_per_iter_total : cleardiffs_time_per_iter; +#ifdef USE_MLSL + std::vector& startcomm_timers = printTotal ? + startcomm_time_per_layer_total : startcomm_time_per_layer; + std::vector& waitcomm_timers = printTotal ? + waitcomm_time_per_layer_total : waitcomm_time_per_layer; +#endif + std::string prefix = printTotal ? "TOTAL " : "DELTA "; + + double forward_time = std::accumulate(forward_timers.begin(), + forward_timers.end(), 0.0) / 1000.0; + LOG(WARNING) << prefix << "FORWARD TIME: " << forward_time << " ms"; + for (int layer_idx = 0; layer_idx < layers().size(); layer_idx++) { + LOG(WARNING) << "LAYER-" << layer_idx << " " + << layers()[layer_idx]->type() + << ": forward_time: " << forward_timers[layer_idx] / 1000.0 + << " ms"; + } + LOG(WARNING) << std::endl; + + double backward_time = std::accumulate(backward_timers.begin(), + backward_timers.end(), 0.0) / 1000.0; + LOG(WARNING) << prefix << "BACKWARD TIME: " << backward_time << " ms"; + for (int layer_idx = 0; layer_idx < layers().size(); layer_idx++) { + LOG(WARNING) << "LAYER-" << layer_idx << " " + << layers()[layer_idx]->type() + << ": backward_time: " << backward_timers[layer_idx] / 1000.0 + << " ms"; + } + LOG(WARNING) << std::endl; + + double update_time = std::accumulate(update_timers.begin(), + update_timers.end(), 0.0) / 1000.0; + LOG(WARNING) << prefix << "UPDATE TIME: " << update_time << " ms"; + for (int layer_idx = 0; layer_idx < layers().size(); layer_idx++) { + LOG(WARNING) << "LAYER-" << layer_idx << " " + << layers()[layer_idx]->type() + << ": update_time: " << update_timers[layer_idx] / 1000.0 + << " ms"; + } + LOG(WARNING) << std::endl; + + double cleardiffs_time = cleardiffs_timer / 1000.0; + LOG(WARNING) << prefix << "CLEAR PARAMETER DIFFS TIME: " << cleardiffs_time << " ms"; + LOG(WARNING) << std::endl; + +#ifdef USE_MLSL + double startcomm_time = std::accumulate(startcomm_timers.begin(), + startcomm_timers.end(), 0.0) / 1000.0; + LOG(WARNING) << prefix << "START COMMUNICATION TIME: " << startcomm_time << " ms"; + for (int layer_idx = 0; layer_idx < layers().size(); layer_idx++) { + LOG(WARNING) << "LAYER-" << layer_idx << " " + << layers()[layer_idx]->type() + << ": startcomm_time: " << startcomm_timers[layer_idx] / 1000.0 + << " ms"; + } + LOG(WARNING) << std::endl; + + double waitcomm_time = std::accumulate(waitcomm_timers.begin(), + waitcomm_timers.end(), 0.0) / 1000.0; + LOG(WARNING) << prefix << "WAIT COMMUNICATION TIME: " << waitcomm_time << " ms"; + for (int layer_idx = 0; layer_idx < layers().size(); layer_idx++) { + LOG(WARNING) << "LAYER-" << layer_idx << " " + << layers()[layer_idx]->type() + << ": waitcomm_time: " << waitcomm_timers[layer_idx] / 1000.0 + << " ms"; + } + LOG(WARNING) << std::endl; + + LOG(WARNING) << prefix << "TIME (Computation + Communication): " << (forward_time + + backward_time + update_time + cleardiffs_time + startcomm_time + waitcomm_time) / 1000.0 + << " sec"; +#else + LOG(WARNING) << prefix << "TIME (Computation): " << (forward_time + + backward_time + update_time + cleardiffs_time) / 1000.0 << " sec"; +#endif + + LOG(WARNING) << "####################################################"; + LOG(WARNING) << std::endl; +} + +template +void Net::SaveTimeline() { + static bool initialized = false; + std::ofstream time_file; + string filename = name() + "_timeline" +#ifdef USE_MLSL + + "_" + std::to_string(mn::get_node_id()) +#endif + + ".txt"; + if (initialized) + time_file.open(filename, std::ios_base::app); + else { + initialized = true; + time_file.open(filename); + } + + time_file << "start,end,type,OP" << std::endl; + + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (forward_start_time_per_layer[layer_idx] == 0 + || forward_stop_time_per_layer[layer_idx] == 0) + continue; + time_file << forward_start_time_per_layer[layer_idx] / 1000 + << "," << forward_stop_time_per_layer[layer_idx] / 1000 + << ",Comp," << layers()[layer_idx]->type() + << std::endl; + } + + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (backward_start_time_per_layer[layer_idx] == 0 + || backward_stop_time_per_layer[layer_idx] == 0) + continue; + time_file << backward_start_time_per_layer[layer_idx] / 1000 + << "," << backward_stop_time_per_layer[layer_idx] / 1000 + << ",Comp," << layers()[layer_idx]->type() << "Grad" + << std::endl; + } + +#if defined(USE_MLSL) && defined(FW_OVERLAP_OPT) + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (first_update_start_time_per_layer[layer_idx] == 0 + || first_update_stop_time_per_layer[layer_idx] == 0) + continue; + + time_file << first_update_start_time_per_layer[layer_idx] / 1000 + << "," << first_update_stop_time_per_layer[layer_idx] / 1000 + << ",Comp," << layers()[layer_idx]->type() << "FirstUpdate" + << std::endl; + } +#endif + + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (update_start_time_per_layer[layer_idx] == 0 + || update_stop_time_per_layer[layer_idx] == 0) + continue; + + time_file << update_start_time_per_layer[layer_idx] / 1000 + << "," << update_stop_time_per_layer[layer_idx] / 1000 + << ",Comp," << layers()[layer_idx]->type() << "Update" + << std::endl; + } + +#ifdef USE_MLSL + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (startcomm_start_time_per_layer[layer_idx] == 0 + || startcomm_stop_time_per_layer[layer_idx] == 0) + continue; + + time_file << startcomm_start_time_per_layer[layer_idx] / 1000 + << "," << startcomm_stop_time_per_layer[layer_idx] / 1000 + << ",Comm," << layers()[layer_idx]->type() << "Start" + << std::endl; + } + +#ifdef FW_OVERLAP_OPT + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (first_waitcomm_start_time_per_layer[layer_idx] == 0 + || first_waitcomm_stop_time_per_layer[layer_idx] == 0) + continue; + + time_file << first_waitcomm_start_time_per_layer[layer_idx] / 1000 + << "," << first_waitcomm_stop_time_per_layer[layer_idx] / 1000 + << ",Comm," << layers()[layer_idx]->type() << "FirstWait" + << std::endl; + } +#endif + + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + if (waitcomm_start_time_per_layer[layer_idx] == 0 + || waitcomm_stop_time_per_layer[layer_idx] == 0) + continue; + + time_file << waitcomm_start_time_per_layer[layer_idx] / 1000 + << "," << waitcomm_stop_time_per_layer[layer_idx] / 1000 + << ",Comm," << layers()[layer_idx]->type() << "Wait" + << std::endl; + } +#endif + + time_file.close(); +} + +template +void Net::PrintPayloadSize() { +#ifdef USE_MLSL + if (mn::get_node_id() != 0) + return; +#endif + + int total_payload_size = 0; + const vector *> &net_params (learnable_params()); + + LOG(WARNING) << std::endl; + LOG(WARNING) << "####################################################"; + + + for (int layer_idx = 0; layer_idx < layers().size(); ++layer_idx) { + std::vector param_ids = get_layer_learnable_param_ids(layer_idx); + for (int j = 0; j < param_ids.size(); j++) { + int layer_payload_size = net_params[param_ids[j]]->count(); + + LOG(WARNING) << "LAYER-" << layer_idx << " " + << layers()[layer_idx]->type() + << ": payload_size: " << layer_payload_size + << " units"; + + total_payload_size += layer_payload_size; + } + } + + LOG(WARNING) << "TOTAL PAYLOAD SIZE: " << total_payload_size << " units"; + LOG(WARNING) << "####################################################"; + LOG(WARNING) << std::endl; +} + +#endif /* CAFFE_PER_LAYER_TIMINGS */ + + INSTANTIATE_CLASS(Net); } // namespace caffe + +#if defined(FOUNDED_MLSL_ROOT) +#define DEF_MLSL(str) \ +const char *mlsl_root = #str; + +__attribute__((constructor)) void lib_ctor() { + DEF_MLSL(FOUNDED_MLSL_ROOT); + setenv("MLSL_ROOT", mlsl_root, 0); +} +#endif diff --git a/src/caffe/proto/caffe.proto b/src/caffe/proto/caffe.proto index 4a94c3c46..cfbfdb55c 100755 --- a/src/caffe/proto/caffe.proto +++ b/src/caffe/proto/caffe.proto @@ -162,6 +162,7 @@ message FillerParameter { optional float max = 4 [default = 1]; // the max value in uniform filler optional float mean = 5 [default = 0]; // the mean value in Gaussian filler optional float std = 6 [default = 1]; // the std value in Gaussian filler + optional float scale = 9 [default = 1]; // the scale value in MSRA filler // The expected number of non-zero output weights for a given input in // Gaussian filler -- the default -1 means don't perform sparsification. optional int32 sparse = 7 [default = -1]; @@ -608,6 +609,7 @@ message LayerParameter { optional MultinodeLayerParameter multinode = 150; optional MnActivationParameter mn_activation_param = 151; optional MnParamGradCompressParameter mn_grad_compress_param = 156; + optional QuantizationParameter quantization_param = 158; } message MultinodeLayerParameter { @@ -629,7 +631,27 @@ message MnActivationParameter { optional bool need_reduce = 5 [default = true]; } - +// Message for layers with reduced word with arithmetic +message QuantizationParameter{ + enum Precision { + DYNAMIC_FIXED_POINT = 0; + } + optional Precision precision = 1 [default = DYNAMIC_FIXED_POINT]; + enum Rounding { + NEAREST = 0; + } + optional Rounding rounding_scheme = 2 [default = NEAREST]; + // Dynamic fixed point word width + optional uint32 bw_layer_in = 3 [default = 32]; + optional uint32 bw_layer_out = 4 [default = 32]; + optional uint32 bw_params = 5 [default = 32]; + repeated int32 fl_layer_in = 6; + repeated int32 fl_layer_out = 7; + repeated int32 fl_params = 8; + repeated float scale_in = 20; + repeated float scale_out = 21; + repeated float scale_params = 22; +} message MnParamGradCompressParameter { repeated bool param_grad_compress_enable = 1; diff --git a/src/caffe/quant/layers/base_quant_layer.cpp b/src/caffe/quant/layers/base_quant_layer.cpp new file mode 100644 index 000000000..ea48d2296 --- /dev/null +++ b/src/caffe/quant/layers/base_quant_layer.cpp @@ -0,0 +1,56 @@ +/* +All modification made by Intel Corporation: © 2018 Intel Corporation + +All contributions by the University of California: +Copyright (c) 2014, 2015, The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: +Copyright (c) 2014, 2015, the respective contributors +All rights reserved. +For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md + +A part of the code referenced BVLC CAFFE ristretto branch +For the original code go to https://github.com/pmgysel/caffe + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include + +#include "caffe/mkldnn_memory.hpp" +#include "caffe/quant/base_quant_layer.hpp" + +namespace caffe { + +template +BaseQuantLayer::BaseQuantLayer() : need_quantize_(false), is_float_(false) { +} + +INSTANTIATE_CLASS(BaseQuantLayer); + +} // namespace caffe diff --git a/src/caffe/quant/quantization.cpp b/src/caffe/quant/quantization.cpp new file mode 100644 index 000000000..2344d5e40 --- /dev/null +++ b/src/caffe/quant/quantization.cpp @@ -0,0 +1,331 @@ +/* +All modification made by Intel Corporation: © 2018 Intel Corporation + +All contributions by the University of California: +Copyright (c) 2014, 2015, The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: +Copyright (c) 2014, 2015, the respective contributors +All rights reserved. +For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md + +A part of the code referenced BVLC CAFFE ristretto branch +For the original code go to https://github.com/pmgysel/caffe + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "boost/algorithm/string.hpp" + +#include "caffe/caffe.hpp" +#include "caffe/net.hpp" +#include "caffe/quant/quantization.hpp" + +using caffe::Caffe; +using caffe::Net; +using caffe::string; +using caffe::vector; +using caffe::Blob; +using caffe::LayerParameter; +using caffe::NetParameter; + +Quantization::Quantization(string model, string weights, string model_quantized, + int iterations, string trimming_mode, double error_margin, int score_number, string scaling, int detection, int power) { + this->model_ = model; + this->weights_ = weights; + this->model_quantized_ = model_quantized; + this->iterations_ = iterations; + this->trimming_mode_ = trimming_mode; + this->error_margin_ = error_margin; + this->score_number = score_number; + this->scaling = scaling; + this->detection = detection; + this->power = power; +} + +void Quantization::QuantizeNet() { + CheckWritePermissions(model_quantized_); + + float accuracy; + Net* net_test = new Net(model_, caffe::TEST); + net_test->CopyTrainedLayersFrom(weights_); + RunForwardBatches(this->iterations_, net_test, &accuracy, true, this->score_number); // RangeInLayer during sampling + delete net_test; + + // Do network quantization and scoring. + if (trimming_mode_ == "dynamic_fixed_point") { + Quantize2DynamicFixedPoint(); + } else { + LOG(FATAL) << "Unknown trimming mode: " << trimming_mode_; + } +} + +void Quantization::CheckWritePermissions(const string path) { + std::ofstream probe_ofs(path.c_str()); + if (probe_ofs.good()) { + probe_ofs.close(); + std::remove(path.c_str()); + } else { + LOG(FATAL) << "Missing write permissions"; + } +} + +void Quantization::RunForwardBatches(const int iterations, + Net* caffe_net, float* accuracy, const bool do_stats, + const int score_number) { + LOG(INFO) << "Running for " << iterations << " iterations."; + vector* > bottom_vec; + vector test_score_output_id; + vector test_score; + float loss = 0; + for (int i = 0; i < iterations; ++i) { + float iter_loss; + // Do forward propagation. + const vector*>& result = + caffe_net->Forward(bottom_vec, &iter_loss); + // Find maximal values in network. + if(do_stats) { + caffe_net->RangeInLayers(&layer_names_, &max_in_, &max_out_, &max_params_, this->scaling); + } + // Keep track of network score over multiple batches. + loss += iter_loss; + if (this->detection) continue; + + int idx = 0; + for (int j = 0; j < result.size(); ++j) { + const float* result_vec = result[j]->cpu_data(); + for (int k = 0; k < result[j]->count(); ++k, ++idx) { + const float score = result_vec[k]; + if (i == 0) { + test_score.push_back(score); + test_score_output_id.push_back(j); + } else { + test_score[idx] += score; + } + } + } + LOG(INFO) << "Iteration: " << i; + } + loss /= iterations; + LOG(INFO) << "Loss: " << loss; + if (this->detection) return; + + for (int i = 0; i < test_score.size(); ++i) { + const float loss_weight = caffe_net->blob_loss_weights()[ + caffe_net->output_blob_indices()[test_score_output_id[i]]]; + std::ostringstream loss_msg_stream; + const float mean_score = test_score[i] / iterations; + if (loss_weight) { + loss_msg_stream << " (* " << loss_weight + << " = " << loss_weight * mean_score << " loss)"; + } + } + *accuracy = test_score[score_number] / iterations; +} + +void Quantization::Quantize2DynamicFixedPoint() { + // Find the integer length for dynamic fixed point numbers. + // The integer length is chosen such that no saturation occurs. + // This approximation assumes an infinitely long factional part. + // For layer activations, we reduce the integer length by one bit. + vector lens; + vector scales; + for (int i = 0; i < layer_names_.size(); ++i) { + if (this->power) { + il_in_.push_back((int)ceil(log2(max_in_[i]))); + il_out_.push_back((int)ceil(log2(max_out_[i]))); + } else { + scale_in_.push_back(max_in_[i]); + scale_out_.push_back(max_out_[i]); + } + if (this->scaling == "single") { + if (this->power) + lens.push_back((int)ceil(log2(max_params_[i][0])+1)); + else + scales.push_back(max_params_[i][0]); + } else { + for (int j = 0; j < max_params_[i].size(); j++) { + if (this->power) + lens.push_back((int)ceil(log2(max_params_[i][j])+1)); + else + scales.push_back(max_params_[i][j]+0.0); + } + } + if (this->power) { + il_params_.push_back(lens); + lens.clear(); + } else { + scale_params_.push_back(scales); + scales.clear(); + } + } + // Debug + for (int k = 0; k < layer_names_.size(); ++k) { + if (this->scaling != "single") { + if (this->power) + LOG(INFO) << "Layer " << layer_names_[k] << ", parameters channel=" << il_params_[k].size(); + else + LOG(INFO) << "Layer " << layer_names_[k] << ", parameters channel=" << scale_params_[k].size(); + } + + if (this->power) { + LOG(INFO) << "Integer length input=" << il_in_[k]; + LOG(INFO) << "Integer length output=" << il_out_[k]; + } else { + LOG(INFO) << "Scale input=" << scale_in_[k]; + LOG(INFO) << "Scale output=" << scale_out_[k]; + } + + if (this->scaling == "single") { + if (this->power) + LOG(INFO) << "Integer length param=" << il_params_[k][0]; + else + LOG(INFO) << "Scale param=" << scale_params_[k][0]; + } else { + for (int j = 0; j < il_params_[k].size(); j++) { + if (this->power) + LOG(INFO) << "Integer length params[" << j << "]=" << il_params_[k][j]; + else + LOG(INFO) << "Scale params[" << j << "]=" << scale_params_[k][j]; + } + } + } + + // Choose bit-width for different network parts + bw_conv_params_ = 8; + bw_out_ = 8; + bw_in_ = bw_out_; + + NetParameter param; + // Score dynamic fixed point network. + // This network combines dynamic fixed point parameters in convolutional and + // inner product layers, as well as dynamic fixed point activations. + caffe::ReadNetParamsFromTextFileOrDie(model_, ¶m); + EditNetDescriptionDynamicFixedPoint(¶m, "Convolution", + "Parameters_and_Activations", bw_conv_params_, bw_in_, + bw_out_); + WriteProtoToTextFile(param, model_quantized_); +} + +void Quantization::EditNetDescriptionDynamicFixedPoint(NetParameter* param, + const string layer_quantize, const string net_part, const int bw_conv, + const int bw_in, const int bw_out) { + int index = 0; + bool first_convolution = false; + for (int i = 0; i < param->layer_size(); ++i) { + // TODO: move first convolution check to transform script + if (layer_quantize.find("Convolution") != string::npos && + param->layer(i).type().find("Convolution") != string::npos) { + if (!first_convolution) { + first_convolution = true; + continue; + } + + // quantize parameters + if (net_part.find("Parameters") != string::npos) { + LayerParameter* param_layer = param->mutable_layer(i); + param_layer->set_type("Convolution"); + if (trimming_mode_ == "dynamic_fixed_point") { + param_layer->mutable_quantization_param()->set_bw_params(bw_conv); + if (this->power) { + vector vals = GetIntegerLengthParams(param->layer(i).name()); + for (int j = 0; j < vals.size(); j++) { + vals[j] = bw_conv - vals[j]; + param_layer->mutable_quantization_param()->add_fl_params(vals[j]); + } + } else { + vector vals = GetScaleParams(param->layer(i).name()); + for (int j = 0; j < vals.size(); j++) { + param_layer->mutable_quantization_param()->add_scale_params(vals[j]); + } + } + } + } + // quantize activations + if (net_part.find("Activations") != string::npos) { + LayerParameter* param_layer = param->mutable_layer(i); + param_layer->set_type("Convolution"); + if (trimming_mode_ == "dynamic_fixed_point") { + param_layer->mutable_quantization_param()->set_bw_layer_in(bw_in); + param_layer->mutable_quantization_param()->set_bw_layer_out(bw_out); + if (this->power) { + int val = GetIntegerLengthIn(param->layer(i).name()); + param_layer->mutable_quantization_param()->add_fl_layer_in(bw_in - val); + val = GetIntegerLengthOut(param->layer(i).name()); + param_layer->mutable_quantization_param()->add_fl_layer_out(bw_out - val); + } else { + float val = GetScaleIn(param->layer(i).name()); + param_layer->mutable_quantization_param()->add_scale_in(val); + val = GetScaleOut(param->layer(i).name()); + param_layer->mutable_quantization_param()->add_scale_out(val); + } + } + } + LayerParameter* param_layer = param->mutable_layer(i); + if (trimming_mode_ == "dynamic_fixed_point") { + param_layer->mutable_quantization_param()->set_precision(caffe::QuantizationParameter_Precision(0)); + } else { + LOG(FATAL) << "Unknown trimming mode: " << trimming_mode_; + } + index++; + } + } +} + +vector Quantization::GetIntegerLengthParams(const string layer_name) { + int pos = find(layer_names_.begin(), layer_names_.end(), layer_name) + - layer_names_.begin(); + return il_params_[pos]; +} + +int Quantization::GetIntegerLengthIn(const string layer_name) { + int pos = find(layer_names_.begin(), layer_names_.end(), layer_name) + - layer_names_.begin(); + return il_in_[pos]; +} + +int Quantization::GetIntegerLengthOut(const string layer_name) { + int pos = find(layer_names_.begin(), layer_names_.end(), layer_name) + - layer_names_.begin(); + return il_out_[pos]; +} + +vector Quantization::GetScaleParams(const string layer_name) { + int pos = find(layer_names_.begin(), layer_names_.end(), layer_name) + - layer_names_.begin(); + return scale_params_[pos]; +} + +float Quantization::GetScaleIn(const string layer_name) { + int pos = find(layer_names_.begin(), layer_names_.end(), layer_name) + - layer_names_.begin(); + return scale_in_[pos]; +} + +float Quantization::GetScaleOut(const string layer_name) { + int pos = find(layer_names_.begin(), layer_names_.end(), layer_name) + - layer_names_.begin(); + return scale_out_[pos]; +} diff --git a/src/caffe/solver.cpp b/src/caffe/solver.cpp index 781aca9d7..2b47b0b2e 100644 --- a/src/caffe/solver.cpp +++ b/src/caffe/solver.cpp @@ -123,9 +123,6 @@ void Solver::Init(const SolverParameter& param) { iter_ = 0; current_step_ = 0; -#ifdef CAFFE_PER_LAYER_TIMINGS - InitTimers(); -#endif } template @@ -340,11 +337,6 @@ void Solver::Step(int iters) { } } -#ifdef CAFFE_PER_LAYER_TIMINGS - PrintTimers(false); - ResetTimers(); -#endif - iter_timer.Start(); for (int i = 0; i < callbacks_.size(); ++i) { @@ -361,7 +353,13 @@ void Solver::Step(int iters) { iter_time += iter_timer.MilliSeconds(); #ifdef CAFFE_PER_LAYER_TIMINGS + net_->SaveTimeline(); + net_->PrintTimers(false); + net_->ResetTimers(); + +#ifdef USE_MLSL if (mn::get_node_id() == 0) +#endif LOG(INFO) << "iter " << iter_ << ", forward_backward_update_time: " << iter_time << " ms"; #endif @@ -387,184 +385,12 @@ void Solver::Step(int iters) { } #ifdef CAFFE_PER_LAYER_TIMINGS - ResetTimers(); - PrintTimers(true); -#endif -} - -#ifdef CAFFE_PER_LAYER_TIMINGS - -template -void Solver::InitTimers() { - int layer_count = net_->layers().size(); - - this->forward_time_per_layer.resize(layer_count, 0.0); - this->backward_time_per_layer.resize(layer_count, 0.0); - this->update_time_per_layer.resize(layer_count, 0.0); - this->cleardiffs_time_per_iter = 0.0; -#ifdef USE_MLSL - this->startcomm_time_per_layer.resize(layer_count, 0.0); - this->waitcomm_time_per_layer.resize(layer_count, 0.0); -#endif - this->forward_time_per_layer_total.resize(layer_count, 0.0); - this->backward_time_per_layer_total.resize(layer_count, 0.0); - this->update_time_per_layer_total.resize(layer_count, 0.0); - this->cleardiffs_time_per_iter_total = 0.0; -#ifdef USE_MLSL - this->startcomm_time_per_layer_total.resize(layer_count, 0.0); - this->waitcomm_time_per_layer_total.resize(layer_count, 0.0); -#endif -} - -template -void Solver::ResetTimers() { - std::transform(this->forward_time_per_layer_total.begin(), - this->forward_time_per_layer_total.end(), - this->forward_time_per_layer.begin(), - this->forward_time_per_layer_total.begin(), - std::plus()); - - std::transform(this->backward_time_per_layer_total.begin(), - this->backward_time_per_layer_total.end(), - this->backward_time_per_layer.begin(), - this->backward_time_per_layer_total.begin(), - std::plus()); - - std::transform(this->update_time_per_layer_total.begin(), - this->update_time_per_layer_total.end(), - this->update_time_per_layer.begin(), - this->update_time_per_layer_total.begin(), - std::plus()); - this->cleardiffs_time_per_iter_total += this->cleardiffs_time_per_iter; -#ifdef USE_MLSL - std::transform(this->startcomm_time_per_layer_total.begin(), - this->startcomm_time_per_layer_total.end(), - this->startcomm_time_per_layer.begin(), - this->startcomm_time_per_layer_total.begin(), - std::plus()); - - std::transform(this->waitcomm_time_per_layer_total.begin(), - this->waitcomm_time_per_layer_total.end(), - this->waitcomm_time_per_layer.begin(), - this->waitcomm_time_per_layer_total.begin(), - std::plus()); -#endif - - std::fill(this->forward_time_per_layer.begin(), - this->forward_time_per_layer.end(), 0.0); - std::fill(this->backward_time_per_layer.begin(), - this->backward_time_per_layer.end(), 0.0); - std::fill(this->update_time_per_layer.begin(), - this->update_time_per_layer.end(), 0.0); - this->cleardiffs_time_per_iter = 0.0; -#ifdef USE_MLSL - std::fill(this->startcomm_time_per_layer.begin(), - this->startcomm_time_per_layer.end(), 0.0); - std::fill(this->waitcomm_time_per_layer.begin(), - this->waitcomm_time_per_layer.end(), 0.0); + net_->ResetTimers(); + net_->PrintTimers(true); + net_->PrintPayloadSize(); #endif } -template -void Solver::PrintTimers(bool printTotal) { -#ifdef USE_MLSL - if (mn::get_node_id() != 0) - return; -#endif - - LOG(WARNING) << std::endl; - LOG(WARNING) << "####################################################"; - - std::vector& forward_timers = printTotal ? - forward_time_per_layer_total : forward_time_per_layer; - std::vector& backward_timers = printTotal ? - backward_time_per_layer_total : backward_time_per_layer; - std::vector& update_timers = printTotal ? - update_time_per_layer_total : update_time_per_layer; - double cleardiffs_timer = printTotal ? - cleardiffs_time_per_iter_total : cleardiffs_time_per_iter; -#ifdef USE_MLSL - std::vector& startcomm_timers = printTotal ? - startcomm_time_per_layer_total : startcomm_time_per_layer; - std::vector& waitcomm_timers = printTotal ? - waitcomm_time_per_layer_total : waitcomm_time_per_layer; - std::string prefix = printTotal ? "TOTAL " : "DELTA "; -#endif - - double forward_time = std::accumulate(forward_timers.begin(), - forward_timers.end(), 0.0) / 1000.0; - LOG(WARNING) << prefix << "FORWARD TIME: " << forward_time << " ms"; - for (int layer_idx = 0; layer_idx < net_->layers().size(); layer_idx++) { - LOG(WARNING) << "LAYER-" << layer_idx << " " - << net_->layers()[layer_idx]->type() - << ": forward_time: " << forward_timers[layer_idx] / 1000.0 - << " ms"; - } - LOG(WARNING) << std::endl; - - double backward_time = std::accumulate(backward_timers.begin(), - backward_timers.end(), 0.0) / 1000.0; - LOG(WARNING) << prefix << "BACKWARD TIME: " << backward_time << " ms"; - for (int layer_idx = 0; layer_idx < net_->layers().size(); layer_idx++) { - LOG(WARNING) << "LAYER-" << layer_idx << " " - << net_->layers()[layer_idx]->type() - << ": backward_time: " << backward_timers[layer_idx] / 1000.0 - << " ms"; - } - LOG(WARNING) << std::endl; - - double update_time = std::accumulate(update_timers.begin(), - update_timers.end(), 0.0) / 1000.0; - LOG(WARNING) << prefix << "UPDATE TIME: " << update_time << " ms"; - for (int layer_idx = 0; layer_idx < net_->layers().size(); layer_idx++) { - LOG(WARNING) << "LAYER-" << layer_idx << " " - << net_->layers()[layer_idx]->type() - << ": update_time: " << update_timers[layer_idx] / 1000.0 - << " ms"; - } - LOG(WARNING) << std::endl; - - double cleardiffs_time = cleardiffs_timer / 1000.0; - LOG(WARNING) << prefix << "CLEAR PARAMETER DIFFS TIME: " << cleardiffs_time << " ms"; - LOG(WARNING) << std::endl; - -#ifdef USE_MLSL - double startcomm_time = std::accumulate(startcomm_timers.begin(), - startcomm_timers.end(), 0.0) / 1000.0; - LOG(WARNING) << prefix << "START COMMUNICATION TIME: " << startcomm_time << " ms"; - for (int layer_idx = 0; layer_idx < net_->layers().size(); layer_idx++) { - LOG(WARNING) << "LAYER-" << layer_idx << " " - << net_->layers()[layer_idx]->type() - << ": startcomm_time: " << startcomm_timers[layer_idx] / 1000.0 - << " ms"; - } - LOG(WARNING) << std::endl; - - double waitcomm_time = std::accumulate(waitcomm_timers.begin(), - waitcomm_timers.end(), 0.0) / 1000.0; - LOG(WARNING) << prefix << "WAIT COMMUNICATION TIME: " << waitcomm_time << " ms"; - for (int layer_idx = 0; layer_idx < net_->layers().size(); layer_idx++) { - LOG(WARNING) << "LAYER-" << layer_idx << " " - << net_->layers()[layer_idx]->type() - << ": waitcomm_time: " << waitcomm_timers[layer_idx] / 1000.0 - << " ms"; - } - LOG(WARNING) << std::endl; - - LOG(WARNING) << prefix << "TIME (Computation + Communication): " << (forward_time + - backward_time + update_time + cleardiffs_time + startcomm_time + waitcomm_time) / 1000.0 - << " sec"; -#else - LOG(WARNING) << prefix << "TIME (Computation): " << (forward_time + - backward_time + update_time + cleardiffs_time) / 1000.0 << " sec"; -#endif - - LOG(WARNING) << "####################################################"; - LOG(WARNING) << std::endl; -} - -#endif /* CAFFE_PER_LAYER_TIMINGS */ - template void Solver::Solve(const char* resume_file) { CHECK(Caffe::root_solver()); diff --git a/src/caffe/solvers/sgd_solver.cpp b/src/caffe/solvers/sgd_solver.cpp index c700eeb85..d3f1d49e6 100644 --- a/src/caffe/solvers/sgd_solver.cpp +++ b/src/caffe/solvers/sgd_solver.cpp @@ -45,6 +45,31 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace caffe { + +#ifdef CAFFE_PER_LAYER_TIMINGS + +#define LAYER_UPDATE_TIMING_START(index) do { \ + if (this->net()->phase() == TRAIN) { \ + this->net()->update_start_time_per_layer[index] = this->net()->timer.Duration(); \ + } \ +}while(0) + +#define LAYER_UPDATE_TIMING_STOP(index) do { \ + if (this->net()->phase() == TRAIN) { \ + this->net()->update_stop_time_per_layer[index] = this->net()->timer.Duration(); \ + this->net()->update_time_per_layer[index] += (this->net()->update_stop_time_per_layer[index] - this->net()->update_start_time_per_layer[index]); \ + } \ +}while(0) + +#else + +#define LAYER_UPDATE_TIMING_START(index) +#define LAYER_UPDATE_TIMING_STOP(index) + +#endif + + + template Dtype SGDSolver::GetWarmUpLR(int cur_iter, int warmup_iter, Dtype warmup_start_lr) { if (cur_iter < 0) { @@ -195,10 +220,24 @@ template void SGDSolver::ApplyUpdate() { PrintLearningRate(); ClipGradients(); +#ifdef CAFFE_PER_LAYER_TIMINGS +#ifdef USE_MLSL + CHECK(mn::is_multinode() == false); +#endif + for (int i=0; inet_->layers().size(); i++) { + const std::vector param_ids = this->net_->get_layer_learnable_param_ids(i); + LAYER_UPDATE_TIMING_START(i); + for (int param_id = 0; param_id < param_ids.size(); ++param_id) { + ApplyUpdate(param_ids[param_id]); + } + LAYER_UPDATE_TIMING_STOP(i); + } +#else for (int param_id = 0; param_id < this->net_->learnable_params().size(); ++param_id) { ApplyUpdate(param_id); } +#endif } template diff --git a/src/caffe/test/test_mkldnn_convolution_layer.cpp b/src/caffe/test/test_mkldnn_convolution_layer.cpp index a2450577c..66a32e8b8 100644 --- a/src/caffe/test/test_mkldnn_convolution_layer.cpp +++ b/src/caffe/test/test_mkldnn_convolution_layer.cpp @@ -300,6 +300,7 @@ TYPED_TEST(MKLDNNConvolutionLayerTest, TestSetupMKLDNN) { EXPECT_EQ(this->blob_top_2_->width(), OW); } +#if 0 TYPED_TEST(MKLDNNConvolutionLayerTest, TestSetupMKLDNNWithRectangeKernelStridePad) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; @@ -418,7 +419,6 @@ TYPED_TEST(MKLDNNConvolutionLayerTest, TestSimpleConvolutionReLUMKLDNN) { } } -#if 0 TYPED_TEST(MKLDNNConvolutionLayerTest, TestDilatedConvolutionMKLDNN) { typedef typename TypeParam::Dtype Dtype; vector bottom_shape; @@ -1010,7 +1010,6 @@ TYPED_TEST(MKLDNNConvolutionLayerTest, TestGradient3D) { checker.CheckGradientExhaustive(&layer, this->blob_bottom_vec_, this->blob_top_vec_); } -#endif TYPED_TEST(MKLDNNConvolutionLayerTest, Test1x1Gradient) { typedef typename TypeParam::Dtype Dtype; @@ -1030,6 +1029,7 @@ TYPED_TEST(MKLDNNConvolutionLayerTest, Test1x1Gradient) { this->blob_top_vec_); } +#endif TYPED_TEST(MKLDNNConvolutionLayerTest, TestGradientGroup) { typedef typename TypeParam::Dtype Dtype; LayerParameter layer_param; diff --git a/src/caffe/test/test_net.cpp b/src/caffe/test/test_net.cpp index c62ed6850..53c4e2e1a 100644 --- a/src/caffe/test/test_net.cpp +++ b/src/caffe/test/test_net.cpp @@ -3463,6 +3463,116 @@ TEST_F(CompileNetTest, TestCompileNetBatchNormConvolution) { } #endif +#ifndef DISABLE_CONV_SUM_FUSION +TEST_F(CompileNetTest, TestCompileNetConvEltReluFusionMKLDNN) { + + const string& input_proto = + "name: 'TestNetwork' " + "layer { " + " name: 'data' " + " type: 'Data' " + " top: 'data' " + " top: 'label' " + "} " + "layer { " + " bottom: 'data' " + " name: 'conv1' " + " top: 'conv1' " + " type: 'Convolution' " + " convolution_param { " + " engine: MKLDNN " + " } " + "} " + "layer { " + " bottom: 'data' " + " name: 'conv2' " + " top: 'conv2' " + " type: 'Convolution' " + " convolution_param { " + " engine: MKLDNN " + " } " + "} " + "layer { " + " bottom: 'conv1' " + " name: 'conv3' " + " top: 'conv3' " + " type: 'Convolution' " + " convolution_param { " + " engine: MKLDNN " + " } " + "} " + "layer { " + " bottom: 'conv2' " + " bottom: 'conv3' " + " name: 'conv4' " + " top: 'relu' " + " type: 'Eltwise' " + "} " + + "layer { " + " bottom: 'relu' " + " top: 'relu' " + " name: 'relu' " + " type: 'ReLU' " + "}" + + "layer { " + " name: 'loss' " + " type: 'SoftmaxWithLoss' " + " bottom: 'relu' " + " bottom: 'label' " + "} "; + + const string& output_proto = + "name: 'TestNetwork' " + "layer { " + " name: 'data' " + " type: 'Data' " + " top: 'data' " + " top: 'label' " + "} " + + "layer { " + " bottom: 'data' " + " name: 'conv1' " + " top: 'conv1' " + " type: 'Convolution' " + " convolution_param { " + " engine: MKLDNN " + " } " + "} " + "layer { " + " bottom: 'data' " + " name: 'conv2' " + " top: 'conv2' " + " type: 'Convolution' " + " convolution_param { " + " engine: MKLDNN " + " } " + "} " + "layer { " + " bottom: 'conv1' " + " bottom: 'conv2' " + " name: 'conv3' " + " top: 'relu' " + " type: 'Convolution' " + " convolution_param { " + " engine: MKLDNN " + " } " + "} " + "layer { " + " name: 'loss' " + " type: 'SoftmaxWithLoss' " + " bottom: 'relu' " + " bottom: 'label' " + "} "; + + const string input_proto_test = "state: { phase: TEST } engine: 'MKLDNN'" + input_proto; + const string output_proto_test = "state: { phase: TEST } engine: 'MKLDNN'" + output_proto; + this->RunCompilerNetTest(input_proto_test, output_proto_test); +} +#endif + #ifdef MKLDNN_SUPPORTED // If BatchNorm of engine MKLDNN // produce blob consumed by diff --git a/src/caffe/util/benchmark.cpp b/src/caffe/util/benchmark.cpp index a9058ba32..db67f7ded 100644 --- a/src/caffe/util/benchmark.cpp +++ b/src/caffe/util/benchmark.cpp @@ -155,6 +155,20 @@ void Timer::Init() { } } +void Timer::InitTime() { + init_cpu_ = boost::posix_time::microsec_clock::local_time(); +} + +void Timer::InitTime(Timer &timer_) { + init_cpu_ = timer_.init_cpu_; +} + +float Timer::Duration() { + boost::posix_time::ptime curr_cpu_ = boost::posix_time::microsec_clock::local_time(); + float elapsed = (curr_cpu_ - init_cpu_).total_microseconds(); + return elapsed; +} + CPUTimer::CPUTimer() { this->initted_ = true; this->running_ = false; diff --git a/src/caffe/util/sampler.cpp b/src/caffe/util/sampler.cpp index f47a78dd8..b4fc44830 100644 --- a/src/caffe/util/sampler.cpp +++ b/src/caffe/util/sampler.cpp @@ -133,11 +133,11 @@ void SampleBBox(const Sampler& sampler, NormalizedBBox* sampled_bbox) { CHECK_GT(sampler.min_aspect_ratio(), 0.); CHECK_LT(sampler.max_aspect_ratio(), FLT_MAX); float aspect_ratio; - float min_aspect_ratio = std::max(sampler.min_aspect_ratio(), - std::pow(scale, 2.)); - float max_aspect_ratio = std::min(sampler.max_aspect_ratio(), - 1 / std::pow(scale, 2.)); - caffe_rng_uniform(1, min_aspect_ratio, max_aspect_ratio, &aspect_ratio); + caffe_rng_uniform(1, sampler.min_aspect_ratio(), sampler.max_aspect_ratio(), + &aspect_ratio); + + aspect_ratio = std::max(aspect_ratio, std::pow(scale, 2.)); + aspect_ratio = std::min(aspect_ratio, 1 / std::pow(scale, 2.)); // Figure out bbox dimension. float bbox_width = scale * sqrt(aspect_ratio); diff --git a/tools/caffe.cpp b/tools/caffe.cpp index 0373794c3..5edfaa88a 100644 --- a/tools/caffe.cpp +++ b/tools/caffe.cpp @@ -357,6 +357,9 @@ int test_detection(Net& caffe_net) { PERFORMANCE_INIT_MONITOR(); for (int i = 0; i < FLAGS_iterations; ++i) { +#ifdef DEBUG + LOG(INFO) << "Iteration: " << i; +#endif float iter_loss; const vector*>& result = caffe_net.Forward(&iter_loss); @@ -565,6 +568,8 @@ int time() { // have huge variance in some machines. int warmup_iterations = 5; for (int j = 0; j < warmup_iterations; ++j) { + if (j == warmup_iterations - 1) + PERFORMANCE_START_RESETTING_MONITOR(); for (int i = 0; i < layers.size(); ++i) { layers[i]->Forward(bottom_vecs[i], top_vecs[i]); } @@ -576,6 +581,8 @@ int time() { } } + PERFORMANCE_STOP_RESETTING_MONITOR(); + LOG(INFO) << "*** Benchmark begins ***"; LOG(INFO) << "Testing for " << FLAGS_iterations << " iterations."; Timer total_timer; diff --git a/tools/sample.cpp b/tools/sample.cpp new file mode 100644 index 000000000..3212cbe9b --- /dev/null +++ b/tools/sample.cpp @@ -0,0 +1,154 @@ +/* +All modification made by Intel Corporation: © 2018 Intel Corporation + +All contributions by the University of California: +Copyright (c) 2014, 2015, The Regents of the University of California (Regents) +All rights reserved. + +All other contributions: +Copyright (c) 2014, 2015, the respective contributors +All rights reserved. +For the list of contributors go to https://github.com/BVLC/caffe/blob/master/CONTRIBUTORS.md + +A part of the code referenced BVLC CAFFE ristretto branch +For the original code go to https://github.com/pmgysel/caffe + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Intel Corporation nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include + +#include +#include +#include +#include + +#include "boost/algorithm/string.hpp" +#include "caffe/caffe.hpp" +#include "caffe/proto/caffe.pb.h" +#include "caffe/util/upgrade_proto.hpp" + +#include "caffe/quant/quantization.hpp" + +using caffe::Blob; +using caffe::Caffe; +using caffe::Net; +using caffe::Layer; +using caffe::Solver; +using caffe::shared_ptr; +using caffe::string; +using caffe::Timer; +using caffe::vector; +using std::ostringstream; + +DEFINE_string(model, "", + "The model definition protocol buffer text file.."); +DEFINE_string(weights, "", + "The trained weights."); +DEFINE_string(trimming_mode, "", + "Available options: dynamic_fixed_point."); +DEFINE_string(model_quantized, "", + "The output path of the quantized net"); +DEFINE_int32(iterations, 50, + "Optional: The number of iterations to run."); +DEFINE_double(error_margin, 2, + "Optional: the allowed accuracy drop in %"); +DEFINE_int32(score_number, 0, + "Optional: The score number to run."); +DEFINE_string(scaling, "single", + "The scaling model: single or multiple"); +DEFINE_int32(detection, 0, + "Optional: classfication or object detection"); +DEFINE_int32(power, 1, + "Optional: power of two or floating"); + +// A simple registry for caffe commands. + +// A simple registry for caffe commands. +typedef int (*BrewFunction)(); +typedef std::map BrewMap; +BrewMap g_brew_map; + +#define RegisterBrewFunction(func) \ +namespace { \ +class __Registerer_##func { \ + public: /* NOLINT */ \ + __Registerer_##func() { \ + g_brew_map[#func] = &func; \ + } \ +}; \ +__Registerer_##func g_registerer_##func; \ +} + +static BrewFunction GetBrewFunction(const caffe::string& name) { + if (g_brew_map.count(name)) { + return g_brew_map[name]; + } else { + LOG(ERROR) << "Available sampling actions:"; + for (BrewMap::iterator it = g_brew_map.begin(); + it != g_brew_map.end(); ++it) { + LOG(ERROR) << "\t" << it->first; + } + LOG(FATAL) << "Unknown action: " << name; + return NULL; // not reachable, just to suppress old compiler warnings. + } +} + +// To add a command, define a function "int command()" and register it with +// RegisterBrewFunction(action); + +// Quantize FP32 to INT8 +int quantize(){ + CHECK_GT(FLAGS_model.size(), 0) << "Need a model definition to score."; + CHECK_GT(FLAGS_weights.size(), 0) << "Need model weights to score."; + CHECK_GT(FLAGS_model_quantized.size(), 0) << "Need network description " + "output path."; + CHECK_GT(FLAGS_trimming_mode.size(), 0) << "Need trimming mode."; + Quantization* q = new Quantization(FLAGS_model, FLAGS_weights, + FLAGS_model_quantized, FLAGS_iterations, FLAGS_trimming_mode, + FLAGS_error_margin, FLAGS_score_number, FLAGS_scaling, FLAGS_detection, FLAGS_power); + q->QuantizeNet(); + delete q; + return 0; +} +RegisterBrewFunction(quantize); + +int main(int argc, char** argv) { + // Print output to stderr (while still logging). + FLAGS_alsologtostderr = 1; + // Set version + gflags::SetVersionString(AS_STRING(CAFFE_VERSION)); + // Usage message. + gflags::SetUsageMessage("command line brew\n" + "usage: sample \n\n" + "commands:\n" + " quantize Trim 32bit floating point net\n"); + // Run tool or show usage. + caffe::GlobalInit(&argc, &argv); + if (argc == 2) { + return GetBrewFunction(caffe::string(argv[1]))(); + } else { + gflags::ShowUsageWithFlagsRestrict(argv[0], "tools/sample"); + } +}