Author: wangwei
Date: Fri Oct 16 05:26:33 2015
New Revision: 1708908

URL: http://svn.apache.org/viewvc?rev=1708908&view=rev
Log:
add docs for output prediction results (i.e., labels)

Modified:
    incubator/singa/site/trunk/content/markdown/docs/test.md

Modified: incubator/singa/site/trunk/content/markdown/docs/test.md
URL: 
http://svn.apache.org/viewvc/incubator/singa/site/trunk/content/markdown/docs/test.md?rev=1708908&r1=1708907&r2=1708908&view=diff
==============================================================================
--- incubator/singa/site/trunk/content/markdown/docs/test.md (original)
+++ incubator/singa/site/trunk/content/markdown/docs/test.md Fri Oct 16 
05:26:33 2015
@@ -6,7 +6,7 @@ Once SINGA finishes the training of a mo
 into disk files under the [checkpoint folder](checkpoint.html). Model 
parameters can also be dumped
 into this folder periodically during training if the
 [checkpoint configuration[(checkpoint.html) fields are set. With the checkpoint
-files, we can load the model parameters to conduct performance test or feature 
extraction
+files, we can load the model parameters to conduct performance test, feature 
extraction and prediction
 against new data.
 
 To load the model parameters from checkpoint files, we need to add the paths of
@@ -78,5 +78,42 @@ we replace the `SoftmaxLossLayer` with a
 
 The input layer and test steps, and the running command are the same as in 
*Performance Test* section.
 
+## Label Prediction
+
 If the output layer is connected to a layer that predicts labels of images,
 the output layer would then write the prediction results into files.
+SINGA provides two built-in layers for generating prediction results, namely,
+
+* SoftmaxLayer, generates probabilities of each candidate labels.
+* ArgSortLayer, sorts labels according to probabilities in descending order 
and keep topk labels.
+
+By connecting the two layers with the previous layer and the output layer, we 
can
+extract the predictions of each instance. For example,
+
+    layer {
+      name: "feature"
+      ...
+    }
+    layer {
+      name: "softmax"
+      type: kSoftmax
+      srclayers: "feature"
+    }
+    layer {
+      name: "prediction"
+      type: kArgSort
+      srclayers: "softmax"
+      argsort_conf {
+        topk: 5
+      }
+    }
+    layer {
+      name: "output"
+      type: kCSVOutput
+      srclayers: "prediction"
+      store_conf {}
+    }
+
+The top-5 labels of each instance will be written as one line of the output 
CSV file.
+Currently, above layers cannot co-exist with the loss layers used for training.
+Please comment out the loss layers for extracting prediction results.


Reply via email to