1 #ifndef CAFFE_ACCURACY_LAYER_HPP_ 2 #define CAFFE_ACCURACY_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" 18 template <
typename Dtype>
30 :
Layer<Dtype>(param) {}
36 virtual inline const char*
type()
const {
return "Accuracy"; }
75 const vector<bool>& propagate_down,
const vector<
Blob<Dtype>*>& bottom) {
76 for (
int i = 0; i < propagate_down.size(); ++i) {
77 if (propagate_down[i]) { NOT_IMPLEMENTED; }
81 int label_axis_, outer_num_, inner_num_;
95 #endif // CAFFE_ACCURACY_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 int ExactNumBottomBlobs() const
Returns the exact number of bottom blobs required by the layer, or -1 if no exact number is required...
Definition: accuracy_layer.hpp:37
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: accuracy_layer.cpp:11
int ignore_label_
The label indicating that an instance should be ignored.
Definition: accuracy_layer.hpp:88
virtual void Forward_cpu(const vector< Blob< Dtype > *> &bottom, const vector< Blob< Dtype > *> &top)
Definition: accuracy_layer.cpp:48
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: accuracy_layer.cpp:23
Computes the classification accuracy for a one-of-many classification task.
Definition: accuracy_layer.hpp:19
virtual int MaxTopBlobs() const
Returns the maximum number of top blobs required by the layer, or -1 if no maximum number is required...
Definition: accuracy_layer.hpp:42
bool has_ignore_label_
Whether to ignore instances with a certain label.
Definition: accuracy_layer.hpp:86
virtual int MinTopBlobs() const
Returns the minimum number of top blobs required by the layer, or -1 if no minimum number is required...
Definition: accuracy_layer.hpp:41
AccuracyLayer(const LayerParameter ¶m)
Definition: accuracy_layer.hpp:29
virtual const char * type() const
Returns the layer type.
Definition: accuracy_layer.hpp:36
Blob< Dtype > nums_buffer_
Keeps counts of the number of samples per class.
Definition: accuracy_layer.hpp:90
virtual void Backward_cpu(const vector< Blob< Dtype > *> &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > *> &bottom)
Not implemented – AccuracyLayer cannot be used as a loss.
Definition: accuracy_layer.hpp:74
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers...
Definition: blob.hpp:24