1 #ifndef CAFFE_LOSS_LAYER_HPP_ 2 #define CAFFE_LOSS_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 12 const float kLOG_THRESHOLD = 1e-20;
22 template <
typename Dtype>
25 explicit LossLayer(
const LayerParameter& param)
47 return bottom_index != 1;
53 #endif // CAFFE_LOSS_LAYER_HPP_ An interface for the units of computation which can be composed into a Net.
Definition: layer.hpp:33
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
virtual bool AutoTopBlobs() const
For convenience and backwards compatibility, instruct the Net to automatically allocate a single top ...
Definition: loss_layer.hpp:40
virtual bool AllowForceBackward(const int bottom_index) const
Definition: loss_layer.hpp:46
virtual int ExactNumBottomBlobs() const
Returns the exact number of bottom blobs required by the layer, or -1 if no exact number is required...
Definition: loss_layer.hpp:32
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: loss_layer.cpp:17
An interface for Layers that take two Blobs as input – usually (1) predictions and (2) ground-truth ...
Definition: loss_layer.hpp:23
virtual void LayerSetUp(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Does layer-specific setup: your layer should implement this function as well as Reshape.
Definition: loss_layer.cpp:8
virtual int ExactNumTopBlobs() const
Returns the exact number of top blobs required by the layer, or -1 if no exact number is required...
Definition: loss_layer.hpp:41
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24