Re: [Jprogramming] paeth filter

2014-09-01 Thread bill lam
I believe paeth forward filter will give the following output for i. 5 10 bbp=1 0 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 bbp=3 0 1 2 3 3 3 3 3 3 3 10 10 10 3 3 3 3 3 3 3 10 10 10 3 3 3 3 3 3 3 10 10 10 3 3 3 3 3 3 3 10 10 10 3 3 3

Re: [Jprogramming] paeth filter

2014-09-01 Thread Henry Rich
Right. So this is the way to get the original from the forward filter. If it works. Henry Rich On 9/1/2014 9:48 PM, bill lam wrote: Sorry, I might use the wrong terminology. I meant the filter that would give the original data from the output of the forward filter, ie data <--> m&backwad m&

Re: [Jprogramming] paeth filter

2014-09-01 Thread bill lam
Sorry, I might use the wrong terminology. I meant the filter that would give the original data from the output of the forward filter, ie data <--> m&backwad m&forward data forward: (encode): > Paeth(x) = Raw(x) - PaethPredictor(Raw(x-bpp), Prior(x), Prior(x-bpp)) backward (decode, back-feed,

Re: [Jprogramming] paeth filter

2014-09-01 Thread Henry Rich
backward. 'paeth' is the paeth filter, which could be forward or backward, depending on use. Backward was what you wanted, no? Henry Rich On 9/1/2014 9:09 PM, bill lam wrote: Just want to confirm, is you code for forward or backward filter? Пн, 01 сен 2014, Henry Rich написал(а): Well, I s

Re: [Jprogramming] paeth filter

2014-09-01 Thread bill lam
Just want to confirm, is you code for forward or backward filter? Пн, 01 сен 2014, Henry Rich написал(а): > Well, I said it was untested. It's just the framework. Here's a version > that at least produces a result: > > > y =. i. 5 10 > 'height width'=: $y > pixels=: ,y > NB. convert to array,

Re: [Jprogramming] A humbling linear algebra reminder

2014-09-01 Thread Scott Locklin
Erm, apologies, I meant: inv=: [: gesv_jlapack_ ] ; [: =@i. $ On 09/01/2014 05:10 PM, Scott Locklin wrote: So, I've been screwing around with neural nets, and built a learner with simple linear regression output nodes. The nature of this beast is you have to invert a big matrix which is clo

[Jprogramming] A humbling linear algebra reminder

2014-09-01 Thread Scott Locklin
So, I've been screwing around with neural nets, and built a learner with simple linear regression output nodes. The nature of this beast is you have to invert a big matrix which is close to singular. Because I am a big numerics nerd, I remembered to add a small number to the diagonal in order t

Re: [Jprogramming] paeth filter

2014-09-01 Thread Henry Rich
Well, I said it was untested. It's just the framework. Here's a version that at least produces a result: y =. i. 5 10 'height width'=: $y pixels=: ,y NB. convert to array, reverse, add bottom/right 0 array =: ({.~ >:@$);.0 (height, width) $ pixels NB. x is unused,above), y is left,upper-left

Re: [Jprogramming] paeth filter

2014-09-01 Thread bill lam
I assume your code is for backward filter (from paeth to raw). I tried with test data: y =. i. 5 10 'height width'=. $y pixels=. ,y but it ran into error |index error: scanlinepair | xformimage=.1 1&}.;.0 scanlinepair/\.array Also the bpp meant comparison with bpp byte apart. this bpp can

Re: [Jprogramming] paeth filter

2014-09-01 Thread Henry Rich
Untested. Here is a framework. It's not pretty, but this computation is just not parallelizable. NB. convert to array, reverse, add bottom/right 0 array =. ({.~ >:@$);.0 (height, width) $ pixels NB. y is 2x2 of (unused,above),:(left,upper-left) NB. Result is Paeth predictor paeth =. ({~ (i.