Return-Path: X-Original-To: apmail-singa-commits-archive@minotaur.apache.org Delivered-To: apmail-singa-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 56D7E1018C for ; Fri, 16 Oct 2015 05:26:43 +0000 (UTC) Received: (qmail 73745 invoked by uid 500); 16 Oct 2015 05:26:43 -0000 Delivered-To: apmail-singa-commits-archive@singa.apache.org Received: (qmail 73726 invoked by uid 500); 16 Oct 2015 05:26:43 -0000 Mailing-List: contact commits-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list commits@singa.incubator.apache.org Received: (qmail 73717 invoked by uid 99); 16 Oct 2015 05:26:43 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Oct 2015 05:26:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7EE8C1A2B0B for ; Fri, 16 Oct 2015 05:26:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.991 X-Spam-Level: X-Spam-Status: No, score=0.991 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id oXhvT9Ko8mjc for ; Fri, 16 Oct 2015 05:26:35 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 2F10620925 for ; Fri, 16 Oct 2015 05:26:35 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 37417E04BD for ; Fri, 16 Oct 2015 05:26:34 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 9BDD43A0418 for ; Fri, 16 Oct 2015 05:26:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1708908 - /incubator/singa/site/trunk/content/markdown/docs/test.md Date: Fri, 16 Oct 2015 05:26:33 -0000 To: commits@singa.incubator.apache.org From: wangwei@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151016052633.9BDD43A0418@svn01-us-west.apache.org> 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.