multinomial_logistic_loss_layer.hpp
#ifndef CAFFE_MULTINOMIAL_LOGISTIC_LOSS_LAYER_HPP_
#define CAFFE_MULTINOMIAL_LOGISTIC_LOSS_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/layers/loss_layer.hpp"
namespace caffe {
template <typename Dtype>
class MultinomialLogisticLossLayer : public LossLayer<Dtype> {
public:
explicit MultinomialLogisticLossLayer(const LayerParameter& param)
: LossLayer<Dtype>(param) {}
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "MultinomialLogisticLoss"; }
protected:
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
};
} // namespace caffe
#endif // CAFFE_MULTINOMIAL_LOGISTIC_LOSS_LAYER_HPP_
caffe::MultinomialLogisticLossLayer::Reshape
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: multinomial_logistic_loss_layer.cpp:11
caffe::MultinomialLogisticLossLayer
Computes the multinomial logistic loss for a one-of-many classification task, directly taking a predi...
Definition: multinomial_logistic_loss_layer.hpp:44
caffe::Blob
A wrapper around SyncedMemory holders serving as the basic computational unit through which Layers,...
Definition: blob.hpp:24
caffe::LossLayer
An interface for Layers that take two Blobs as input – usually (1) predictions and (2) ground-truth l...
Definition: loss_layer.hpp:23
caffe::MultinomialLogisticLossLayer::Backward_cpu
virtual void Backward_cpu(const vector< Blob< Dtype > * > &top, const vector< bool > &propagate_down, const vector< Blob< Dtype > * > &bottom)
Computes the multinomial logistic loss error gradient w.r.t. the predictions.
Definition: multinomial_logistic_loss_layer.cpp:37
caffe::MultinomialLogisticLossLayer::Forward_cpu
virtual void Forward_cpu(const vector< Blob< Dtype > * > &bottom, const vector< Blob< Dtype > * > &top)
Computes the multinomial logistic loss for a one-of-many classification task, directly taking a predi...
Definition: multinomial_logistic_loss_layer.cpp:20
caffe::MultinomialLogisticLossLayer::type
virtual const char * type() const
Returns the layer type.
Definition: multinomial_logistic_loss_layer.hpp:51
caffe
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14