Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion CAE implementation

Received: by 10.204.129.9 with SMTP id m9mr110601bks.1.1350319524141;
        Mon, 15 Oct 2012 09:45:24 -0700 (PDT)
X-BeenThere: pylearn-dev@googlegroups.com
Received: by 10.205.124.16 with SMTP id gm16ls4986744bkc.7.gmail; Mon, 15 Oct
 2012 09:45:23 -0700 (PDT)
Received: by 10.204.148.22 with SMTP id n22mr110044bkv.0.1350319522836;
        Mon, 15 Oct 2012 09:45:22 -0700 (PDT)
Received: by 10.204.148.22 with SMTP id n22mr110043bkv.0.1350319522820;
        Mon, 15 Oct 2012 09:45:22 -0700 (PDT)
Return-Path: <ca9...@gmail.com>
Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42])
        by gmr-mx.google.com with ESMTPS id 27si1592226bks.3.2012.10.15.09.45.22
        (version=TLSv1/SSLv3 cipher=OTHER);
        Mon, 15 Oct 2012 09:45:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of ca9...@gmail.com designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ca9...@gmail.com designates 209.85.215.42 as permitted sender) smtp.mail=ca9...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-la0-f42.google.com with SMTP id e6so3624057lah.29
        for <pylearn-dev@googlegroups.com>; Mon, 15 Oct 2012 09:45:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type:content-transfer-encoding;
        bh=twc5PBRmFWYL0I1LYQUZazzolAaqiSIDUZ01zY/WcK4=;
        b=fp84WmsBagA2d/OUAUbqc0T5uN8cwTnbq4RTMKnoG34wqJubXvLgliV7DOkMOIw4NN
         LV9ohyDrYfaYvB3PKQGCADH4Gf8KYpbu9o5ZF6drsY7gsu7oY4EOVpQQ9JHfZpoJdHM4
         6n2GhLv9OccUqEBy7R5Ez8IGyrFejKIFU60bf1cBGsPXAsFtz0M8pJgnDBV7RjrrGHDv
         Rh+QaH1ZgSte47l2yZ9t2f8Cs+FucQ0TXSc6CRwJEXzEQroLndjXl3e3e/AjaX1qjIIy
         AtubpCAbQMUl8CRuJ0nWOlV5ZwvIsxreRAVfmBGj9R0jGoovl8wAkEbQleRw3VoXeiP4
         llag==
MIME-Version: 1.0
Received: by 10.112.45.69 with SMTP id k5mr4560449lbm.35.1350319522600; Mon,
 15 Oct 2012 09:45:22 -0700 (PDT)
Received: by 10.114.38.228 with HTTP; Mon, 15 Oct 2012 09:45:22 -0700 (PDT)
In-Reply-To: <CAPXn81q716ULia9Vs7K8Ejox46LCvfseC-hKVK3k0BsgiM_...@mail.gmail.com>
References: <CAPXn81pga3DA+f4dEHm5pbFgNF-BoEMSi-P5a=26+cu=0YQ...@mail.gmail.com>
	<20120803030658.GA9...@bob.blip.be>
	<CALiffSNBE-c=Z244UQb6YEeHTyh+8k_WE1opnqn-S8Ukj7O...@mail.gmail.com>
	<CAPXn81pARx3xwaQmrbnm=dP_4KvRHC=+6kdwiMkwD5Aqoxs...@mail.gmail.com>
	<CADKKbtgsfukQ7ddvNB0ST4w-tDyKLyKQmT3kNN+xSp-5ODa...@mail.gmail.com>
	<CALc6Xo4hmTomRZHpMs74PriRfve6=UPB1a7SfuwD8QTDHzK...@mail.gmail.com>
	<CADKKbthX6++0NK0RNJAJxa7n2k0kjWMUJW9PfxbJE=AEDQ0...@mail.gmail.com>
	<CALc6Xo6AmYDKzZ-OJB1QJ5nBOisW5e0Wb8SkJwsoodJybxJ...@mail.gmail.com>
	<CAPXn81p45tAv=Um4bhoaD849kvTq9idrRzPFVKuLVge1-Bd...@mail.gmail.com>
	<CAARJ_g5Uj6tOzc9tEhBb+uiDWWqPGhn7pg27OxJUf=XsBfF...@mail.gmail.com>
	<CA+DEogMxamo6psrw_DGuuBKz5dFYaScSH49_sX89N3oeq03...@mail.gmail.com>
	<CAPXn81qmFYzSUHdB-M8eh8LVp8yyBtkPoUXi56SyireDvp5...@mail.gmail.com>
	<CA+DEogONff87YF21d=okBfk3p7_XSorO4hMv8xCkneDreWe...@mail.gmail.com>
	<CAPXn81q716ULia9Vs7K8Ejox46LCvfseC-hKVK3k0BsgiM_...@mail.gmail.com>
Date: Mon, 15 Oct 2012 12:45:22 -0400
Message-ID: <CA+DEogO99C=_ZH3V9T6DZbSP=LD+SQiDPeqTuWOPqVLWoUq...@mail.gmail.com>
Subject: Re: [pylearn-dev] CAE implementation
From: =?UTF-8?B?w4dhxJ9sYXIgR8O8bMOnZWhyZQ==?= <ca9...@gmail.com>
To: pylearn-dev@googlegroups.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

OK I've made the  pull-request here (Also I had to fix bunch of bugs
in order to test it as well):

https://github.com/lisa-lab/pylearn/pull/127

2012/10/12 Ian Goodfellow <goodfellow....@gmail.com>:
> Thanks.
>
>
> On Fri, Oct 12, 2012 at 9:49 AM, =C3=87a=C4=9Flar G=C3=BCl=C3=A7ehre <ca9=
l...@gmail.com> wrote:
>>
>> OK I'll do the pull request with the improved version.
>>
>> 2012/10/11 Ian Goodfellow <goodfellow....@gmail.com>:
>> > Would either of you like to submit a pull request with the improved
>> > version?
>> >
>> >
>> > On Thu, Oct 11, 2012 at 6:01 PM, =C3=87a=C4=9Flar G=C3=BCl=C3=A7ehre <=
ca9...@gmail.com>
>> > wrote:
>> >>
>> >> I agree with Hani, with the Ian's tip, I got a very significant
>> >> performance increase in my CA implementation as well.
>> >>
>> >> 2012/10/10 Eng.Hani Almousli <hani.mou...@gmail.com>:
>> >> > Hi,
>> >> >  I would like  to  confirm what Ian said. I have applied both metho=
ds
>> >> > in
>> >> > theano and it seems that getting rid off dimshuffle   really makes
>> >> > things
>> >> > faster (at least 2 to 3 times)  because the hidden unit in my case =
is
>> >> > large,
>> >> > so it is not only better for reducing memory consumption but to get
>> >> > better
>> >> > performance as well.
>> >> > Thanks...
>> >> >
>> >> >
>> >> > On Thu, Aug 16, 2012 at 9:41 PM, Ian Goodfellow
>> >> > <goodfellow....@gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> pylearn2 computes the Jacobian as:
>> >> >> Z =3D V W + b
>> >> >> H =3D g(Z)
>> >> >> G =3D T.grad( H.sum(), Z)  #this assumes elemwise nonlinearity
>> >> >> J =3D W.dimshuffle('x',0,1) * G.dimshuffle(0,'x',1)
>> >> >>
>> >> >> the penalty is then sq(J).sum(axis=3D1,2).mean()
>> >> >>
>> >> >> let's forget about the mean issue for the moment and just
>> >> >> worry about computing sq(J).sum().
>> >> >>
>> >> >> sum_i,j,k W_jk^2 G_ik^2
>> >> >> =3D sum_i,k G_ik^2 sum_j W_jk^2
>> >> >> =3D sum_i, k G_ik^2 sq(W).sum(axis=3D0)_k
>> >> >> =3D sum_i dot( sq(G), sq(W).sum(axis=3D0) )_i
>> >> >>
>> >> >> OK, so it looks like what we want is an optimization that replaces
>> >> >> T.sqr( W.dimshuffle('x',0,1) * G.dimshuffle(0,'x',1)
>> >> >> ).sum(axis=3D(1,2))
>> >> >> with
>> >> >> T.dot( T.sqr(G), T.sqr(W).sum(axis=3D0) )
>> >> >>
>> >> >> I haven't actually tried running the pylearn2 code, but the
>> >> >> optimization
>> >> >> should be faster as well as use less memory.
>> >> >>
>> >> >> If we say W is of shape (v,h) and Z is of shape (b,h) then the
>> >> >> original
>> >> >> has
>> >> >> space and runtime requirements of O(bhv) while the final has space
>> >> >> and runtime requirements of O( bh + vh ).
>> >> >>
>> >> >> On Thu, Aug 16, 2012 at 8:07 PM, David Warde-Farley
>> >> >> <d.warde.far...@gmail.com> wrote:
>> >> >> > On Thu, Aug 16, 2012 at 3:44 PM, Fr=C3=A9d=C3=A9ric Bastien
>> >> >> > <no...@nouiz.org>
>> >> >> > wrote:
>> >> >> >
>> >> >> >> If you end up having a profile that show this is a bottleneck, =
it
>> >> >> >> would be useful to know what % is spend in the elemwise and in
>> >> >> >> the
>> >> >> >> sum.
>> >> >> >
>> >> >> > I don't think the problem was ever computation time. The problem
>> >> >> > is
>> >> >> > memory.
>> >> >> >
>> >> >> > David
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Caglar GULCEHRE
>> >
>> >
>>
>>
>>
>> --
>> Caglar GULCEHRE
>
>



--=20
Caglar GULCEHRE