Re: [Numpy-discussion] New ufuncs

2008-11-10 Thread Charles R Harris
On Mon, Nov 10, 2008 at 5:15 PM, T J <[EMAIL PROTECTED]> wrote: > On Mon, Nov 10, 2008 at 4:05 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > I added log2 and exp2. I still need to do the complex versions. I think > > logaddexp2 should go in also to compliment these. > > Same here, espe

Re: [Numpy-discussion] New ufuncs

2008-11-10 Thread T J
On Mon, Nov 10, 2008 at 4:05 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > I added log2 and exp2. I still need to do the complex versions. I think > logaddexp2 should go in also to compliment these. Same here, especially since logaddexp is present. Or was the idea that both logexpadd and lo

Re: [Numpy-discussion] New ufuncs

2008-11-10 Thread Charles R Harris
On Mon, Nov 10, 2008 at 1:17 PM, Travis E. Oliphant <[EMAIL PROTECTED]>wrote: > Charles R Harris wrote: > > > > > > On Sun, Nov 9, 2008 at 11:29 PM, T J <[EMAIL PROTECTED] > > > wrote: > > > > On Thu, Nov 6, 2008 at 3:01 PM, T J <[EMAIL PROTECTED] > >

Re: [Numpy-discussion] New ufuncs

2008-11-10 Thread Travis E. Oliphant
Charles R Harris wrote: > > > On Sun, Nov 9, 2008 at 11:29 PM, T J <[EMAIL PROTECTED] > > wrote: > > On Thu, Nov 6, 2008 at 3:01 PM, T J <[EMAIL PROTECTED] > > wrote: > > On Thu, Nov 6, 2008 at 2:36 PM, Charles R Harris > > <[EMAI

Re: [Numpy-discussion] New ufuncs

2008-11-10 Thread Charles R Harris
On Sun, Nov 9, 2008 at 11:29 PM, T J <[EMAIL PROTECTED]> wrote: > On Thu, Nov 6, 2008 at 3:01 PM, T J <[EMAIL PROTECTED]> wrote: > > On Thu, Nov 6, 2008 at 2:36 PM, Charles R Harris > > <[EMAIL PROTECTED]> wrote: > >> I could add exp2, log2, and logaddexp2 pretty easily. Almost too easily, > I > >

Re: [Numpy-discussion] New ufuncs

2008-11-09 Thread T J
On Thu, Nov 6, 2008 at 3:01 PM, T J <[EMAIL PROTECTED]> wrote: > On Thu, Nov 6, 2008 at 2:36 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: >> I could add exp2, log2, and logaddexp2 pretty easily. Almost too easily, I >> don't want to clutter up numpy with a lot of functions. However, if there i

Re: [Numpy-discussion] New ufuncs

2008-11-06 Thread T J
On Thu, Nov 6, 2008 at 2:36 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > I could add exp2, log2, and logaddexp2 pretty easily. Almost too easily, I > don't want to clutter up numpy with a lot of functions. However, if there is > a community for these functions I will put them in. > I worry ab

Re: [Numpy-discussion] New ufuncs

2008-11-06 Thread Charles R Harris
On Thu, Nov 6, 2008 at 3:17 PM, T J <[EMAIL PROTECTED]> wrote: > On Thu, Nov 6, 2008 at 1:48 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > What is your particular interest in these other bases and why would > > they be better than working in base e and converting at the end? > > The intere

Re: [Numpy-discussion] New ufuncs

2008-11-06 Thread T J
On Thu, Nov 6, 2008 at 2:17 PM, T J <[EMAIL PROTECTED]> wrote: > > The interest is in information theory, where quantities are > (standardly) represented in bits. I think this is also true in the machine learning community. ___ Numpy-discussion mailing l

Re: [Numpy-discussion] New ufuncs

2008-11-06 Thread T J
On Thu, Nov 6, 2008 at 1:48 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > What is your particular interest in these other bases and why would > they be better than working in base e and converting at the end? The interest is in information theory, where quantities are (standardly) represented

Re: [Numpy-discussion] New ufuncs

2008-11-06 Thread Charles R Harris
On Thu, Nov 6, 2008 at 1:23 PM, T J <[EMAIL PROTECTED]> wrote: > On Wed, Nov 5, 2008 at 2:09 PM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > I'm inclined to go with logaddexp and add logsumexp as an alias for > > logaddexp.reduce. But I'll wait until tomorrow to see if there are more > > com

Re: [Numpy-discussion] New ufuncs

2008-11-06 Thread T J
On Wed, Nov 5, 2008 at 2:09 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > I'm inclined to go with logaddexp and add logsumexp as an alias for > logaddexp.reduce. But I'll wait until tomorrow to see if there are more > comments. When working in other bases, it seems like it would be good to avo

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread Charles R Harris
On Wed, Nov 5, 2008 at 3:09 PM, Charles R Harris <[EMAIL PROTECTED]>wrote: > > > On Wed, Nov 5, 2008 at 2:41 PM, Stéfan van der Walt <[EMAIL PROTECTED]>wrote: > >> 2008/11/5 T J <[EMAIL PROTECTED]>: >> > numpy, it seems that logadd or logaddexp is probably a more fitting >> > name. So long as it

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread Charles R Harris
On Wed, Nov 5, 2008 at 2:41 PM, Stéfan van der Walt <[EMAIL PROTECTED]>wrote: > 2008/11/5 T J <[EMAIL PROTECTED]>: > > numpy, it seems that logadd or logaddexp is probably a more fitting > > name. So long as it is documented, I doubt it matters much though... > > Please don't call it logadd. `lo

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread Stéfan van der Walt
2008/11/5 T J <[EMAIL PROTECTED]>: > numpy, it seems that logadd or logaddexp is probably a more fitting > name. So long as it is documented, I doubt it matters much though... Please don't call it logadd. `logaddexp` or `logsumexp` are both fine, but the `exp` part is essential in emphasising th

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread T J
On Wed, Nov 5, 2008 at 12:00 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > Hmm I wonder if the base function should be renamed logaddexp, then > logsumexp would apply to the reduce method. Thoughts? > As David mentioned, logsumexp is probably the traditional name, but as the earlier link s

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread Charles R Harris
On Wed, Nov 5, 2008 at 12:01 PM, Neal Becker <[EMAIL PROTECTED]> wrote: > Anne Archibald wrote: > > > 2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: > >> Hi All, > >> > >> I'm thinking of adding some new ufuncs. Some possibilities are > >> > >> expadd(a,b) = exp(a) + exp(b) -- For numbers stored

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread Neal Becker
Anne Archibald wrote: > 2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: >> Hi All, >> >> I'm thinking of adding some new ufuncs. Some possibilities are >> >> expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs: > > Surely this should be log(exp(a)+exp(b))? That would be extremely useful,

Re: [Numpy-discussion] New ufuncs

2008-11-05 Thread Alan G Isaac
> Charles R Harris wrote: >> Hmm... but I'm thinking one has to be clever here because the main >> reason I heard for using logs was that normal floating point numbers >> had insufficient range. So maybe something like >> >> logadd(a,b) = a + log(1 + exp(b - a)) >> >> where a > b ? On 11/5/2008 1

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread Charles R Harris
On Tue, Nov 4, 2008 at 11:41 PM, Anne Archibald <[EMAIL PROTECTED]>wrote: > On 05/11/2008, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > > > > On Tue, Nov 4, 2008 at 11:05 PM, T J <[EMAIL PROTECTED]> wrote: > > > On Tue, Nov 4, 2008 at 9:37 PM, Anne Archibald > > > > > > <[EMAIL PROTECTED]> wr

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread David Cournapeau
Charles R Harris wrote: > > Hmm... but I'm thinking one has to be clever here because the main > reason I heard for using logs was that normal floating point numbers > had insufficient range. So maybe something like > > logadd(a,b) = a + log(1 + exp(b - a)) > > where a > b ? > Yes, that's the idea

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread Anne Archibald
On 05/11/2008, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > On Tue, Nov 4, 2008 at 11:05 PM, T J <[EMAIL PROTECTED]> wrote: > > On Tue, Nov 4, 2008 at 9:37 PM, Anne Archibald > > > > <[EMAIL PROTECTED]> wrote: > > > > > 2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: > > >> Hi All, > > >> > >

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread Charles R Harris
On Tue, Nov 4, 2008 at 11:05 PM, T J <[EMAIL PROTECTED]> wrote: > On Tue, Nov 4, 2008 at 9:37 PM, Anne Archibald > <[EMAIL PROTECTED]> wrote: > > 2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: > >> Hi All, > >> > >> I'm thinking of adding some new ufuncs. Some possibilities are > >> > >> expadd(a

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread T J
On Tue, Nov 4, 2008 at 9:37 PM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: >> Hi All, >> >> I'm thinking of adding some new ufuncs. Some possibilities are >> >> expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs: > > Surely this should be lo

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread Charles R Harris
On Tue, Nov 4, 2008 at 10:37 PM, Anne Archibald <[EMAIL PROTECTED]>wrote: > 2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: > > Hi All, > > > > I'm thinking of adding some new ufuncs. Some possibilities are > > > > expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs: > > Surely this should

Re: [Numpy-discussion] New ufuncs

2008-11-04 Thread Anne Archibald
2008/11/5 Charles R Harris <[EMAIL PROTECTED]>: > Hi All, > > I'm thinking of adding some new ufuncs. Some possibilities are > > expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs: Surely this should be log(exp(a)+exp(b))? That would be extremely useful, yes. > absdiff(a,b) = abs(a - b)

[Numpy-discussion] New ufuncs

2008-11-04 Thread Charles R Harris
Hi All, I'm thinking of adding some new ufuncs. Some possibilities are - expadd(a,b) = exp(a) + exp(b) -- For numbers stored as logs: - absdiff(a,b) = abs(a - b) -- Useful for forming norms - absmax(a,b) = max(abs(a), abs(b)) - absadd(a,b) = abs(a) + abs(b) -- Useful for L_1 norm and