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 7ED4D200B38 for ; Fri, 8 Jul 2016 11:37:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7D49F160A5A; Fri, 8 Jul 2016 09:37:14 +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 9E69D160A58 for ; Fri, 8 Jul 2016 11:37:13 +0200 (CEST) Received: (qmail 13954 invoked by uid 500); 8 Jul 2016 09:37:12 -0000 Mailing-List: contact dev-help@systemml.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.incubator.apache.org Delivered-To: mailing list dev@systemml.incubator.apache.org Received: (qmail 13940 invoked by uid 99); 8 Jul 2016 09:37:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2016 09:37:12 +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 273561A12BA for ; Fri, 8 Jul 2016 09:37:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.298 X-Spam-Level: * X-Spam-Status: No, score=1.298 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 3amdYAaOWV5A for ; Fri, 8 Jul 2016 09:37:10 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 90CE05FE0E for ; Fri, 8 Jul 2016 09:37:09 +0000 (UTC) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u689XeWM081853 for ; Fri, 8 Jul 2016 05:37:08 -0400 Received: from e06smtp16.uk.ibm.com (e06smtp16.uk.ibm.com [195.75.94.112]) by mx0a-001b2d01.pphosted.com with ESMTP id 2415xnnacg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 08 Jul 2016 05:37:08 -0400 Received: from localhost by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jul 2016 10:37:01 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 8 Jul 2016 10:37:00 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: NManchev@uk.ibm.com X-IBM-RcptTo: dev@systemml.incubator.apache.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1301F219005F for ; Fri, 8 Jul 2016 10:36:29 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u689b0IM24969724 for ; Fri, 8 Jul 2016 09:37:00 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u689axv8021789 for ; Fri, 8 Jul 2016 03:36:59 -0600 Received: from d50lp03.ny.us.ibm.com (d50lp03.pok.ibm.com [146.89.104.211]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u689awBl021779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 8 Jul 2016 03:36:59 -0600 Received: from localhost by d50lp03.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jul 2016 05:36:58 -0400 Received: from smtp.notes.na.collabserv.com (192.155.248.81) by d50lp03.ny.us.ibm.com (158.87.18.22) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128/128) Fri, 8 Jul 2016 05:36:55 -0400 X-IBM-Helo: smtp.notes.na.collabserv.com X-IBM-MailFrom: NManchev@uk.ibm.com X-IBM-RcptTo: dev@systemml.incubator.apache.org Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Fri, 8 Jul 2016 09:36:54 -0000 Received: from us1a3-smtp01.a3.dal06.isc4sb.com (10.106.154.95) by smtp.notes.na.collabserv.com (10.106.227.88) with smtp.notes.na.collabserv.com ESMTP; Fri, 8 Jul 2016 09:36:52 -0000 X-IBM-Helo: us1a3-smtp01.a3.dal06.isc4sb.com X-IBM-MailFrom: NManchev@uk.ibm.com X-IBM-RcptTo: dev@systemml.incubator.apache.org Received: from us1a3-mail144.a3.dal06.isc4sb.com ([10.146.38.80]) by us1a3-smtp01.a3.dal06.isc4sb.com with ESMTP id 2016070809365142-159793 ; Fri, 8 Jul 2016 09:36:51 +0000 In-Reply-To: References: X-Disclaimed: 8878 To: dev@systemml.incubator.apache.org MIME-Version: 1.0 Subject: Re: Restricted Boltzmann Machine scripts X-KeepSent: A0E585BE:B6927364-00257FEA:0034BF9F; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1FP6 Octobe4, 2013 From: Nikolay Manchev Date: Fri, 8 Jul 2016 10:36:51 +0100 X-LLNOutbound: False X-TNEFEvaluated: 1 Content-Type: multipart/alternative; boundary="=_alternative 0034CF6580257FEA_=" x-cbid: 16070809-0024-0000-0000-0000022871DA X-IBM-ISS-SpamDetectors: Score=0.383299; BY=0.067052; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.383299; ST=0; TS=0; UL=0; ISC= X-IBM-ISS-DetailInfo: BY=3.00005466; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000172; SDB=6.00727383; UDB=6.00340414; UTC=2016-07-08 09:36:53 x-cbparentid: 16070809-7094-0000-0000-00000056D35F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-08_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607080097 archived-at: Fri, 08 Jul 2016 09:37:14 -0000 --=_alternative 0034CF6580257FEA_= Content-Type: text/plain; charset="US-ASCII" Hi Matthias, Thank you for your feedback. I've just created a PR as requested. Regards Nikolay "Matthias Boehm" wrote on 08/07/2016 08:43:55: > From: "Matthias Boehm" > To: dev@systemml.incubator.apache.org > Date: 08/07/2016 08:44 > Subject: Re: Restricted Boltzmann Machine scripts > > thanks for reaching out Nikolay, > > 1) Scripts: Could you please create a PR to add them to /scripts/ > staging? This is the place we typically use to share new scripts. > Once they are tested for accuracy and runtime, we would migrate them > into scripts/algorithms along with some basic documentation. Thanks. > > 2) Matrix/Vector element-wise binary operations: As Fred already > mentioned, SystemML supports both Matrix-Row Vector and Matrix- > Column Vector operations, where the right-hand side input is > logically replicated which often allows us to broadcast the vector > and hence avoid shuffle operations. However, if you prefer to write > it explicitly as repmat like X %*% (v %*% matrix(1, 1, ncols(X))), > that's fine too - the SystemML compiler would then anyway > automatically rewrite this to matrix-vector operations if the repmat > is in the same basic block of statements. > > Regards, > Matthias > > > [image removed] Nikolay Manchev ---07/07/2016 09:44:28 AM---Hi all, > I am dropping a note as suggested by Fred below. > > From: Nikolay Manchev > To: dev@systemml.incubator.apache.org > Date: 07/07/2016 09:44 AM > Subject: Restricted Boltzmann Machine scripts > > > > Hi all, > > I am dropping a note as suggested by Fred below. > > I wrote a couple of DML scripts that implement Restricted Boltzmann > Machines, which are available on GitHub. This one uses CD-1 mini-batch > training to fit the model (weights and biases): > https://github.com/nmanchev/incubator-systemml/blob/neuralnets/ > scripts/algorithms/rbm_minibatch.dml > > This one runs a data sets through the trained RBM and outputs sample of > P(h=1|v) for each observation: > https://github.com/nmanchev/incubator-systemml/blob/neuralnets/ > scripts/algorithms/rbm_run.dml > > Can you please add them to scripts/algorithms? I also created a JIRA issue > for adding them here: https://issues.apache.org/jira/browse/SYSTEMML-777 > > Many thanks > Nikolay > > > ----- Original message ----- > From: Frederick R Reiss/Almaden/IBM > To: Nikolay Manchev/UK/IBM@IBMGB > Cc: dev@systemml.incubator.apache.org > Subject: Re: Question on SystemML - RBMs and repmat() > Date: Thu, Jul 7, 2016 3:07 PM > > Hi Nikolay, > > I appreciate your interest in the project. To answer your question: You > should be able to write "X%*%W + B" and get the semantics you want. The > SystemML compiler automatically pads vectors with copies of themselves > when it sees a cellwise operation between a matrix and a vector. So if you > run the DML code: > > > A = matrix (1.0, rows=3, cols=3) > v = matrix (2.0, rows=1, cols=3) > sum = A + v > print(toString(sum)) > > the output will be: > > 3.000 3.000 3.000 > 3.000 3.000 3.000 > 3.000 3.000 3.000 > > > Exposing cellwise matrix-vector operations to the SystemML optimizer in > this way should result in more efficient parallel plans, since it's easier > for the optimizer to detect that it can broadcast the vector and stream > the matrix. > > The PNMF script on the SystemML home page (http://systemml.apache.org) has > a more in-depth example of the same pattern: > > while (iter < max_iterations) { > iter = iter + 1; > H = (H * (t(W) %*% (V/(W%*%H)))) / t(colSums(W)); > W = (W * ((V/(W%*%H)) %*% t(H))) / t(rowSums(H)); > obj = as.scalar(colSums(W) %*% rowSums(H)) - sum(V * log(W%*%H)); > print("iter=" + iter + " obj=" + obj); > } > > The part in red divides the matrix (H * (t(W) %*% (V/(W%*%H)))) by the > vector t(colSums(W)). In R, the divisor in this expression would need to > be (t(matrix(colSums(W),nrow=1))%*%matrix(rep(1,m),nrow=1)) or something > equivalent. > > > > I think that an example script for training Boltzmann machines would be a > useful addition to the SystemML distribution. Would you mind opening a > JIRA issue for adding this script and posting a link to the JIRA on the > SystemML mailing list? Our JIRA instance is at > https://issues.apache.org/jira/browse/SYSTEMML, and our mailing list is at > http://systemml.apache.org/community. By the way, it's good to post > questions like your question below the mailing list so that others who run > into the same issue will have an easier time finding the solution; I'm > CCing the list with my response here. > > Fred > Unless stated otherwise above: > IBM United Kingdom Limited - Registered in England and Wales with number > 741598. > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU > Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU --=_alternative 0034CF6580257FEA_=--