Re: [eigen] overriding scalar_X_op for auto-dif? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] overriding scalar_X_op for auto-dif?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 26 May 2011 19:38:42 +0200
- Cc: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=EIYJGqvq3fDTU3sqCEgcnzwpX4qumJ8JpROpLWdqppk=; b=dofkBg4menMBsnvpJVUqy9YX5qRq6vpQkATuk73Wp4QkCCZClV6QLhbcOz5gQaYdi6 MpL7C4TGGPuOKsL2I3NRAS9zn64l4mTQ3qEfdx7/vyiG31QZU+aXCuGjANo/xCGcgE4R JpgZypmNowrPWeStW6mysv6v731LMprafIuk0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=R33A8GjasiRHeA63V3pc5wz0c8yfMVnHyd7FmmBzUa/ftkiSTcXAydVElE8xdi2k99 3/6jRRw/IWyR9E9b5u8ZzyrC7lUuTF7oli4uyCCTDe1OPoLGzeuLOYB3UvEuMz92BGYJ olSzLJxz2/QnMtyLWCVf2nE9h21+az7WgJHfA=
hi, I propose to continue the discussion on this bug entry:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=279
Benoit: any objection regarding this proposal: ^^^
gael
On Mon, May 23, 2011 at 10:56 PM, Hongyu Miao <jackymiao@xxxxxxxxx> wrote:
> I have a similar problem here. Although auto-dif is an excellent idea to calculate partial derivatives, it requires all arithmetic ops on the paired data object (if that's the case, usually). I can't image how slow my program will become if I do that, not even mentioning the work load to rewrite LAPACK routines or ODE solvers for the paired data class. Any smart suggestion to overcome this? Thanks.
>
> Jacky
>
> -----Original Message-----
> From: Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] On Behalf Of Bob Carpenter
> Sent: Monday, May 23, 2011 2:09 PM
> To: eigen@xxxxxxxxxxxxxxxxxxx
> Subject: Re: [eigen] overriding scalar_X_op for auto-dif?
>
> I'm glad to hear that a solution is possible.
>
> Is there any way I could help?
>
> It's important to us because it's holding up the efficient use of matrices in multivariate distributions like the normal, and we do a lot of hierarchical regression modeling.
>
> We can code around this by promoting everything to an auto-dif variable, but it's hugely wasteful in both time and space. Eventually, we plan to override the matrix arithmetic ops for auto-dif to save even more space and time, but we want to get everything working before worrying about further optimization.
>
> - Bob
>
> On 5/19/11 5:42 PM, Gael Guennebaud wrote:
>> ok, actually it seems this is something we have to solve in Eigen
>> itself. Nothing difficult though.
>>
>> gael
>>
>> On Thu, May 19, 2011 at 10:48 PM, Bob Carpenter<carp@xxxxxxxxxxx> wrote:
>>> Thanks so much for getting back to me so quickly on this. I tried
>>> overloading scalar_product_traits and NumTraits, but still no luck
>>> getting multiplication of an auto-dif matrix times a double matrix to
>>> compile.
>>>
>>> I'd MUCH rather just overload the basic ops for now.
>>> Later, I can optimize with expressions and hand-coded gradients for
>>> some cases without disturbing the API.
>>> I'm afraid your auto-dif scalar code's a bit beyond my current
>>> understanding of Eigen and C++ templates.
>>>
>>> I've attached a small tar.gz ball. Check out the README.txt, which
>>> shows how to run our reverse-mode auto-dif, has an example using
>>> Eigen auto-dif var multiplication which works fine, and then a demo
>>> that doesn't compile using double * auto-dif variables.
>>> I include the specialization of scalar_product_traits you suggested
>>> (with both orders), as well as NumTraits, but still no luck.
>>>
>>> - Bob Carpenter
>>> Columbia Uni, Dept of Statistics
>>>
>>
>>
>>
>
>
>
>
>
>