Documented ArgMax layer in vision_layers.hpp
authorSergey Karayev <sergeykarayev@gmail.com>
Wed, 21 May 2014 04:32:07 +0000 (21:32 -0700)
committerSergey Karayev <sergeykarayev@gmail.com>
Wed, 21 May 2014 04:32:07 +0000 (21:32 -0700)
include/caffe/vision_layers.hpp

index 21e3fd0..29daf09 100644 (file)
 
 namespace caffe {
 
-/*
-ConcatLayer
-  Takes at least two blobs and concatenates them along either num or
-  channel dim, outputting the result.
+/* ArgmaxLayer
+  Compute the index of the max value across all (channels x height x width).
+  [In the future, can take specific dimension.]
+  Intended for use after a classification layer to produce prediction.
+  If parameter out_max_val is set to true, then output is a vector of pairs
+  (max_ind, max_val) for each image.
+
+  NOTE: does not implement Backwards operation.
 */
 template <typename Dtype>
 class ArgMaxLayer : public Layer<Dtype> {
@@ -33,7 +37,6 @@ class ArgMaxLayer : public Layer<Dtype> {
  protected:
   virtual Dtype Forward_cpu(const vector<Blob<Dtype>*>& bottom,
       vector<Blob<Dtype>*>* top);
-  // For now ArgMax layer should not be used to compute backward operations.
   virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
       const bool propagate_down, vector<Blob<Dtype>*>* bottom) {
     NOT_IMPLEMENTED;
@@ -41,6 +44,10 @@ class ArgMaxLayer : public Layer<Dtype> {
   bool out_max_val_;
 };
 
+/* ConcatLayer
+  Takes at least two blobs and concatenates them along either num or
+  channel dim, outputting the result.
+*/
 template <typename Dtype>
 class ConcatLayer : public Layer<Dtype> {
  public:
@@ -126,6 +133,8 @@ class EltwiseProductLayer : public Layer<Dtype> {
       const bool propagate_down, vector<Blob<Dtype>*>* bottom);
 };
 
+/* FlattenLayer
+*/
 template <typename Dtype>
 class FlattenLayer : public Layer<Dtype> {
  public:
@@ -308,6 +317,8 @@ class MemoryDataLayer : public Layer<Dtype> {
   int pos_;
 };
 
+/* PoolingLayer
+*/
 template <typename Dtype>
 class PoolingLayer : public Layer<Dtype> {
  public: