1 #ifndef CAFFE_EUCLIDEAN_LOSS_LAYER_HPP_
2 #define CAFFE_EUCLIDEAN_LOSS_LAYER_HPP_
6 #include "caffe/blob.hpp"
7 #include "caffe/layer.hpp"
8 #include "caffe/proto/caffe.pb.h"
10 #include "caffe/layers/loss_layer.hpp"
40 template <
typename Dtype>
48 virtual inline const char*
type()
const {
return "EuclideanLoss"; }
98 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
100 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom);
107 #endif // CAFFE_EUCLIDEAN_LOSS_LAYER_HPP_
virtual void Backward_gpu(const vector< Blob< Dtype > * > &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > * > &bottom)
Using the GPU device, compute the gradients for any parameters and for the bottom blobs if propagate_...
virtual void Backward_cpu(const vector< Blob< Dtype > * > &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > * > &bottom)
Computes the Euclidean error gradient w.r.t. the inputs.
Definition: euclidean_loss_layer.cpp:32
virtual const char * type() const
Returns the layer type.
Definition: euclidean_loss_layer.hpp:48
virtual void Forward_cpu(const vector< Blob< Dtype > * > &bottom, const vector< Blob< Dtype > * > &top)
Computes the Euclidean (L2) loss for real-valued regression tasks.
Definition: euclidean_loss_layer.cpp:18
Computes the Euclidean (L2) loss for real-valued regression tasks.
Definition: euclidean_loss_layer.hpp:41
virtual void Forward_gpu(const vector< Blob< Dtype > * > &bottom, const vector< Blob< Dtype > * > &top)
Using the GPU device, compute the layer output. Fall back to Forward_cpu() if unavailable.
virtual void Reshape(const vector< Blob< Dtype > * > &bottom, const vector< Blob< Dtype > * > &top)
Adjust the shapes of top blobs and internal buffers to accommodate the shapes of the bottom blobs.
Definition: euclidean_loss_layer.cpp:9
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers,...
Definition: blob.hpp:24
An interface for Layers that take two Blobs as input – usually (1) predictions and (2) ground-truth l...
Definition: loss_layer.hpp:23
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
virtual bool AllowForceBackward(const int bottom_index) const
Definition: euclidean_loss_layer.hpp:53