text: #ifndef CAFFE_ENTROPY_LOSS_LAYER_HPP_
  #define CAFFE_ENTROPY_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 EntropyLossLayer : public LossLayer<Dtype> {
   public:
    explicit EntropyLossLayer(const LayerParameter& param)
        : LossLayer<Dtype>(param) {}
    virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
        const vector<Blob<Dtype>*>& top);
    virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
        const vector<Blob<Dtype>*>& top);
  
    virtual inline const char* type() const { return "EntropyLoss"; }
    virtual inline int ExactNumBottomBlobs() const { return -1; }
    virtual inline int ExactNumTopBlobs() const { return -1; }
    virtual inline int MinTopBlobs() const { return 1; }
    virtual inline int MaxTopBlobs() const { return 2; }
  
   protected:
    virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
        const vector<Blob<Dtype>*>& top);
    virtual void Forward_gpu(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);
    virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
        const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
  
    int label_num_;
    int data_num_;
    float threshold_;
    float loss_weight_;
    int iterations_num_;
    int now_iteration_;
    int ignore_label_;
    Blob<Dtype> normalized_bottom_data_;
  };
  
  }
  
  #endif
  