X-Git-Url: https://git.ti.com/gitweb?p=jacinto-ai%2Fcaffe-jacinto.git;a=blobdiff_plain;f=src%2Fcaffe%2Fvision_layers.hpp;h=29d2eb363837f0c5bab4bc80dad159fee58bdb96;hp=66eeda04ad5b63f7605e22ad94a1787241b01f8f;hb=45cbe8e3177abfd22b6590a1bf3eeef55960457d;hpb=6bd78d59f22bef0ac15a714f31f215694318decd diff --git a/src/caffe/vision_layers.hpp b/src/caffe/vision_layers.hpp index 66eeda04..29d2eb36 100644 --- a/src/caffe/vision_layers.hpp +++ b/src/caffe/vision_layers.hpp @@ -301,6 +301,29 @@ class MultinomialLogisticLossLayer : public Layer { // const bool propagate_down, vector*>* bottom); }; +template +class EuclideanLossLayer : public Layer { + public: + explicit EuclideanLossLayer(const LayerParameter& param) + : Layer(param), difference_() {} + virtual void SetUp(const vector*>& bottom, + vector*>* top); + + protected: + // The loss layer will do nothing during forward - all computation are + // carried out in the backward pass. + virtual void Forward_cpu(const vector*>& bottom, + vector*>* top) { return; } + virtual void Forward_gpu(const vector*>& bottom, + vector*>* top) { return; } + virtual Dtype Backward_cpu(const vector*>& top, + const bool propagate_down, vector*>* bottom); + // virtual Dtype Backward_gpu(const vector*>& top, + // const bool propagate_down, vector*>* bottom); + Blob difference_; +}; + + } // namespace caffe #endif // CAFFE_VISION_LAYERS_HPP_