diff --git a/Makefile.mobile b/Makefile.mobile index 8d27710d645..0edf31bff33 100644 --- a/Makefile.mobile +++ b/Makefile.mobile @@ -54,6 +54,7 @@ src/caffe/layers/mvn_layer.cpp \ src/caffe/layers/neuron_layer.cpp \ src/caffe/layers/pooling_layer.cpp \ src/caffe/layers/power_layer.cpp \ +src/caffe/layers/prelu_layer.cpp \ src/caffe/layers/relu_layer.cpp \ src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp \ src/caffe/layers/sigmoid_layer.cpp \ @@ -94,8 +95,8 @@ OBJS := $(PROTO_OBJS) $(CXX_OBJS) COMMON_FLAGS += -DCPU_ONLY INCLUDE_DIRS += ./include ./include/caffe/proto -LIBRARIES:=protobuf opencv_core opencv_highgui opencv_imgproc boost_thread boost_system boost_date_time -LIBRARY_DIRS:=/usr/local/lib +LIBRARIES := protobuf opencv_core opencv_highgui opencv_imgproc +LIBRARY_DIRS := /usr/local/lib ifeq ($(USE_EIGEN), y) COMMON_FLAGS += -DUSE_EIGEN diff --git a/include/caffe/common.hpp b/include/caffe/common.hpp index 153fd4e9298..ef77ca425de 100644 --- a/include/caffe/common.hpp +++ b/include/caffe/common.hpp @@ -3,6 +3,7 @@ #include "caffe/glog_alternate.hpp" +#include #include #include #include @@ -61,7 +62,6 @@ namespace cv { class Mat; } namespace caffe { // Common functions and classes from std that caffe often uses. -using std::shared_ptr; using std::fstream; using std::ios; using std::isnan; @@ -72,6 +72,7 @@ using std::map; using std::ostringstream; using std::pair; using std::set; +using std::shared_ptr; using std::string; using std::stringstream; using std::vector; @@ -93,7 +94,7 @@ class Caffe { } enum Brew { CPU, GPU }; - // This random number generator facade hides boost and CUDA rng + // This random number generator facade hides std and CUDA rng // implementation from one another (for cross-platform compatibility). class RNG { public: @@ -107,7 +108,7 @@ class Caffe { shared_ptr generator_; }; - // Getters for boost rng, curand, and cublas handles + // Getters for std rng, curand, and cublas handles inline static RNG& rng_stream() { if (!Get().random_generator_) { Get().random_generator_.reset(new RNG()); @@ -129,7 +130,7 @@ class Caffe { // freed in a non-pinned way, which may cause problems - I haven't verified // it personally but better to note it here in the header file. inline static void set_mode(Brew mode) { Get().mode_ = mode; } - // Sets the random seed of both boost and curand + // Sets the random seed of both std and curand static void set_random_seed(const unsigned int seed); // Sets the device. Since we have cublas and curand stuff, set device also // requires us to reset those values. diff --git a/include/caffe/internal_thread.hpp b/include/caffe/internal_thread.hpp index 815ca54605e..b630dc437e4 100644 --- a/include/caffe/internal_thread.hpp +++ b/include/caffe/internal_thread.hpp @@ -1,18 +1,14 @@ #ifndef CAFFE_INTERNAL_THREAD_HPP_ #define CAFFE_INTERNAL_THREAD_HPP_ -#include "caffe/common.hpp" +#include -/** - Forward declare boost::thread instead of including boost/thread.hpp - to avoid a boost/NVCC issues (#1009, #1010) on OSX. - */ -namespace boost { class thread; } +#include "caffe/common.hpp" namespace caffe { /** - * Virtual class encapsulate boost::thread for use in base class + * Virtual class encapsulate std::thread for use in base class * The child class will acquire the ability to run a single thread, * by reimplementing the virutal function InternalThreadEntry. */ @@ -34,7 +30,7 @@ class InternalThread { with the code you want your thread to run. */ virtual void InternalThreadEntry() {} - shared_ptr thread_; + shared_ptr thread_; }; } // namespace caffe diff --git a/include/caffe/proto/caffe.pb.h b/include/caffe/proto/caffe.pb.h index 382bffc3e03..c55506e5aea 100644 --- a/include/caffe/proto/caffe.pb.h +++ b/include/caffe/proto/caffe.pb.h @@ -79,6 +79,7 @@ class ThresholdParameter; class WindowDataParameter; class V1LayerParameter; class V0LayerParameter; +class PReLUParameter; enum SolverParameter_SolverMode { SolverParameter_SolverMode_CPU = 0, @@ -2693,6 +2694,15 @@ class LayerParameter : public ::google::protobuf::Message { inline ::caffe::PowerParameter* release_power_param(); inline void set_allocated_power_param(::caffe::PowerParameter* power_param); + // optional .caffe.PReLUParameter prelu_param = 131; + inline bool has_prelu_param() const; + inline void clear_prelu_param(); + static const int kPreluParamFieldNumber = 131; + inline const ::caffe::PReLUParameter& prelu_param() const; + inline ::caffe::PReLUParameter* mutable_prelu_param(); + inline ::caffe::PReLUParameter* release_prelu_param(); + inline void set_allocated_prelu_param(::caffe::PReLUParameter* prelu_param); + // optional .caffe.PythonParameter python_param = 130; inline bool has_python_param() const; inline void clear_python_param(); @@ -2819,6 +2829,8 @@ class LayerParameter : public ::google::protobuf::Message { inline void clear_has_pooling_param(); inline void set_has_power_param(); inline void clear_has_power_param(); + inline void set_has_prelu_param(); + inline void clear_has_prelu_param(); inline void set_has_python_param(); inline void clear_has_python_param(); inline void set_has_relu_param(); @@ -2870,6 +2882,7 @@ class LayerParameter : public ::google::protobuf::Message { ::caffe::MVNParameter* mvn_param_; ::caffe::PoolingParameter* pooling_param_; ::caffe::PowerParameter* power_param_; + ::caffe::PReLUParameter* prelu_param_; ::caffe::PythonParameter* python_param_; ::caffe::ReLUParameter* relu_param_; ::caffe::SigmoidParameter* sigmoid_param_; @@ -2881,7 +2894,7 @@ class LayerParameter : public ::google::protobuf::Message { int phase_; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(41 + 31) / 32]; + ::google::protobuf::uint32 _has_bits_[(42 + 31) / 32]; friend void protobuf_AddDesc_caffe_2eproto(); friend void protobuf_AssignDesc_caffe_2eproto(); @@ -4466,20 +4479,30 @@ class HDF5DataParameter : public ::google::protobuf::Message { inline ::google::protobuf::uint32 batch_size() const; inline void set_batch_size(::google::protobuf::uint32 value); + // optional bool shuffle = 3 [default = false]; + inline bool has_shuffle() const; + inline void clear_shuffle(); + static const int kShuffleFieldNumber = 3; + inline bool shuffle() const; + inline void set_shuffle(bool value); + // @@protoc_insertion_point(class_scope:caffe.HDF5DataParameter) private: inline void set_has_source(); inline void clear_has_source(); inline void set_has_batch_size(); inline void clear_has_batch_size(); + inline void set_has_shuffle(); + inline void clear_has_shuffle(); ::google::protobuf::UnknownFieldSet _unknown_fields_; ::std::string* source_; ::google::protobuf::uint32 batch_size_; + bool shuffle_; mutable int _cached_size_; - ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; friend void protobuf_AddDesc_caffe_2eproto(); friend void protobuf_AssignDesc_caffe_2eproto(); @@ -7968,6 +7991,100 @@ class V0LayerParameter : public ::google::protobuf::Message { void InitAsDefaultInstance(); static V0LayerParameter* default_instance_; }; +// ------------------------------------------------------------------- + +class PReLUParameter : public ::google::protobuf::Message { + public: + PReLUParameter(); + virtual ~PReLUParameter(); + + PReLUParameter(const PReLUParameter& from); + + inline PReLUParameter& operator=(const PReLUParameter& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const PReLUParameter& default_instance(); + + void Swap(PReLUParameter* other); + + // implements Message ---------------------------------------------- + + PReLUParameter* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PReLUParameter& from); + void MergeFrom(const PReLUParameter& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional .caffe.FillerParameter filler = 1; + inline bool has_filler() const; + inline void clear_filler(); + static const int kFillerFieldNumber = 1; + inline const ::caffe::FillerParameter& filler() const; + inline ::caffe::FillerParameter* mutable_filler(); + inline ::caffe::FillerParameter* release_filler(); + inline void set_allocated_filler(::caffe::FillerParameter* filler); + + // optional bool channel_shared = 2 [default = false]; + inline bool has_channel_shared() const; + inline void clear_channel_shared(); + static const int kChannelSharedFieldNumber = 2; + inline bool channel_shared() const; + inline void set_channel_shared(bool value); + + // @@protoc_insertion_point(class_scope:caffe.PReLUParameter) + private: + inline void set_has_filler(); + inline void clear_has_filler(); + inline void set_has_channel_shared(); + inline void clear_has_channel_shared(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::caffe::FillerParameter* filler_; + bool channel_shared_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + friend void protobuf_AddDesc_caffe_2eproto(); + friend void protobuf_AssignDesc_caffe_2eproto(); + friend void protobuf_ShutdownFile_caffe_2eproto(); + + void InitAsDefaultInstance(); + static PReLUParameter* default_instance_; +}; // =================================================================== @@ -11812,15 +11929,53 @@ inline void LayerParameter::set_allocated_power_param(::caffe::PowerParameter* p } } +// optional .caffe.PReLUParameter prelu_param = 131; +inline bool LayerParameter::has_prelu_param() const { + return (_has_bits_[1] & 0x00000002u) != 0; +} +inline void LayerParameter::set_has_prelu_param() { + _has_bits_[1] |= 0x00000002u; +} +inline void LayerParameter::clear_has_prelu_param() { + _has_bits_[1] &= ~0x00000002u; +} +inline void LayerParameter::clear_prelu_param() { + if (prelu_param_ != NULL) prelu_param_->::caffe::PReLUParameter::Clear(); + clear_has_prelu_param(); +} +inline const ::caffe::PReLUParameter& LayerParameter::prelu_param() const { + return prelu_param_ != NULL ? *prelu_param_ : *default_instance_->prelu_param_; +} +inline ::caffe::PReLUParameter* LayerParameter::mutable_prelu_param() { + set_has_prelu_param(); + if (prelu_param_ == NULL) prelu_param_ = new ::caffe::PReLUParameter; + return prelu_param_; +} +inline ::caffe::PReLUParameter* LayerParameter::release_prelu_param() { + clear_has_prelu_param(); + ::caffe::PReLUParameter* temp = prelu_param_; + prelu_param_ = NULL; + return temp; +} +inline void LayerParameter::set_allocated_prelu_param(::caffe::PReLUParameter* prelu_param) { + delete prelu_param_; + prelu_param_ = prelu_param; + if (prelu_param) { + set_has_prelu_param(); + } else { + clear_has_prelu_param(); + } +} + // optional .caffe.PythonParameter python_param = 130; inline bool LayerParameter::has_python_param() const { - return (_has_bits_[1] & 0x00000002u) != 0; + return (_has_bits_[1] & 0x00000004u) != 0; } inline void LayerParameter::set_has_python_param() { - _has_bits_[1] |= 0x00000002u; + _has_bits_[1] |= 0x00000004u; } inline void LayerParameter::clear_has_python_param() { - _has_bits_[1] &= ~0x00000002u; + _has_bits_[1] &= ~0x00000004u; } inline void LayerParameter::clear_python_param() { if (python_param_ != NULL) python_param_->::caffe::PythonParameter::Clear(); @@ -11852,13 +12007,13 @@ inline void LayerParameter::set_allocated_python_param(::caffe::PythonParameter* // optional .caffe.ReLUParameter relu_param = 123; inline bool LayerParameter::has_relu_param() const { - return (_has_bits_[1] & 0x00000004u) != 0; + return (_has_bits_[1] & 0x00000008u) != 0; } inline void LayerParameter::set_has_relu_param() { - _has_bits_[1] |= 0x00000004u; + _has_bits_[1] |= 0x00000008u; } inline void LayerParameter::clear_has_relu_param() { - _has_bits_[1] &= ~0x00000004u; + _has_bits_[1] &= ~0x00000008u; } inline void LayerParameter::clear_relu_param() { if (relu_param_ != NULL) relu_param_->::caffe::ReLUParameter::Clear(); @@ -11890,13 +12045,13 @@ inline void LayerParameter::set_allocated_relu_param(::caffe::ReLUParameter* rel // optional .caffe.SigmoidParameter sigmoid_param = 124; inline bool LayerParameter::has_sigmoid_param() const { - return (_has_bits_[1] & 0x00000008u) != 0; + return (_has_bits_[1] & 0x00000010u) != 0; } inline void LayerParameter::set_has_sigmoid_param() { - _has_bits_[1] |= 0x00000008u; + _has_bits_[1] |= 0x00000010u; } inline void LayerParameter::clear_has_sigmoid_param() { - _has_bits_[1] &= ~0x00000008u; + _has_bits_[1] &= ~0x00000010u; } inline void LayerParameter::clear_sigmoid_param() { if (sigmoid_param_ != NULL) sigmoid_param_->::caffe::SigmoidParameter::Clear(); @@ -11928,13 +12083,13 @@ inline void LayerParameter::set_allocated_sigmoid_param(::caffe::SigmoidParamete // optional .caffe.SoftmaxParameter softmax_param = 125; inline bool LayerParameter::has_softmax_param() const { - return (_has_bits_[1] & 0x00000010u) != 0; + return (_has_bits_[1] & 0x00000020u) != 0; } inline void LayerParameter::set_has_softmax_param() { - _has_bits_[1] |= 0x00000010u; + _has_bits_[1] |= 0x00000020u; } inline void LayerParameter::clear_has_softmax_param() { - _has_bits_[1] &= ~0x00000010u; + _has_bits_[1] &= ~0x00000020u; } inline void LayerParameter::clear_softmax_param() { if (softmax_param_ != NULL) softmax_param_->::caffe::SoftmaxParameter::Clear(); @@ -11966,13 +12121,13 @@ inline void LayerParameter::set_allocated_softmax_param(::caffe::SoftmaxParamete // optional .caffe.SliceParameter slice_param = 126; inline bool LayerParameter::has_slice_param() const { - return (_has_bits_[1] & 0x00000020u) != 0; + return (_has_bits_[1] & 0x00000040u) != 0; } inline void LayerParameter::set_has_slice_param() { - _has_bits_[1] |= 0x00000020u; + _has_bits_[1] |= 0x00000040u; } inline void LayerParameter::clear_has_slice_param() { - _has_bits_[1] &= ~0x00000020u; + _has_bits_[1] &= ~0x00000040u; } inline void LayerParameter::clear_slice_param() { if (slice_param_ != NULL) slice_param_->::caffe::SliceParameter::Clear(); @@ -12004,13 +12159,13 @@ inline void LayerParameter::set_allocated_slice_param(::caffe::SliceParameter* s // optional .caffe.TanHParameter tanh_param = 127; inline bool LayerParameter::has_tanh_param() const { - return (_has_bits_[1] & 0x00000040u) != 0; + return (_has_bits_[1] & 0x00000080u) != 0; } inline void LayerParameter::set_has_tanh_param() { - _has_bits_[1] |= 0x00000040u; + _has_bits_[1] |= 0x00000080u; } inline void LayerParameter::clear_has_tanh_param() { - _has_bits_[1] &= ~0x00000040u; + _has_bits_[1] &= ~0x00000080u; } inline void LayerParameter::clear_tanh_param() { if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); @@ -12042,13 +12197,13 @@ inline void LayerParameter::set_allocated_tanh_param(::caffe::TanHParameter* tan // optional .caffe.ThresholdParameter threshold_param = 128; inline bool LayerParameter::has_threshold_param() const { - return (_has_bits_[1] & 0x00000080u) != 0; + return (_has_bits_[1] & 0x00000100u) != 0; } inline void LayerParameter::set_has_threshold_param() { - _has_bits_[1] |= 0x00000080u; + _has_bits_[1] |= 0x00000100u; } inline void LayerParameter::clear_has_threshold_param() { - _has_bits_[1] &= ~0x00000080u; + _has_bits_[1] &= ~0x00000100u; } inline void LayerParameter::clear_threshold_param() { if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); @@ -12080,13 +12235,13 @@ inline void LayerParameter::set_allocated_threshold_param(::caffe::ThresholdPara // optional .caffe.WindowDataParameter window_data_param = 129; inline bool LayerParameter::has_window_data_param() const { - return (_has_bits_[1] & 0x00000100u) != 0; + return (_has_bits_[1] & 0x00000200u) != 0; } inline void LayerParameter::set_has_window_data_param() { - _has_bits_[1] |= 0x00000100u; + _has_bits_[1] |= 0x00000200u; } inline void LayerParameter::clear_has_window_data_param() { - _has_bits_[1] &= ~0x00000100u; + _has_bits_[1] &= ~0x00000200u; } inline void LayerParameter::clear_window_data_param() { if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); @@ -13607,6 +13762,28 @@ inline void HDF5DataParameter::set_batch_size(::google::protobuf::uint32 value) batch_size_ = value; } +// optional bool shuffle = 3 [default = false]; +inline bool HDF5DataParameter::has_shuffle() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void HDF5DataParameter::set_has_shuffle() { + _has_bits_[0] |= 0x00000004u; +} +inline void HDF5DataParameter::clear_has_shuffle() { + _has_bits_[0] &= ~0x00000004u; +} +inline void HDF5DataParameter::clear_shuffle() { + shuffle_ = false; + clear_has_shuffle(); +} +inline bool HDF5DataParameter::shuffle() const { + return shuffle_; +} +inline void HDF5DataParameter::set_shuffle(bool value) { + set_has_shuffle(); + shuffle_ = value; +} + // ------------------------------------------------------------------- // HDF5OutputParameter @@ -18534,6 +18711,70 @@ inline void V0LayerParameter::set_allocated_hdf5_output_param(::caffe::HDF5Outpu } } +// ------------------------------------------------------------------- + +// PReLUParameter + +// optional .caffe.FillerParameter filler = 1; +inline bool PReLUParameter::has_filler() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void PReLUParameter::set_has_filler() { + _has_bits_[0] |= 0x00000001u; +} +inline void PReLUParameter::clear_has_filler() { + _has_bits_[0] &= ~0x00000001u; +} +inline void PReLUParameter::clear_filler() { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + clear_has_filler(); +} +inline const ::caffe::FillerParameter& PReLUParameter::filler() const { + return filler_ != NULL ? *filler_ : *default_instance_->filler_; +} +inline ::caffe::FillerParameter* PReLUParameter::mutable_filler() { + set_has_filler(); + if (filler_ == NULL) filler_ = new ::caffe::FillerParameter; + return filler_; +} +inline ::caffe::FillerParameter* PReLUParameter::release_filler() { + clear_has_filler(); + ::caffe::FillerParameter* temp = filler_; + filler_ = NULL; + return temp; +} +inline void PReLUParameter::set_allocated_filler(::caffe::FillerParameter* filler) { + delete filler_; + filler_ = filler; + if (filler) { + set_has_filler(); + } else { + clear_has_filler(); + } +} + +// optional bool channel_shared = 2 [default = false]; +inline bool PReLUParameter::has_channel_shared() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void PReLUParameter::set_has_channel_shared() { + _has_bits_[0] |= 0x00000002u; +} +inline void PReLUParameter::clear_has_channel_shared() { + _has_bits_[0] &= ~0x00000002u; +} +inline void PReLUParameter::clear_channel_shared() { + channel_shared_ = false; + clear_has_channel_shared(); +} +inline bool PReLUParameter::channel_shared() const { + return channel_shared_; +} +inline void PReLUParameter::set_channel_shared(bool value) { + set_has_channel_shared(); + channel_shared_ = value; +} + // @@protoc_insertion_point(namespace_scope) diff --git a/include/caffe/util/benchmark.hpp b/include/caffe/util/benchmark.hpp index d63582776ee..79012339ab4 100644 --- a/include/caffe/util/benchmark.hpp +++ b/include/caffe/util/benchmark.hpp @@ -1,7 +1,7 @@ #ifndef CAFFE_UTIL_BENCHMARK_H_ #define CAFFE_UTIL_BENCHMARK_H_ -#include +#include #include "caffe/util/device_alternate.hpp" @@ -31,8 +31,11 @@ class Timer { cudaEvent_t start_gpu_; cudaEvent_t stop_gpu_; #endif - boost::posix_time::ptime start_cpu_; - boost::posix_time::ptime stop_cpu_; + typedef std::chrono::high_resolution_clock clock; + typedef std::chrono::microseconds microseconds; + typedef std::chrono::milliseconds milliseconds; + clock::time_point start_cpu_; + clock::time_point stop_cpu_; float elapsed_milliseconds_; float elapsed_microseconds_; }; diff --git a/include/caffe/util/rng.hpp b/include/caffe/util/rng.hpp index 8f1cf0d17c2..d3128aa542f 100644 --- a/include/caffe/util/rng.hpp +++ b/include/caffe/util/rng.hpp @@ -3,15 +3,13 @@ #include #include - -#include "boost/random/mersenne_twister.hpp" -#include "boost/random/uniform_int.hpp" +#include #include "caffe/common.hpp" namespace caffe { -typedef boost::mt19937 rng_t; +typedef std::mt19937 rng_t; inline rng_t* caffe_rng() { return static_cast(Caffe::rng_stream().generator()); @@ -23,7 +21,7 @@ inline void shuffle(RandomAccessIterator begin, RandomAccessIterator end, RandomGenerator* gen) { typedef typename std::iterator_traits::difference_type difference_type; - typedef typename boost::uniform_int dist_type; + typedef typename std::uniform_int_distribution dist_type; difference_type length = std::distance(begin, end); if (length <= 0) return; diff --git a/include/caffe/vision_layers.hpp b/include/caffe/vision_layers.hpp index cd0ab8babb0..15b192154b8 100644 --- a/include/caffe/vision_layers.hpp +++ b/include/caffe/vision_layers.hpp @@ -1,6 +1,7 @@ #ifndef CAFFE_VISION_LAYERS_HPP_ #define CAFFE_VISION_LAYERS_HPP_ +#include #include #include #include diff --git a/src/caffe/internal_thread.cpp b/src/caffe/internal_thread.cpp index c2d19d433b4..34f51d14e43 100644 --- a/src/caffe/internal_thread.cpp +++ b/src/caffe/internal_thread.cpp @@ -1,4 +1,4 @@ -#include +#include #include "caffe/internal_thread.hpp" namespace caffe { @@ -18,7 +18,7 @@ bool InternalThread::StartInternalThread() { } try { thread_.reset( - new boost::thread(&InternalThread::InternalThreadEntry, this)); + new std::thread(&InternalThread::InternalThreadEntry, this)); } catch (...) { return false; } diff --git a/src/caffe/proto/caffe.pb.cc b/src/caffe/proto/caffe.pb.cc index 637f10293b6..2bf1cf3cfb2 100644 --- a/src/caffe/proto/caffe.pb.cc +++ b/src/caffe/proto/caffe.pb.cc @@ -172,6 +172,9 @@ const ::google::protobuf::Descriptor* V0LayerParameter_descriptor_ = NULL; const ::google::protobuf::internal::GeneratedMessageReflection* V0LayerParameter_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* V0LayerParameter_PoolMethod_descriptor_ = NULL; +const ::google::protobuf::Descriptor* PReLUParameter_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PReLUParameter_reflection_ = NULL; const ::google::protobuf::EnumDescriptor* Phase_descriptor_ = NULL; } // namespace @@ -424,7 +427,7 @@ void protobuf_AssignDesc_caffe_2eproto() { sizeof(ParamSpec)); ParamSpec_DimCheckMode_descriptor_ = ParamSpec_descriptor_->enum_type(0); LayerParameter_descriptor_ = file->message_type(11); - static const int LayerParameter_offsets_[41] = { + static const int LayerParameter_offsets_[42] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, name_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, bottom_), @@ -458,6 +461,7 @@ void protobuf_AssignDesc_caffe_2eproto() { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, mvn_param_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, pooling_param_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, power_param_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, prelu_param_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, python_param_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, relu_param_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(LayerParameter, sigmoid_param_), @@ -702,9 +706,10 @@ void protobuf_AssignDesc_caffe_2eproto() { ::google::protobuf::MessageFactory::generated_factory(), sizeof(ExpParameter)); HDF5DataParameter_descriptor_ = file->message_type(24); - static const int HDF5DataParameter_offsets_[2] = { + static const int HDF5DataParameter_offsets_[3] = { GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, source_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, batch_size_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HDF5DataParameter, shuffle_), }; HDF5DataParameter_reflection_ = new ::google::protobuf::internal::GeneratedMessageReflection( @@ -1160,6 +1165,22 @@ void protobuf_AssignDesc_caffe_2eproto() { ::google::protobuf::MessageFactory::generated_factory(), sizeof(V0LayerParameter)); V0LayerParameter_PoolMethod_descriptor_ = V0LayerParameter_descriptor_->enum_type(0); + PReLUParameter_descriptor_ = file->message_type(45); + static const int PReLUParameter_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, filler_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, channel_shared_), + }; + PReLUParameter_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PReLUParameter_descriptor_, + PReLUParameter::default_instance_, + PReLUParameter_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PReLUParameter, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PReLUParameter)); Phase_descriptor_ = file->enum_type(0); } @@ -1263,6 +1284,8 @@ void protobuf_RegisterTypes(const ::std::string&) { V1LayerParameter_descriptor_, &V1LayerParameter::default_instance()); ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( V0LayerParameter_descriptor_, &V0LayerParameter::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PReLUParameter_descriptor_, &PReLUParameter::default_instance()); } } // namespace @@ -1362,6 +1385,8 @@ void protobuf_ShutdownFile_caffe_2eproto() { delete V0LayerParameter::default_instance_; delete V0LayerParameter_reflection_; delete V0LayerParameter::_default_det_crop_mode_; + delete PReLUParameter::default_instance_; + delete PReLUParameter_reflection_; } void protobuf_AddDesc_caffe_2eproto() { @@ -1429,7 +1454,7 @@ void protobuf_AddDesc_caffe_2eproto() { "\n\004name\030\001 \001(\t\0221\n\nshare_mode\030\002 \001(\0162\035.caffe" ".ParamSpec.DimCheckMode\022\022\n\007lr_mult\030\003 \001(\002" ":\0011\022\025\n\ndecay_mult\030\004 \001(\002:\0011\"*\n\014DimCheckMo" - "de\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\203\016\n\016Layer" + "de\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001\"\260\016\n\016Layer" "Parameter\022\014\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\016\n" "\006bottom\030\003 \003(\t\022\013\n\003top\030\004 \003(\t\022\033\n\005phase\030\n \001(" "\0162\014.caffe.Phase\022\023\n\013loss_weight\030\005 \003(\002\022\037\n\005" @@ -1465,211 +1490,215 @@ void protobuf_AddDesc_caffe_2eproto() { "mvn_param\030x \001(\0132\023.caffe.MVNParameter\022.\n\r" "pooling_param\030y \001(\0132\027.caffe.PoolingParam" "eter\022*\n\013power_param\030z \001(\0132\025.caffe.PowerP" - "arameter\022-\n\014python_param\030\202\001 \001(\0132\026.caffe." - "PythonParameter\022(\n\nrelu_param\030{ \001(\0132\024.ca" - "ffe.ReLUParameter\022.\n\rsigmoid_param\030| \001(\013" - "2\027.caffe.SigmoidParameter\022.\n\rsoftmax_par" - "am\030} \001(\0132\027.caffe.SoftmaxParameter\022*\n\013sli" - "ce_param\030~ \001(\0132\025.caffe.SliceParameter\022(\n" - "\ntanh_param\030\177 \001(\0132\024.caffe.TanHParameter\022" - "3\n\017threshold_param\030\200\001 \001(\0132\031.caffe.Thresh" - "oldParameter\0226\n\021window_data_param\030\201\001 \001(\013" - "2\032.caffe.WindowDataParameter\"\177\n\027Transfor" - "mationParameter\022\020\n\005scale\030\001 \001(\002:\0011\022\025\n\006mir" - "ror\030\002 \001(\010:\005false\022\024\n\tcrop_size\030\003 \001(\r:\0010\022\021" - "\n\tmean_file\030\004 \001(\t\022\022\n\nmean_value\030\005 \003(\002\">\n" - "\rLossParameter\022\024\n\014ignore_label\030\001 \001(\005\022\027\n\t" - "normalize\030\002 \001(\010:\004true\"L\n\021AccuracyParamet" - "er\022\020\n\005top_k\030\001 \001(\r:\0011\022\017\n\004axis\030\002 \001(\005:\0011\022\024\n" - "\014ignore_label\030\003 \001(\005\"\?\n\017ArgMaxParameter\022\032" - "\n\013out_max_val\030\001 \001(\010:\005false\022\020\n\005top_k\030\002 \001(" - "\r:\0011\"9\n\017ConcatParameter\022\017\n\004axis\030\002 \001(\005:\0011" - "\022\025\n\nconcat_dim\030\001 \001(\r:\0011\"-\n\030ContrastiveLo" - "ssParameter\022\021\n\006margin\030\001 \001(\002:\0011\"\277\003\n\024Convo" - "lutionParameter\022\022\n\nnum_output\030\001 \001(\r\022\027\n\tb" - "ias_term\030\002 \001(\010:\004true\022\016\n\003pad\030\003 \001(\r:\0010\022\020\n\005" - "pad_h\030\t \001(\r:\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\023\n\013kern" - "el_size\030\004 \001(\r\022\020\n\010kernel_h\030\013 \001(\r\022\020\n\010kerne" - "l_w\030\014 \001(\r\022\020\n\005group\030\005 \001(\r:\0011\022\021\n\006stride\030\006 " - "\001(\r:\0011\022\020\n\010stride_h\030\r \001(\r\022\020\n\010stride_w\030\016 \001" - "(\r\022-\n\rweight_filler\030\007 \001(\0132\026.caffe.Filler" - "Parameter\022+\n\013bias_filler\030\010 \001(\0132\026.caffe.F" - "illerParameter\022;\n\006engine\030\017 \001(\0162\".caffe.C" - "onvolutionParameter.Engine:\007DEFAULT\"+\n\006E" - "ngine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002" - "\"\217\002\n\rDataParameter\022\016\n\006source\030\001 \001(\t\022\022\n\nba" - "tch_size\030\004 \001(\r\022\024\n\trand_skip\030\007 \001(\r:\0010\0221\n\007" - "backend\030\010 \001(\0162\027.caffe.DataParameter.DB:\007" - "LEVELDB\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tmean_file\030\003" - " \001(\t\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001" - "(\010:\005false\022\"\n\023force_encoded_color\030\t \001(\010:\005" - "false\"\033\n\002DB\022\013\n\007LEVELDB\020\000\022\010\n\004LMDB\020\001\".\n\020Dr" - "opoutParameter\022\032\n\rdropout_ratio\030\001 \001(\002:\0030" - ".5\"\240\001\n\022DummyDataParameter\022+\n\013data_filler" - "\030\001 \003(\0132\026.caffe.FillerParameter\022\037\n\005shape\030" - "\006 \003(\0132\020.caffe.BlobShape\022\013\n\003num\030\002 \003(\r\022\020\n\010" - "channels\030\003 \003(\r\022\016\n\006height\030\004 \003(\r\022\r\n\005width\030" - "\005 \003(\r\"\245\001\n\020EltwiseParameter\0229\n\toperation\030" - "\001 \001(\0162!.caffe.EltwiseParameter.EltwiseOp" - ":\003SUM\022\r\n\005coeff\030\002 \003(\002\022\036\n\020stable_prod_grad" - "\030\003 \001(\010:\004true\"\'\n\tEltwiseOp\022\010\n\004PROD\020\000\022\007\n\003S" - "UM\020\001\022\007\n\003MAX\020\002\"D\n\014ExpParameter\022\020\n\004base\030\001 " - "\001(\002:\002-1\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shift\030\003 \001(\002" - ":\0010\"7\n\021HDF5DataParameter\022\016\n\006source\030\001 \001(\t" - "\022\022\n\nbatch_size\030\002 \001(\r\"(\n\023HDF5OutputParame" - "ter\022\021\n\tfile_name\030\001 \001(\t\"^\n\022HingeLossParam" - "eter\0220\n\004norm\030\001 \001(\0162\036.caffe.HingeLossPara" - "meter.Norm:\002L1\"\026\n\004Norm\022\006\n\002L1\020\001\022\006\n\002L2\020\002\"\224" - "\002\n\022ImageDataParameter\022\016\n\006source\030\001 \001(\t\022\022\n" - "\nbatch_size\030\004 \001(\r\022\024\n\trand_skip\030\007 \001(\r:\0010\022" - "\026\n\007shuffle\030\010 \001(\010:\005false\022\025\n\nnew_height\030\t " - "\001(\r:\0010\022\024\n\tnew_width\030\n \001(\r:\0010\022\026\n\010is_color" - "\030\013 \001(\010:\004true\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tmean_f" + "arameter\022+\n\013prelu_param\030\203\001 \001(\0132\025.caffe.P" + "ReLUParameter\022-\n\014python_param\030\202\001 \001(\0132\026.c" + "affe.PythonParameter\022(\n\nrelu_param\030{ \001(\013" + "2\024.caffe.ReLUParameter\022.\n\rsigmoid_param\030" + "| \001(\0132\027.caffe.SigmoidParameter\022.\n\rsoftma" + "x_param\030} \001(\0132\027.caffe.SoftmaxParameter\022*" + "\n\013slice_param\030~ \001(\0132\025.caffe.SliceParamet" + "er\022(\n\ntanh_param\030\177 \001(\0132\024.caffe.TanHParam" + "eter\0223\n\017threshold_param\030\200\001 \001(\0132\031.caffe.T" + "hresholdParameter\0226\n\021window_data_param\030\201" + "\001 \001(\0132\032.caffe.WindowDataParameter\"\177\n\027Tra" + "nsformationParameter\022\020\n\005scale\030\001 \001(\002:\0011\022\025" + "\n\006mirror\030\002 \001(\010:\005false\022\024\n\tcrop_size\030\003 \001(\r" + ":\0010\022\021\n\tmean_file\030\004 \001(\t\022\022\n\nmean_value\030\005 \003" + "(\002\">\n\rLossParameter\022\024\n\014ignore_label\030\001 \001(" + "\005\022\027\n\tnormalize\030\002 \001(\010:\004true\"L\n\021AccuracyPa" + "rameter\022\020\n\005top_k\030\001 \001(\r:\0011\022\017\n\004axis\030\002 \001(\005:" + "\0011\022\024\n\014ignore_label\030\003 \001(\005\"\?\n\017ArgMaxParame" + "ter\022\032\n\013out_max_val\030\001 \001(\010:\005false\022\020\n\005top_k" + "\030\002 \001(\r:\0011\"9\n\017ConcatParameter\022\017\n\004axis\030\002 \001" + "(\005:\0011\022\025\n\nconcat_dim\030\001 \001(\r:\0011\"-\n\030Contrast" + "iveLossParameter\022\021\n\006margin\030\001 \001(\002:\0011\"\277\003\n\024" + "ConvolutionParameter\022\022\n\nnum_output\030\001 \001(\r" + "\022\027\n\tbias_term\030\002 \001(\010:\004true\022\016\n\003pad\030\003 \001(\r:\001" + "0\022\020\n\005pad_h\030\t \001(\r:\0010\022\020\n\005pad_w\030\n \001(\r:\0010\022\023\n" + "\013kernel_size\030\004 \001(\r\022\020\n\010kernel_h\030\013 \001(\r\022\020\n\010" + "kernel_w\030\014 \001(\r\022\020\n\005group\030\005 \001(\r:\0011\022\021\n\006stri" + "de\030\006 \001(\r:\0011\022\020\n\010stride_h\030\r \001(\r\022\020\n\010stride_" + "w\030\016 \001(\r\022-\n\rweight_filler\030\007 \001(\0132\026.caffe.F" + "illerParameter\022+\n\013bias_filler\030\010 \001(\0132\026.ca" + "ffe.FillerParameter\022;\n\006engine\030\017 \001(\0162\".ca" + "ffe.ConvolutionParameter.Engine:\007DEFAULT" + "\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CU" + "DNN\020\002\"\217\002\n\rDataParameter\022\016\n\006source\030\001 \001(\t\022" + "\022\n\nbatch_size\030\004 \001(\r\022\024\n\trand_skip\030\007 \001(\r:\001" + "0\0221\n\007backend\030\010 \001(\0162\027.caffe.DataParameter" + ".DB:\007LEVELDB\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tmean_f" "ile\030\003 \001(\t\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006mirro" - "r\030\006 \001(\010:\005false\022\025\n\013root_folder\030\014 \001(\t:\000\"\'\n" - "\025InfogainLossParameter\022\016\n\006source\030\001 \001(\t\"\261" - "\001\n\025InnerProductParameter\022\022\n\nnum_output\030\001" - " \001(\r\022\027\n\tbias_term\030\002 \001(\010:\004true\022-\n\rweight_" - "filler\030\003 \001(\0132\026.caffe.FillerParameter\022+\n\013" - "bias_filler\030\004 \001(\0132\026.caffe.FillerParamete" - "r\022\017\n\004axis\030\005 \001(\005:\0011\"\326\001\n\014LRNParameter\022\025\n\nl" - "ocal_size\030\001 \001(\r:\0015\022\020\n\005alpha\030\002 \001(\002:\0011\022\022\n\004" - "beta\030\003 \001(\002:\0040.75\022D\n\013norm_region\030\004 \001(\0162\036." - "caffe.LRNParameter.NormRegion:\017ACROSS_CH" - "ANNELS\022\014\n\001k\030\005 \001(\002:\0011\"5\n\nNormRegion\022\023\n\017AC" - "ROSS_CHANNELS\020\000\022\022\n\016WITHIN_CHANNEL\020\001\"Z\n\023M" - "emoryDataParameter\022\022\n\nbatch_size\030\001 \001(\r\022\020" - "\n\010channels\030\002 \001(\r\022\016\n\006height\030\003 \001(\r\022\r\n\005widt" - "h\030\004 \001(\r\"P\n\014MVNParameter\022 \n\022normalize_var" - "iance\030\001 \001(\010:\004true\022\036\n\017across_channels\030\002 \001" - "(\010:\005false\"\242\003\n\020PoolingParameter\0225\n\004pool\030\001" - " \001(\0162\".caffe.PoolingParameter.PoolMethod" - ":\003MAX\022\016\n\003pad\030\004 \001(\r:\0010\022\020\n\005pad_h\030\t \001(\r:\0010\022" - "\020\n\005pad_w\030\n \001(\r:\0010\022\023\n\013kernel_size\030\002 \001(\r\022\020" - "\n\010kernel_h\030\005 \001(\r\022\020\n\010kernel_w\030\006 \001(\r\022\021\n\006st" - "ride\030\003 \001(\r:\0011\022\020\n\010stride_h\030\007 \001(\r\022\020\n\010strid" - "e_w\030\010 \001(\r\0227\n\006engine\030\013 \001(\0162\036.caffe.Poolin" - "gParameter.Engine:\007DEFAULT\022\035\n\016global_poo" - "ling\030\014 \001(\010:\005false\".\n\nPoolMethod\022\007\n\003MAX\020\000" - "\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"+\n\006Engine\022\013\n\007D" - "EFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"F\n\016PowerP" - "arameter\022\020\n\005power\030\001 \001(\002:\0011\022\020\n\005scale\030\002 \001(" - "\002:\0011\022\020\n\005shift\030\003 \001(\002:\0010\"0\n\017PythonParamete" - "r\022\016\n\006module\030\001 \001(\t\022\r\n\005layer\030\002 \001(\t\"\215\001\n\rReL" - "UParameter\022\031\n\016negative_slope\030\001 \001(\002:\0010\0224\n" - "\006engine\030\002 \001(\0162\033.caffe.ReLUParameter.Engi" - "ne:\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CA" - "FFE\020\001\022\t\n\005CUDNN\020\002\"x\n\020SigmoidParameter\0227\n\006" - "engine\030\001 \001(\0162\036.caffe.SigmoidParameter.En" - "gine:\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005" - "CAFFE\020\001\022\t\n\005CUDNN\020\002\"L\n\016SliceParameter\022\017\n\004" - "axis\030\003 \001(\005:\0011\022\023\n\013slice_point\030\002 \003(\r\022\024\n\tsl" - "ice_dim\030\001 \001(\r:\0011\"\211\001\n\020SoftmaxParameter\0227\n" - "\006engine\030\001 \001(\0162\036.caffe.SoftmaxParameter.E" - "ngine:\007DEFAULT\022\017\n\004axis\030\002 \001(\005:\0011\"+\n\006Engin" - "e\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"r\n\r" - "TanHParameter\0224\n\006engine\030\001 \001(\0162\033.caffe.Ta" - "nHParameter.Engine:\007DEFAULT\"+\n\006Engine\022\013\n" - "\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"*\n\022Thre" - "sholdParameter\022\024\n\tthreshold\030\001 \001(\002:\0010\"\301\002\n" - "\023WindowDataParameter\022\016\n\006source\030\001 \001(\t\022\020\n\005" - "scale\030\002 \001(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\022\n\nbat" - "ch_size\030\004 \001(\r\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006m" - "irror\030\006 \001(\010:\005false\022\031\n\014fg_threshold\030\007 \001(\002" - ":\0030.5\022\031\n\014bg_threshold\030\010 \001(\002:\0030.5\022\031\n\013fg_f" - "raction\030\t \001(\002:\0040.25\022\026\n\013context_pad\030\n \001(\r" - ":\0010\022\027\n\tcrop_mode\030\013 \001(\t:\004warp\022\033\n\014cache_im" - "ages\030\014 \001(\010:\005false\022\025\n\013root_folder\030\r \001(\t:\000" - "\"\340\023\n\020V1LayerParameter\022\016\n\006bottom\030\002 \003(\t\022\013\n" - "\003top\030\003 \003(\t\022\014\n\004name\030\004 \001(\t\022$\n\007include\030 \003(" - "\0132\023.caffe.NetStateRule\022$\n\007exclude\030! \003(\0132" - "\023.caffe.NetStateRule\022/\n\004type\030\005 \001(\0162!.caf" - "fe.V1LayerParameter.LayerType\022\037\n\005blobs\030\006" - " \003(\0132\020.caffe.BlobProto\022\016\n\005param\030\351\007 \003(\t\022>" - "\n\017blob_share_mode\030\352\007 \003(\0162$.caffe.V1Layer" - "Parameter.DimCheckMode\022\020\n\010blobs_lr\030\007 \003(\002" - "\022\024\n\014weight_decay\030\010 \003(\002\022\023\n\013loss_weight\030# " - "\003(\002\0220\n\016accuracy_param\030\033 \001(\0132\030.caffe.Accu" - "racyParameter\022,\n\014argmax_param\030\027 \001(\0132\026.ca" - "ffe.ArgMaxParameter\022,\n\014concat_param\030\t \001(" - "\0132\026.caffe.ConcatParameter\022\?\n\026contrastive" - "_loss_param\030( \001(\0132\037.caffe.ContrastiveLos" - "sParameter\0226\n\021convolution_param\030\n \001(\0132\033." - "caffe.ConvolutionParameter\022(\n\ndata_param" - "\030\013 \001(\0132\024.caffe.DataParameter\022.\n\rdropout_" - "param\030\014 \001(\0132\027.caffe.DropoutParameter\0223\n\020" - "dummy_data_param\030\032 \001(\0132\031.caffe.DummyData" - "Parameter\022.\n\reltwise_param\030\030 \001(\0132\027.caffe" - ".EltwiseParameter\022&\n\texp_param\030) \001(\0132\023.c" - "affe.ExpParameter\0221\n\017hdf5_data_param\030\r \001" - "(\0132\030.caffe.HDF5DataParameter\0225\n\021hdf5_out" - "put_param\030\016 \001(\0132\032.caffe.HDF5OutputParame" - "ter\0223\n\020hinge_loss_param\030\035 \001(\0132\031.caffe.Hi" - "ngeLossParameter\0223\n\020image_data_param\030\017 \001" - "(\0132\031.caffe.ImageDataParameter\0229\n\023infogai" - "n_loss_param\030\020 \001(\0132\034.caffe.InfogainLossP" - "arameter\0229\n\023inner_product_param\030\021 \001(\0132\034." - "caffe.InnerProductParameter\022&\n\tlrn_param" - "\030\022 \001(\0132\023.caffe.LRNParameter\0225\n\021memory_da" - "ta_param\030\026 \001(\0132\032.caffe.MemoryDataParamet" - "er\022&\n\tmvn_param\030\" \001(\0132\023.caffe.MVNParamet" - "er\022.\n\rpooling_param\030\023 \001(\0132\027.caffe.Poolin" - "gParameter\022*\n\013power_param\030\025 \001(\0132\025.caffe." - "PowerParameter\022(\n\nrelu_param\030\036 \001(\0132\024.caf" - "fe.ReLUParameter\022.\n\rsigmoid_param\030& \001(\0132" - "\027.caffe.SigmoidParameter\022.\n\rsoftmax_para" - "m\030\' \001(\0132\027.caffe.SoftmaxParameter\022*\n\013slic" - "e_param\030\037 \001(\0132\025.caffe.SliceParameter\022(\n\n" - "tanh_param\030% \001(\0132\024.caffe.TanHParameter\0222" - "\n\017threshold_param\030\031 \001(\0132\031.caffe.Threshol" - "dParameter\0225\n\021window_data_param\030\024 \001(\0132\032." - "caffe.WindowDataParameter\0227\n\017transform_p" - "aram\030$ \001(\0132\036.caffe.TransformationParamet" - "er\022(\n\nloss_param\030* \001(\0132\024.caffe.LossParam" - "eter\022&\n\005layer\030\001 \001(\0132\027.caffe.V0LayerParam" - "eter\"\330\004\n\tLayerType\022\010\n\004NONE\020\000\022\n\n\006ABSVAL\020#" - "\022\014\n\010ACCURACY\020\001\022\n\n\006ARGMAX\020\036\022\010\n\004BNLL\020\002\022\n\n\006" - "CONCAT\020\003\022\024\n\020CONTRASTIVE_LOSS\020%\022\017\n\013CONVOL" - "UTION\020\004\022\010\n\004DATA\020\005\022\021\n\rDECONVOLUTION\020\'\022\013\n\007" - "DROPOUT\020\006\022\016\n\nDUMMY_DATA\020 \022\022\n\016EUCLIDEAN_L" - "OSS\020\007\022\013\n\007ELTWISE\020\031\022\007\n\003EXP\020&\022\013\n\007FLATTEN\020\010" - "\022\r\n\tHDF5_DATA\020\t\022\017\n\013HDF5_OUTPUT\020\n\022\016\n\nHING" - "E_LOSS\020\034\022\n\n\006IM2COL\020\013\022\016\n\nIMAGE_DATA\020\014\022\021\n\r" - "INFOGAIN_LOSS\020\r\022\021\n\rINNER_PRODUCT\020\016\022\007\n\003LR" - "N\020\017\022\017\n\013MEMORY_DATA\020\035\022\035\n\031MULTINOMIAL_LOGI" - "STIC_LOSS\020\020\022\007\n\003MVN\020\"\022\013\n\007POOLING\020\021\022\t\n\005POW" - "ER\020\032\022\010\n\004RELU\020\022\022\013\n\007SIGMOID\020\023\022\036\n\032SIGMOID_C" - "ROSS_ENTROPY_LOSS\020\033\022\013\n\007SILENCE\020$\022\013\n\007SOFT" - "MAX\020\024\022\020\n\014SOFTMAX_LOSS\020\025\022\t\n\005SPLIT\020\026\022\t\n\005SL" - "ICE\020!\022\010\n\004TANH\020\027\022\017\n\013WINDOW_DATA\020\030\022\r\n\tTHRE" - "SHOLD\020\037\"*\n\014DimCheckMode\022\n\n\006STRICT\020\000\022\016\n\nP" - "ERMISSIVE\020\001\"\375\007\n\020V0LayerParameter\022\014\n\004name" - "\030\001 \001(\t\022\014\n\004type\030\002 \001(\t\022\022\n\nnum_output\030\003 \001(\r" - "\022\026\n\010biasterm\030\004 \001(\010:\004true\022-\n\rweight_fille" - "r\030\005 \001(\0132\026.caffe.FillerParameter\022+\n\013bias_" - "filler\030\006 \001(\0132\026.caffe.FillerParameter\022\016\n\003" - "pad\030\007 \001(\r:\0010\022\022\n\nkernelsize\030\010 \001(\r\022\020\n\005grou" - "p\030\t \001(\r:\0011\022\021\n\006stride\030\n \001(\r:\0011\0225\n\004pool\030\013 " - "\001(\0162\".caffe.V0LayerParameter.PoolMethod:" - "\003MAX\022\032\n\rdropout_ratio\030\014 \001(\002:\0030.5\022\025\n\nloca" - "l_size\030\r \001(\r:\0015\022\020\n\005alpha\030\016 \001(\002:\0011\022\022\n\004bet" - "a\030\017 \001(\002:\0040.75\022\014\n\001k\030\026 \001(\002:\0011\022\016\n\006source\030\020 " - "\001(\t\022\020\n\005scale\030\021 \001(\002:\0011\022\020\n\010meanfile\030\022 \001(\t\022" - "\021\n\tbatchsize\030\023 \001(\r\022\023\n\010cropsize\030\024 \001(\r:\0010\022" - "\025\n\006mirror\030\025 \001(\010:\005false\022\037\n\005blobs\0302 \003(\0132\020." - "caffe.BlobProto\022\020\n\010blobs_lr\0303 \003(\002\022\024\n\014wei" - "ght_decay\0304 \003(\002\022\024\n\trand_skip\0305 \001(\r:\0010\022\035\n" - "\020det_fg_threshold\0306 \001(\002:\0030.5\022\035\n\020det_bg_t" - "hreshold\0307 \001(\002:\0030.5\022\035\n\017det_fg_fraction\0308" - " \001(\002:\0040.25\022\032\n\017det_context_pad\030: \001(\r:\0010\022\033" - "\n\rdet_crop_mode\030; \001(\t:\004warp\022\022\n\007new_num\030<" - " \001(\005:\0010\022\027\n\014new_channels\030= \001(\005:\0010\022\025\n\nnew_" - "height\030> \001(\005:\0010\022\024\n\tnew_width\030\? \001(\005:\0010\022\035\n" - "\016shuffle_images\030@ \001(\010:\005false\022\025\n\nconcat_d" - "im\030A \001(\r:\0011\0226\n\021hdf5_output_param\030\351\007 \001(\0132" - "\032.caffe.HDF5OutputParameter\".\n\nPoolMetho" - "d\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002*\034\n\005P" - "hase\022\t\n\005TRAIN\020\000\022\010\n\004TEST\020\001", 11945); + "r\030\006 \001(\010:\005false\022\"\n\023force_encoded_color\030\t " + "\001(\010:\005false\"\033\n\002DB\022\013\n\007LEVELDB\020\000\022\010\n\004LMDB\020\001\"" + ".\n\020DropoutParameter\022\032\n\rdropout_ratio\030\001 \001" + "(\002:\0030.5\"\240\001\n\022DummyDataParameter\022+\n\013data_f" + "iller\030\001 \003(\0132\026.caffe.FillerParameter\022\037\n\005s" + "hape\030\006 \003(\0132\020.caffe.BlobShape\022\013\n\003num\030\002 \003(" + "\r\022\020\n\010channels\030\003 \003(\r\022\016\n\006height\030\004 \003(\r\022\r\n\005w" + "idth\030\005 \003(\r\"\245\001\n\020EltwiseParameter\0229\n\topera" + "tion\030\001 \001(\0162!.caffe.EltwiseParameter.Eltw" + "iseOp:\003SUM\022\r\n\005coeff\030\002 \003(\002\022\036\n\020stable_prod" + "_grad\030\003 \001(\010:\004true\"\'\n\tEltwiseOp\022\010\n\004PROD\020\000" + "\022\007\n\003SUM\020\001\022\007\n\003MAX\020\002\"D\n\014ExpParameter\022\020\n\004ba" + "se\030\001 \001(\002:\002-1\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shift\030" + "\003 \001(\002:\0010\"O\n\021HDF5DataParameter\022\016\n\006source\030" + "\001 \001(\t\022\022\n\nbatch_size\030\002 \001(\r\022\026\n\007shuffle\030\003 \001" + "(\010:\005false\"(\n\023HDF5OutputParameter\022\021\n\tfile" + "_name\030\001 \001(\t\"^\n\022HingeLossParameter\0220\n\004nor" + "m\030\001 \001(\0162\036.caffe.HingeLossParameter.Norm:" + "\002L1\"\026\n\004Norm\022\006\n\002L1\020\001\022\006\n\002L2\020\002\"\224\002\n\022ImageDat" + "aParameter\022\016\n\006source\030\001 \001(\t\022\022\n\nbatch_size" + "\030\004 \001(\r\022\024\n\trand_skip\030\007 \001(\r:\0010\022\026\n\007shuffle\030" + "\010 \001(\010:\005false\022\025\n\nnew_height\030\t \001(\r:\0010\022\024\n\tn" + "ew_width\030\n \001(\r:\0010\022\026\n\010is_color\030\013 \001(\010:\004tru" + "e\022\020\n\005scale\030\002 \001(\002:\0011\022\021\n\tmean_file\030\003 \001(\t\022\024" + "\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010:\005fa" + "lse\022\025\n\013root_folder\030\014 \001(\t:\000\"\'\n\025InfogainLo" + "ssParameter\022\016\n\006source\030\001 \001(\t\"\261\001\n\025InnerPro" + "ductParameter\022\022\n\nnum_output\030\001 \001(\r\022\027\n\tbia" + "s_term\030\002 \001(\010:\004true\022-\n\rweight_filler\030\003 \001(" + "\0132\026.caffe.FillerParameter\022+\n\013bias_filler" + "\030\004 \001(\0132\026.caffe.FillerParameter\022\017\n\004axis\030\005" + " \001(\005:\0011\"\326\001\n\014LRNParameter\022\025\n\nlocal_size\030\001" + " \001(\r:\0015\022\020\n\005alpha\030\002 \001(\002:\0011\022\022\n\004beta\030\003 \001(\002:" + "\0040.75\022D\n\013norm_region\030\004 \001(\0162\036.caffe.LRNPa" + "rameter.NormRegion:\017ACROSS_CHANNELS\022\014\n\001k" + "\030\005 \001(\002:\0011\"5\n\nNormRegion\022\023\n\017ACROSS_CHANNE" + "LS\020\000\022\022\n\016WITHIN_CHANNEL\020\001\"Z\n\023MemoryDataPa" + "rameter\022\022\n\nbatch_size\030\001 \001(\r\022\020\n\010channels\030" + "\002 \001(\r\022\016\n\006height\030\003 \001(\r\022\r\n\005width\030\004 \001(\r\"P\n\014" + "MVNParameter\022 \n\022normalize_variance\030\001 \001(\010" + ":\004true\022\036\n\017across_channels\030\002 \001(\010:\005false\"\242" + "\003\n\020PoolingParameter\0225\n\004pool\030\001 \001(\0162\".caff" + "e.PoolingParameter.PoolMethod:\003MAX\022\016\n\003pa" + "d\030\004 \001(\r:\0010\022\020\n\005pad_h\030\t \001(\r:\0010\022\020\n\005pad_w\030\n " + "\001(\r:\0010\022\023\n\013kernel_size\030\002 \001(\r\022\020\n\010kernel_h\030" + "\005 \001(\r\022\020\n\010kernel_w\030\006 \001(\r\022\021\n\006stride\030\003 \001(\r:" + "\0011\022\020\n\010stride_h\030\007 \001(\r\022\020\n\010stride_w\030\010 \001(\r\0227" + "\n\006engine\030\013 \001(\0162\036.caffe.PoolingParameter." + "Engine:\007DEFAULT\022\035\n\016global_pooling\030\014 \001(\010:" + "\005false\".\n\nPoolMethod\022\007\n\003MAX\020\000\022\007\n\003AVE\020\001\022\016" + "\n\nSTOCHASTIC\020\002\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n" + "\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"F\n\016PowerParameter\022\020\n" + "\005power\030\001 \001(\002:\0011\022\020\n\005scale\030\002 \001(\002:\0011\022\020\n\005shi" + "ft\030\003 \001(\002:\0010\"0\n\017PythonParameter\022\016\n\006module" + "\030\001 \001(\t\022\r\n\005layer\030\002 \001(\t\"\215\001\n\rReLUParameter\022" + "\031\n\016negative_slope\030\001 \001(\002:\0010\0224\n\006engine\030\002 \001" + "(\0162\033.caffe.ReLUParameter.Engine:\007DEFAULT" + "\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CU" + "DNN\020\002\"x\n\020SigmoidParameter\0227\n\006engine\030\001 \001(" + "\0162\036.caffe.SigmoidParameter.Engine:\007DEFAU" + "LT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022\t\n\005CAFFE\020\001\022\t\n\005" + "CUDNN\020\002\"L\n\016SliceParameter\022\017\n\004axis\030\003 \001(\005:" + "\0011\022\023\n\013slice_point\030\002 \003(\r\022\024\n\tslice_dim\030\001 \001" + "(\r:\0011\"\211\001\n\020SoftmaxParameter\0227\n\006engine\030\001 \001" + "(\0162\036.caffe.SoftmaxParameter.Engine:\007DEFA" + "ULT\022\017\n\004axis\030\002 \001(\005:\0011\"+\n\006Engine\022\013\n\007DEFAUL" + "T\020\000\022\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"r\n\rTanHParamet" + "er\0224\n\006engine\030\001 \001(\0162\033.caffe.TanHParameter" + ".Engine:\007DEFAULT\"+\n\006Engine\022\013\n\007DEFAULT\020\000\022" + "\t\n\005CAFFE\020\001\022\t\n\005CUDNN\020\002\"*\n\022ThresholdParame" + "ter\022\024\n\tthreshold\030\001 \001(\002:\0010\"\301\002\n\023WindowData" + "Parameter\022\016\n\006source\030\001 \001(\t\022\020\n\005scale\030\002 \001(\002" + ":\0011\022\021\n\tmean_file\030\003 \001(\t\022\022\n\nbatch_size\030\004 \001" + "(\r\022\024\n\tcrop_size\030\005 \001(\r:\0010\022\025\n\006mirror\030\006 \001(\010" + ":\005false\022\031\n\014fg_threshold\030\007 \001(\002:\0030.5\022\031\n\014bg" + "_threshold\030\010 \001(\002:\0030.5\022\031\n\013fg_fraction\030\t \001" + "(\002:\0040.25\022\026\n\013context_pad\030\n \001(\r:\0010\022\027\n\tcrop" + "_mode\030\013 \001(\t:\004warp\022\033\n\014cache_images\030\014 \001(\010:" + "\005false\022\025\n\013root_folder\030\r \001(\t:\000\"\340\023\n\020V1Laye" + "rParameter\022\016\n\006bottom\030\002 \003(\t\022\013\n\003top\030\003 \003(\t\022" + "\014\n\004name\030\004 \001(\t\022$\n\007include\030 \003(\0132\023.caffe.N" + "etStateRule\022$\n\007exclude\030! \003(\0132\023.caffe.Net" + "StateRule\022/\n\004type\030\005 \001(\0162!.caffe.V1LayerP" + "arameter.LayerType\022\037\n\005blobs\030\006 \003(\0132\020.caff" + "e.BlobProto\022\016\n\005param\030\351\007 \003(\t\022>\n\017blob_shar" + "e_mode\030\352\007 \003(\0162$.caffe.V1LayerParameter.D" + "imCheckMode\022\020\n\010blobs_lr\030\007 \003(\002\022\024\n\014weight_" + "decay\030\010 \003(\002\022\023\n\013loss_weight\030# \003(\002\0220\n\016accu" + "racy_param\030\033 \001(\0132\030.caffe.AccuracyParamet" + "er\022,\n\014argmax_param\030\027 \001(\0132\026.caffe.ArgMaxP" + "arameter\022,\n\014concat_param\030\t \001(\0132\026.caffe.C" + "oncatParameter\022\?\n\026contrastive_loss_param" + "\030( \001(\0132\037.caffe.ContrastiveLossParameter\022" + "6\n\021convolution_param\030\n \001(\0132\033.caffe.Convo" + "lutionParameter\022(\n\ndata_param\030\013 \001(\0132\024.ca" + "ffe.DataParameter\022.\n\rdropout_param\030\014 \001(\013" + "2\027.caffe.DropoutParameter\0223\n\020dummy_data_" + "param\030\032 \001(\0132\031.caffe.DummyDataParameter\022." + "\n\reltwise_param\030\030 \001(\0132\027.caffe.EltwisePar" + "ameter\022&\n\texp_param\030) \001(\0132\023.caffe.ExpPar" + "ameter\0221\n\017hdf5_data_param\030\r \001(\0132\030.caffe." + "HDF5DataParameter\0225\n\021hdf5_output_param\030\016" + " \001(\0132\032.caffe.HDF5OutputParameter\0223\n\020hing" + "e_loss_param\030\035 \001(\0132\031.caffe.HingeLossPara" + "meter\0223\n\020image_data_param\030\017 \001(\0132\031.caffe." + "ImageDataParameter\0229\n\023infogain_loss_para" + "m\030\020 \001(\0132\034.caffe.InfogainLossParameter\0229\n" + "\023inner_product_param\030\021 \001(\0132\034.caffe.Inner" + "ProductParameter\022&\n\tlrn_param\030\022 \001(\0132\023.ca" + "ffe.LRNParameter\0225\n\021memory_data_param\030\026 " + "\001(\0132\032.caffe.MemoryDataParameter\022&\n\tmvn_p" + "aram\030\" \001(\0132\023.caffe.MVNParameter\022.\n\rpooli" + "ng_param\030\023 \001(\0132\027.caffe.PoolingParameter\022" + "*\n\013power_param\030\025 \001(\0132\025.caffe.PowerParame" + "ter\022(\n\nrelu_param\030\036 \001(\0132\024.caffe.ReLUPara" + "meter\022.\n\rsigmoid_param\030& \001(\0132\027.caffe.Sig" + "moidParameter\022.\n\rsoftmax_param\030\' \001(\0132\027.c" + "affe.SoftmaxParameter\022*\n\013slice_param\030\037 \001" + "(\0132\025.caffe.SliceParameter\022(\n\ntanh_param\030" + "% \001(\0132\024.caffe.TanHParameter\0222\n\017threshold" + "_param\030\031 \001(\0132\031.caffe.ThresholdParameter\022" + "5\n\021window_data_param\030\024 \001(\0132\032.caffe.Windo" + "wDataParameter\0227\n\017transform_param\030$ \001(\0132" + "\036.caffe.TransformationParameter\022(\n\nloss_" + "param\030* \001(\0132\024.caffe.LossParameter\022&\n\005lay" + "er\030\001 \001(\0132\027.caffe.V0LayerParameter\"\330\004\n\tLa" + "yerType\022\010\n\004NONE\020\000\022\n\n\006ABSVAL\020#\022\014\n\010ACCURAC" + "Y\020\001\022\n\n\006ARGMAX\020\036\022\010\n\004BNLL\020\002\022\n\n\006CONCAT\020\003\022\024\n" + "\020CONTRASTIVE_LOSS\020%\022\017\n\013CONVOLUTION\020\004\022\010\n\004" + "DATA\020\005\022\021\n\rDECONVOLUTION\020\'\022\013\n\007DROPOUT\020\006\022\016" + "\n\nDUMMY_DATA\020 \022\022\n\016EUCLIDEAN_LOSS\020\007\022\013\n\007EL" + "TWISE\020\031\022\007\n\003EXP\020&\022\013\n\007FLATTEN\020\010\022\r\n\tHDF5_DA" + "TA\020\t\022\017\n\013HDF5_OUTPUT\020\n\022\016\n\nHINGE_LOSS\020\034\022\n\n" + "\006IM2COL\020\013\022\016\n\nIMAGE_DATA\020\014\022\021\n\rINFOGAIN_LO" + "SS\020\r\022\021\n\rINNER_PRODUCT\020\016\022\007\n\003LRN\020\017\022\017\n\013MEMO" + "RY_DATA\020\035\022\035\n\031MULTINOMIAL_LOGISTIC_LOSS\020\020" + "\022\007\n\003MVN\020\"\022\013\n\007POOLING\020\021\022\t\n\005POWER\020\032\022\010\n\004REL" + "U\020\022\022\013\n\007SIGMOID\020\023\022\036\n\032SIGMOID_CROSS_ENTROP" + "Y_LOSS\020\033\022\013\n\007SILENCE\020$\022\013\n\007SOFTMAX\020\024\022\020\n\014SO" + "FTMAX_LOSS\020\025\022\t\n\005SPLIT\020\026\022\t\n\005SLICE\020!\022\010\n\004TA" + "NH\020\027\022\017\n\013WINDOW_DATA\020\030\022\r\n\tTHRESHOLD\020\037\"*\n\014" + "DimCheckMode\022\n\n\006STRICT\020\000\022\016\n\nPERMISSIVE\020\001" + "\"\375\007\n\020V0LayerParameter\022\014\n\004name\030\001 \001(\t\022\014\n\004t" + "ype\030\002 \001(\t\022\022\n\nnum_output\030\003 \001(\r\022\026\n\010biaster" + "m\030\004 \001(\010:\004true\022-\n\rweight_filler\030\005 \001(\0132\026.c" + "affe.FillerParameter\022+\n\013bias_filler\030\006 \001(" + "\0132\026.caffe.FillerParameter\022\016\n\003pad\030\007 \001(\r:\001" + "0\022\022\n\nkernelsize\030\010 \001(\r\022\020\n\005group\030\t \001(\r:\0011\022" + "\021\n\006stride\030\n \001(\r:\0011\0225\n\004pool\030\013 \001(\0162\".caffe" + ".V0LayerParameter.PoolMethod:\003MAX\022\032\n\rdro" + "pout_ratio\030\014 \001(\002:\0030.5\022\025\n\nlocal_size\030\r \001(" + "\r:\0015\022\020\n\005alpha\030\016 \001(\002:\0011\022\022\n\004beta\030\017 \001(\002:\0040." + "75\022\014\n\001k\030\026 \001(\002:\0011\022\016\n\006source\030\020 \001(\t\022\020\n\005scal" + "e\030\021 \001(\002:\0011\022\020\n\010meanfile\030\022 \001(\t\022\021\n\tbatchsiz" + "e\030\023 \001(\r\022\023\n\010cropsize\030\024 \001(\r:\0010\022\025\n\006mirror\030\025" + " \001(\010:\005false\022\037\n\005blobs\0302 \003(\0132\020.caffe.BlobP" + "roto\022\020\n\010blobs_lr\0303 \003(\002\022\024\n\014weight_decay\0304" + " \003(\002\022\024\n\trand_skip\0305 \001(\r:\0010\022\035\n\020det_fg_thr" + "eshold\0306 \001(\002:\0030.5\022\035\n\020det_bg_threshold\0307 " + "\001(\002:\0030.5\022\035\n\017det_fg_fraction\0308 \001(\002:\0040.25\022" + "\032\n\017det_context_pad\030: \001(\r:\0010\022\033\n\rdet_crop_" + "mode\030; \001(\t:\004warp\022\022\n\007new_num\030< \001(\005:\0010\022\027\n\014" + "new_channels\030= \001(\005:\0010\022\025\n\nnew_height\030> \001(" + "\005:\0010\022\024\n\tnew_width\030\? \001(\005:\0010\022\035\n\016shuffle_im" + "ages\030@ \001(\010:\005false\022\025\n\nconcat_dim\030A \001(\r:\0011" + "\0226\n\021hdf5_output_param\030\351\007 \001(\0132\032.caffe.HDF" + "5OutputParameter\".\n\nPoolMethod\022\007\n\003MAX\020\000\022" + "\007\n\003AVE\020\001\022\016\n\nSTOCHASTIC\020\002\"W\n\016PReLUParamet" + "er\022&\n\006filler\030\001 \001(\0132\026.caffe.FillerParamet" + "er\022\035\n\016channel_shared\030\002 \001(\010:\005false*\034\n\005Pha" + "se\022\t\n\005TRAIN\020\000\022\010\n\004TEST\020\001", 12103); ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( "caffe.proto", &protobuf_RegisterTypes); BlobShape::default_instance_ = new BlobShape(); @@ -1725,6 +1754,7 @@ void protobuf_AddDesc_caffe_2eproto() { V0LayerParameter::_default_det_crop_mode_ = new ::std::string("warp", 4); V0LayerParameter::default_instance_ = new V0LayerParameter(); + PReLUParameter::default_instance_ = new PReLUParameter(); BlobShape::default_instance_->InitAsDefaultInstance(); BlobProto::default_instance_->InitAsDefaultInstance(); BlobProtoVector::default_instance_->InitAsDefaultInstance(); @@ -1770,6 +1800,7 @@ void protobuf_AddDesc_caffe_2eproto() { WindowDataParameter::default_instance_->InitAsDefaultInstance(); V1LayerParameter::default_instance_->InitAsDefaultInstance(); V0LayerParameter::default_instance_->InitAsDefaultInstance(); + PReLUParameter::default_instance_->InitAsDefaultInstance(); ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_caffe_2eproto); } @@ -7392,6 +7423,7 @@ const int LayerParameter::kMemoryDataParamFieldNumber; const int LayerParameter::kMvnParamFieldNumber; const int LayerParameter::kPoolingParamFieldNumber; const int LayerParameter::kPowerParamFieldNumber; +const int LayerParameter::kPreluParamFieldNumber; const int LayerParameter::kPythonParamFieldNumber; const int LayerParameter::kReluParamFieldNumber; const int LayerParameter::kSigmoidParamFieldNumber; @@ -7431,6 +7463,7 @@ void LayerParameter::InitAsDefaultInstance() { mvn_param_ = const_cast< ::caffe::MVNParameter*>(&::caffe::MVNParameter::default_instance()); pooling_param_ = const_cast< ::caffe::PoolingParameter*>(&::caffe::PoolingParameter::default_instance()); power_param_ = const_cast< ::caffe::PowerParameter*>(&::caffe::PowerParameter::default_instance()); + prelu_param_ = const_cast< ::caffe::PReLUParameter*>(&::caffe::PReLUParameter::default_instance()); python_param_ = const_cast< ::caffe::PythonParameter*>(&::caffe::PythonParameter::default_instance()); relu_param_ = const_cast< ::caffe::ReLUParameter*>(&::caffe::ReLUParameter::default_instance()); sigmoid_param_ = const_cast< ::caffe::SigmoidParameter*>(&::caffe::SigmoidParameter::default_instance()); @@ -7475,6 +7508,7 @@ void LayerParameter::SharedCtor() { mvn_param_ = NULL; pooling_param_ = NULL; power_param_ = NULL; + prelu_param_ = NULL; python_param_ = NULL; relu_param_ = NULL; sigmoid_param_ = NULL; @@ -7521,6 +7555,7 @@ void LayerParameter::SharedDtor() { delete mvn_param_; delete pooling_param_; delete power_param_; + delete prelu_param_; delete python_param_; delete relu_param_; delete sigmoid_param_; @@ -7643,6 +7678,9 @@ void LayerParameter::Clear() { if (has_power_param()) { if (power_param_ != NULL) power_param_->::caffe::PowerParameter::Clear(); } + if (has_prelu_param()) { + if (prelu_param_ != NULL) prelu_param_->::caffe::PReLUParameter::Clear(); + } if (has_python_param()) { if (python_param_ != NULL) python_param_->::caffe::PythonParameter::Clear(); } @@ -7661,11 +7699,11 @@ void LayerParameter::Clear() { if (has_tanh_param()) { if (tanh_param_ != NULL) tanh_param_->::caffe::TanHParameter::Clear(); } + } + if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { if (has_threshold_param()) { if (threshold_param_ != NULL) threshold_param_->::caffe::ThresholdParameter::Clear(); } - } - if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { if (has_window_data_param()) { if (window_data_param_ != NULL) window_data_param_->::caffe::WindowDataParameter::Clear(); } @@ -8291,6 +8329,20 @@ bool LayerParameter::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } + if (input->ExpectTag(1050)) goto parse_prelu_param; + break; + } + + // optional .caffe.PReLUParameter prelu_param = 131; + case 131: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_prelu_param: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_prelu_param())); + } else { + goto handle_uninterpreted; + } if (input->ExpectAtEnd()) return true; break; } @@ -8571,6 +8623,12 @@ void LayerParameter::SerializeWithCachedSizes( 130, this->python_param(), output); } + // optional .caffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 131, this->prelu_param(), output); + } + if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); @@ -8874,6 +8932,13 @@ ::google::protobuf::uint8* LayerParameter::SerializeWithCachedSizesToArray( 130, this->python_param(), target); } + // optional .caffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 131, this->prelu_param(), target); + } + if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); @@ -9074,6 +9139,13 @@ int LayerParameter::ByteSize() const { this->power_param()); } + // optional .caffe.PReLUParameter prelu_param = 131; + if (has_prelu_param()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->prelu_param()); + } + // optional .caffe.PythonParameter python_param = 130; if (has_python_param()) { total_size += 2 + @@ -9116,6 +9188,8 @@ int LayerParameter::ByteSize() const { this->tanh_param()); } + } + if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { // optional .caffe.ThresholdParameter threshold_param = 128; if (has_threshold_param()) { total_size += 2 + @@ -9123,8 +9197,6 @@ int LayerParameter::ByteSize() const { this->threshold_param()); } - } - if (_has_bits_[40 / 32] & (0xffu << (40 % 32))) { // optional .caffe.WindowDataParameter window_data_param = 129; if (has_window_data_param()) { total_size += 2 + @@ -9305,6 +9377,9 @@ void LayerParameter::MergeFrom(const LayerParameter& from) { if (from.has_power_param()) { mutable_power_param()->::caffe::PowerParameter::MergeFrom(from.power_param()); } + if (from.has_prelu_param()) { + mutable_prelu_param()->::caffe::PReLUParameter::MergeFrom(from.prelu_param()); + } if (from.has_python_param()) { mutable_python_param()->::caffe::PythonParameter::MergeFrom(from.python_param()); } @@ -9323,11 +9398,11 @@ void LayerParameter::MergeFrom(const LayerParameter& from) { if (from.has_tanh_param()) { mutable_tanh_param()->::caffe::TanHParameter::MergeFrom(from.tanh_param()); } + } + if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { if (from.has_threshold_param()) { mutable_threshold_param()->::caffe::ThresholdParameter::MergeFrom(from.threshold_param()); } - } - if (from._has_bits_[40 / 32] & (0xffu << (40 % 32))) { if (from.has_window_data_param()) { mutable_window_data_param()->::caffe::WindowDataParameter::MergeFrom(from.window_data_param()); } @@ -9387,6 +9462,7 @@ void LayerParameter::Swap(LayerParameter* other) { std::swap(mvn_param_, other->mvn_param_); std::swap(pooling_param_, other->pooling_param_); std::swap(power_param_, other->power_param_); + std::swap(prelu_param_, other->prelu_param_); std::swap(python_param_, other->python_param_); std::swap(relu_param_, other->relu_param_); std::swap(sigmoid_param_, other->sigmoid_param_); @@ -13679,6 +13755,7 @@ ::google::protobuf::Metadata ExpParameter::GetMetadata() const { #ifndef _MSC_VER const int HDF5DataParameter::kSourceFieldNumber; const int HDF5DataParameter::kBatchSizeFieldNumber; +const int HDF5DataParameter::kShuffleFieldNumber; #endif // !_MSC_VER HDF5DataParameter::HDF5DataParameter() @@ -13699,6 +13776,7 @@ void HDF5DataParameter::SharedCtor() { _cached_size_ = 0; source_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); batch_size_ = 0u; + shuffle_ = false; ::memset(_has_bits_, 0, sizeof(_has_bits_)); } @@ -13743,6 +13821,7 @@ void HDF5DataParameter::Clear() { } } batch_size_ = 0u; + shuffle_ = false; } ::memset(_has_bits_, 0, sizeof(_has_bits_)); mutable_unknown_fields()->Clear(); @@ -13782,6 +13861,22 @@ bool HDF5DataParameter::MergePartialFromCodedStream( } else { goto handle_uninterpreted; } + if (input->ExpectTag(24)) goto parse_shuffle; + break; + } + + // optional bool shuffle = 3 [default = false]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_shuffle: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &shuffle_))); + set_has_shuffle(); + } else { + goto handle_uninterpreted; + } if (input->ExpectAtEnd()) return true; break; } @@ -13818,6 +13913,11 @@ void HDF5DataParameter::SerializeWithCachedSizes( ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->batch_size(), output); } + // optional bool shuffle = 3 [default = false]; + if (has_shuffle()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->shuffle(), output); + } + if (!unknown_fields().empty()) { ::google::protobuf::internal::WireFormat::SerializeUnknownFields( unknown_fields(), output); @@ -13841,6 +13941,11 @@ ::google::protobuf::uint8* HDF5DataParameter::SerializeWithCachedSizesToArray( target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->batch_size(), target); } + // optional bool shuffle = 3 [default = false]; + if (has_shuffle()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->shuffle(), target); + } + if (!unknown_fields().empty()) { target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( unknown_fields(), target); @@ -13866,6 +13971,11 @@ int HDF5DataParameter::ByteSize() const { this->batch_size()); } + // optional bool shuffle = 3 [default = false]; + if (has_shuffle()) { + total_size += 1 + 1; + } + } if (!unknown_fields().empty()) { total_size += @@ -13899,6 +14009,9 @@ void HDF5DataParameter::MergeFrom(const HDF5DataParameter& from) { if (from.has_batch_size()) { set_batch_size(from.batch_size()); } + if (from.has_shuffle()) { + set_shuffle(from.shuffle()); + } } mutable_unknown_fields()->MergeFrom(from.unknown_fields()); } @@ -13924,6 +14037,7 @@ void HDF5DataParameter::Swap(HDF5DataParameter* other) { if (other != this) { std::swap(source_, other->source_); std::swap(batch_size_, other->batch_size_); + std::swap(shuffle_, other->shuffle_); std::swap(_has_bits_[0], other->_has_bits_[0]); _unknown_fields_.Swap(&other->_unknown_fields_); std::swap(_cached_size_, other->_cached_size_); @@ -24311,6 +24425,257 @@ ::google::protobuf::Metadata V0LayerParameter::GetMetadata() const { } +// =================================================================== + +#ifndef _MSC_VER +const int PReLUParameter::kFillerFieldNumber; +const int PReLUParameter::kChannelSharedFieldNumber; +#endif // !_MSC_VER + +PReLUParameter::PReLUParameter() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void PReLUParameter::InitAsDefaultInstance() { + filler_ = const_cast< ::caffe::FillerParameter*>(&::caffe::FillerParameter::default_instance()); +} + +PReLUParameter::PReLUParameter(const PReLUParameter& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void PReLUParameter::SharedCtor() { + _cached_size_ = 0; + filler_ = NULL; + channel_shared_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PReLUParameter::~PReLUParameter() { + SharedDtor(); +} + +void PReLUParameter::SharedDtor() { + if (this != default_instance_) { + delete filler_; + } +} + +void PReLUParameter::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PReLUParameter::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PReLUParameter_descriptor_; +} + +const PReLUParameter& PReLUParameter::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_caffe_2eproto(); + return *default_instance_; +} + +PReLUParameter* PReLUParameter::default_instance_ = NULL; + +PReLUParameter* PReLUParameter::New() const { + return new PReLUParameter; +} + +void PReLUParameter::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (has_filler()) { + if (filler_ != NULL) filler_->::caffe::FillerParameter::Clear(); + } + channel_shared_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PReLUParameter::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!(EXPRESSION)) return false + ::google::protobuf::uint32 tag; + while ((tag = input->ReadTag()) != 0) { + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .caffe.FillerParameter filler = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_filler())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_channel_shared; + break; + } + + // optional bool channel_shared = 2 [default = false]; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_channel_shared: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &channel_shared_))); + set_has_channel_shared(); + } else { + goto handle_uninterpreted; + } + if (input->ExpectAtEnd()) return true; + break; + } + + default: { + handle_uninterpreted: + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + return true; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } + return true; +#undef DO_ +} + +void PReLUParameter::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // optional .caffe.FillerParameter filler = 1; + if (has_filler()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->filler(), output); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->channel_shared(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* PReLUParameter::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // optional .caffe.FillerParameter filler = 1; + if (has_filler()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->filler(), target); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->channel_shared(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int PReLUParameter::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .caffe.FillerParameter filler = 1; + if (has_filler()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->filler()); + } + + // optional bool channel_shared = 2 [default = false]; + if (has_channel_shared()) { + total_size += 1 + 1; + } + + } + if (!unknown_fields().empty()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void PReLUParameter::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PReLUParameter* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PReLUParameter::MergeFrom(const PReLUParameter& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_filler()) { + mutable_filler()->::caffe::FillerParameter::MergeFrom(from.filler()); + } + if (from.has_channel_shared()) { + set_channel_shared(from.channel_shared()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PReLUParameter::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PReLUParameter::CopyFrom(const PReLUParameter& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PReLUParameter::IsInitialized() const { + + return true; +} + +void PReLUParameter::Swap(PReLUParameter* other) { + if (other != this) { + std::swap(filler_, other->filler_); + std::swap(channel_shared_, other->channel_shared_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _unknown_fields_.Swap(&other->_unknown_fields_); + std::swap(_cached_size_, other->_cached_size_); + } +} + +::google::protobuf::Metadata PReLUParameter::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PReLUParameter_descriptor_; + metadata.reflection = PReLUParameter_reflection_; + return metadata; +} + + // @@protoc_insertion_point(namespace_scope) } // namespace caffe diff --git a/src/caffe/util/benchmark.cpp b/src/caffe/util/benchmark.cpp index 1d269c351c1..8f36ce7a23c 100644 --- a/src/caffe/util/benchmark.cpp +++ b/src/caffe/util/benchmark.cpp @@ -1,5 +1,3 @@ -#include - #include "caffe/common.hpp" #include "caffe/util/benchmark.hpp" @@ -32,7 +30,7 @@ void Timer::Start() { NO_GPU; #endif } else { - start_cpu_ = boost::posix_time::microsec_clock::local_time(); + start_cpu_ = clock::now(); } running_ = true; has_run_at_least_once_ = true; @@ -49,7 +47,7 @@ void Timer::Stop() { NO_GPU; #endif } else { - stop_cpu_ = boost::posix_time::microsec_clock::local_time(); + stop_cpu_ = clock::now(); } running_ = false; } @@ -74,7 +72,8 @@ float Timer::MicroSeconds() { NO_GPU; #endif } else { - elapsed_microseconds_ = (stop_cpu_ - start_cpu_).total_microseconds(); + elapsed_microseconds_ = std::chrono::duration_cast + (stop_cpu_ - start_cpu_).count(); } return elapsed_microseconds_; } @@ -95,7 +94,8 @@ float Timer::MilliSeconds() { NO_GPU; #endif } else { - elapsed_milliseconds_ = (stop_cpu_ - start_cpu_).total_milliseconds(); + elapsed_milliseconds_ = std::chrono::duration_cast + (stop_cpu_ - start_cpu_).count(); } return elapsed_milliseconds_; } @@ -126,7 +126,7 @@ CPUTimer::CPUTimer() { void CPUTimer::Start() { if (!running()) { - this->start_cpu_ = boost::posix_time::microsec_clock::local_time(); + this->start_cpu_ = clock::now(); this->running_ = true; this->has_run_at_least_once_ = true; } @@ -134,7 +134,7 @@ void CPUTimer::Start() { void CPUTimer::Stop() { if (running()) { - this->stop_cpu_ = boost::posix_time::microsec_clock::local_time(); + this->stop_cpu_ = clock::now(); this->running_ = false; } } @@ -147,8 +147,8 @@ float CPUTimer::MilliSeconds() { if (running()) { Stop(); } - this->elapsed_milliseconds_ = (this->stop_cpu_ - - this->start_cpu_).total_milliseconds(); + this->elapsed_milliseconds_ = std::chrono::duration_cast + (stop_cpu_ - start_cpu_).count(); return this->elapsed_milliseconds_; } @@ -160,8 +160,8 @@ float CPUTimer::MicroSeconds() { if (running()) { Stop(); } - this->elapsed_microseconds_ = (this->stop_cpu_ - - this->start_cpu_).total_microseconds(); + this->elapsed_microseconds_ = std::chrono::duration_cast + (stop_cpu_ - start_cpu_).count(); return this->elapsed_microseconds_; } diff --git a/src/caffe/util/math_functions.cpp b/src/caffe/util/math_functions.cpp index 13e17be582b..7f56617cf72 100644 --- a/src/caffe/util/math_functions.cpp +++ b/src/caffe/util/math_functions.cpp @@ -1,7 +1,5 @@ -#include -#include - #include +#include #include "caffe/common.hpp" #include "caffe/util/math_functions.hpp" @@ -222,8 +220,11 @@ unsigned int caffe_rng_rand() { template Dtype caffe_nextafter(const Dtype b) { - return boost::math::nextafter( - b, std::numeric_limits::max()); +#ifdef __ANDROID__ + return nextafter(b, std::numeric_limits::max()); +#else + return std::nextafter(b, std::numeric_limits::max()); +#endif } template @@ -237,9 +238,10 @@ void caffe_rng_uniform(const int n, const Dtype a, const Dtype b, Dtype* r) { CHECK_GE(n, 0); CHECK(r); CHECK_LE(a, b); - boost::uniform_real random_distribution(a, caffe_nextafter(b)); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::uniform_real_distribution<> + random_distribution(a, caffe_nextafter(b)); + std::function + variate_generator = bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = variate_generator(); } @@ -259,9 +261,9 @@ void caffe_rng_gaussian(const int n, const Dtype a, CHECK_GE(n, 0); CHECK(r); CHECK_GT(sigma, 0); - boost::normal_distribution random_distribution(a, sigma); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::normal_distribution<> random_distribution(a, sigma); + std::function + variate_generator= bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = variate_generator(); } @@ -281,9 +283,9 @@ void caffe_rng_bernoulli(const int n, const Dtype p, int* r) { CHECK(r); CHECK_GE(p, 0); CHECK_LE(p, 1); - boost::bernoulli_distribution random_distribution(p); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::bernoulli_distribution random_distribution(p); + std::function + variate_generator = bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = variate_generator(); } @@ -301,9 +303,9 @@ void caffe_rng_bernoulli(const int n, const Dtype p, unsigned int* r) { CHECK(r); CHECK_GE(p, 0); CHECK_LE(p, 1); - boost::bernoulli_distribution random_distribution(p); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::bernoulli_distribution random_distribution(p); + std::function + variate_generator = bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = static_cast(variate_generator()); } diff --git a/src/caffe/util/math_functions_eigen.cpp b/src/caffe/util/math_functions_eigen.cpp index 9cccea9c2e8..5e63c51f779 100644 --- a/src/caffe/util/math_functions_eigen.cpp +++ b/src/caffe/util/math_functions_eigen.cpp @@ -1,7 +1,5 @@ -#include -#include - #include +#include #include "caffe/common.hpp" #include "caffe/util/math_functions.hpp" @@ -288,8 +286,11 @@ unsigned int caffe_rng_rand() { template Dtype caffe_nextafter(const Dtype b) { - return boost::math::nextafter( - b, std::numeric_limits::max()); +#ifdef __ANDROID__ + return nextafter(b, std::numeric_limits::max()); +#else + return std::nextafter(b, std::numeric_limits::max()); +#endif } template @@ -303,9 +304,10 @@ void caffe_rng_uniform(const int n, const Dtype a, const Dtype b, Dtype* r) { CHECK_GE(n, 0); CHECK(r); CHECK_LE(a, b); - boost::uniform_real random_distribution(a, caffe_nextafter(b)); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::uniform_real_distribution<> + random_distribution(a, caffe_nextafter(b)); + std::function + variate_generator = bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = variate_generator(); } @@ -325,9 +327,9 @@ void caffe_rng_gaussian(const int n, const Dtype a, CHECK_GE(n, 0); CHECK(r); CHECK_GT(sigma, 0); - boost::normal_distribution random_distribution(a, sigma); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::normal_distribution<> random_distribution(a, sigma); + std::function + variate_generator= bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = variate_generator(); } @@ -347,9 +349,9 @@ void caffe_rng_bernoulli(const int n, const Dtype p, int* r) { CHECK(r); CHECK_GE(p, 0); CHECK_LE(p, 1); - boost::bernoulli_distribution random_distribution(p); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::bernoulli_distribution random_distribution(p); + std::function + variate_generator = bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = variate_generator(); } @@ -367,9 +369,9 @@ void caffe_rng_bernoulli(const int n, const Dtype p, unsigned int* r) { CHECK(r); CHECK_GE(p, 0); CHECK_LE(p, 1); - boost::bernoulli_distribution random_distribution(p); - boost::variate_generator > - variate_generator(caffe_rng(), random_distribution); + std::bernoulli_distribution random_distribution(p); + std::function + variate_generator = bind(random_distribution, std::ref(*caffe_rng())); for (int i = 0; i < n; ++i) { r[i] = static_cast(variate_generator()); }