From: Sergio Date: Tue, 27 May 2014 17:54:21 +0000 (-0700) Subject: Added Threshold layer to neuron_layers.hpp X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27d53249d1479c62548ba95d0ed3929ed0cfb57e;p=platform%2Fupstream%2Fcaffe.git Added Threshold layer to neuron_layers.hpp --- diff --git a/include/caffe/neuron_layers.hpp b/include/caffe/neuron_layers.hpp index 4e67a29..85d5a16 100644 --- a/include/caffe/neuron_layers.hpp +++ b/include/caffe/neuron_layers.hpp @@ -202,6 +202,34 @@ class TanHLayer : public NeuronLayer { const bool propagate_down, vector*>* bottom); }; +/* ThresholdLayer + Outputs 1 if value in input is above threshold, 0 otherwise. + The defult threshold = 0, which means positive values would become 1 and + negative or 0, would become 0 + + y = 1 if x > threshold + y = 0 if x <= threshold + y' = don't have +*/ +template +class ThresholdLayer : public NeuronLayer { + public: + explicit DropoutLayer(const LayerParameter& param) + : NeuronLayer(param) {} + virtual void SetUp(const vector*>& bottom, + vector*>* top); + + protected: + virtual Dtype Forward_cpu(const vector*>& bottom, + vector*>* top); + virtual void Backward_cpu(const vector*>& top, + const bool propagate_down, vector*>* bottom) { + NOT_IMPLEMENTED; + } + + Dtype threshold_; +}; + } // namespace caffe #endif // CAFFE_NEURON_LAYERS_HPP_