Merge pull request #1654 from longjon/softmax-missing-values
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Fri, 30 Jan 2015 04:52:16 +0000 (20:52 -0800)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Fri, 30 Jan 2015 04:52:16 +0000 (20:52 -0800)
Add missing value support to SoftmaxLossLayer

1  2 
include/caffe/loss_layers.hpp
src/caffe/layers/softmax_loss_layer.cpp
src/caffe/proto/caffe.proto

@@@ -696,8 -696,17 +696,16 @@@ template <typename Dtype> class Softmax
  template <typename Dtype>
  class SoftmaxWithLossLayer : public LossLayer<Dtype> {
   public:
+    /**
+     * @param param provides LossParameter loss_param, with options:
+     *  - ignore_label (optional)
+     *    Specify a label value that should be ignored when computing the loss.
+     *  - normalize (optional, default true)
+     *    If true, the loss is normalized by the number of (nonignored) labels
+     *    present; otherwise the loss is simply summed over spatial locations.
+     */
    explicit SoftmaxWithLossLayer(const LayerParameter& param)
 -      : LossLayer<Dtype>(param),
 -        softmax_layer_(new SoftmaxLayer<Dtype>(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,
Simple merge