singa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r1708908 - /incubator/singa/site/trunk/content/markdown/docs/
Date Fri, 16 Oct 2015 05:26:33 GMT
Author: wangwei
Date: Fri Oct 16 05:26:33 2015
New Revision: 1708908

add docs for output prediction results (i.e., labels)


Modified: incubator/singa/site/trunk/content/markdown/docs/
--- incubator/singa/site/trunk/content/markdown/docs/ (original)
+++ incubator/singa/site/trunk/content/markdown/docs/ 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
 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*
+## 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
+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.

View raw message