Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7EF28200CDF for ; Thu, 17 Aug 2017 22:16:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7D13316BADB; Thu, 17 Aug 2017 20:16:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C324416BAD8 for ; Thu, 17 Aug 2017 22:16:03 +0200 (CEST) Received: (qmail 46630 invoked by uid 500); 17 Aug 2017 20:16:02 -0000 Mailing-List: contact issues-help@systemml.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.apache.org Delivered-To: mailing list issues@systemml.apache.org Received: (qmail 46621 invoked by uid 99); 17 Aug 2017 20:16:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2017 20:16:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3CFF5C1446 for ; Thu, 17 Aug 2017 20:16:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xwwyGKuw1MP8 for ; Thu, 17 Aug 2017 20:16:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EABDB5F1B3 for ; Thu, 17 Aug 2017 20:16:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5EB89E023B for ; Thu, 17 Aug 2017 20:16:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0DFD721409 for ; Thu, 17 Aug 2017 20:16:00 +0000 (UTC) Date: Thu, 17 Aug 2017 20:16:00 +0000 (UTC) From: "Deron Eriksson (JIRA)" To: issues@systemml.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SYSTEMML-1849) Can't obtain scores from l2-svm-predict.dml using JMLC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 17 Aug 2017 20:16:04 -0000 [ https://issues.apache.org/jira/browse/SYSTEMML-1849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16131223#comment-16131223 ] Deron Eriksson commented on SYSTEMML-1849: ------------------------------------------ cc [~mboehm7] > Can't obtain scores from l2-svm-predict.dml using JMLC > ------------------------------------------------------ > > Key: SYSTEMML-1849 > URL: https://issues.apache.org/jira/browse/SYSTEMML-1849 > Project: SystemML > Issue Type: Bug > Components: Compiler, Runtime > Reporter: Deron Eriksson > > Attempting to obtain the {{scores}} variable in {{l2-svm-predict.dml}} using JMLC gives: > {code} > Exception in thread "main" org.apache.sysml.api.DMLException: Non-existent output variable: scores > at org.apache.sysml.api.jmlc.ResultVariables.getMatrixBlock(ResultVariables.java:88) > at org.apache.sysml.api.jmlc.ResultVariables.getMatrix(ResultVariables.java:74) > {code} > This appears to be introduced by https://github.com/apache/systemml/commit/4b81d0dda6583f0ae96eaa7aa5832005ae5fa8a9 > Example code: > {code} > public static void jmlcL2SVM() throws Exception { > Connection conn = new Connection(); > String dml = conn.readScript("scripts/algorithms/l2-svm.dml"); > PreparedScript l2svm = conn.prepareScript(dml, new String[] { "X", "Y", "fmt", "Log" }, > new String[] { "w", "debug_str" }, false); > double[][] trainData = new double[150][3]; > for (int i = 0; i < 150; i++) { > int one = ThreadLocalRandom.current().nextInt(0, 101); > int two = ThreadLocalRandom.current().nextInt(0, 101); > int three = ThreadLocalRandom.current().nextInt(0, 101); > double[] row = new double[] { one, two, three }; > trainData[i] = row; > } > l2svm.setMatrix("X", trainData); > log.debug(displayMatrix(trainData)); > double[][] trainLabels = new double[150][1]; > for (int i = 0; i < 150; i++) { > int one = ThreadLocalRandom.current().nextInt(1, 3); > double[] row = new double[] { one }; > trainLabels[i] = row; > } > l2svm.setMatrix("Y", trainLabels); > log.debug(displayMatrix(trainLabels)); > l2svm.setScalar("fmt", "csv"); > l2svm.setScalar("Log", "temp/l2-svm-log.csv"); > ResultVariables l2svmResults = l2svm.executeScript(); > double[][] model = l2svmResults.getMatrix("w"); > log.debug("MODEL:"); > log.debug(displayMatrix(model)); > String debugString = l2svmResults.getString("debug_str"); > log.debug("DEBUG STRING:"); > log.debug(debugString); > String s = conn.readScript("scripts/algorithms/l2-svm-predict.dml"); > Map m = new HashMap(); > m.put("$Y", "\"temp/haberman.test.labels.csv\""); > m.put("$confusion", "\"temp/l2-svm-confusion.csv\""); > PreparedScript l2svmPredict = conn.prepareScript(s, m, new String[] { "X", "y", "w", "fmt" }, > new String[] { "scores", "confusion_mat" }, false); > double[][] testData = new double[150][3]; > for (int i = 0; i < 150; i++) { > int one = ThreadLocalRandom.current().nextInt(0, 101); > int two = ThreadLocalRandom.current().nextInt(0, 101); > int three = ThreadLocalRandom.current().nextInt(0, 101); > double[] row = new double[] { one, two, three }; > testData[i] = row; > } > l2svmPredict.setMatrix("X", testData); > double[][] testLabels = new double[150][1]; > for (int i = 0; i < 150; i++) { > int one = ThreadLocalRandom.current().nextInt(1, 3); > double[] row = new double[] { one }; > testLabels[i] = row; > } > l2svmPredict.setMatrix("y", testLabels); > l2svmPredict.setMatrix("w", model); > l2svmPredict.setScalar("fmt", "csv"); > ResultVariables l2svmPredictResults = l2svmPredict.executeScript(); > double[][] scores = l2svmPredictResults.getMatrix("scores"); > log.debug("SCORES:"); > log.debug(displayMatrix(scores)); > double[][] confusionMatrix = l2svmPredictResults.getMatrix("confusion_mat"); > log.debug("CONFUSION MATRIX:"); > log.debug(displayMatrix(confusionMatrix)); > conn.close(); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)