Hi Henry, Thanks for your interest. I owe you some better information.
First off its not really an apples-apples comparison as the C version is very mature with some performance tricks designed to reduce calculations to the bare minimum (e.g., do not recalculate matrices but instead do selected in place updates as necessary). This gave me an 5-6X speed improvement in the C version. When I attempted to put same in the J code it ran SLOWER than simply recalculating entire matrix although in many cases only a column was actually updated, so i backed them out. This is a Markov Chain Monte Carlo Bayesian Artificial Neural Network (Three Layer Perceptron) application that in the test problem produces about 1e5 chain states (not saving them but streaming them to another C prog) using a half dozen matrices the largest of which (for this test problem) is about 200x5 Another curiosity is that in the C version using a (user defined) sigmoid vice 'tanh' as the non linear activation (on all matrix elements) expands the run time by 1.75X. In the J version the same choice *reduces* run time by about 20% over the 'tanh' J primitive (?). sgmd =. monad : '1%(1+^-y)' As far as releasing code, this is the outgrowth of my dissertation work and I may hope someday to commercialize and so I reluctant to release it. Pity - I know you cant be sure what I doing to in order to diagnose the situation, but perhaps we can find a way to accomplish what you want any way by pursuing this together. Cheers, -MSG On Mon, Apr 17, 2017 at 10:26 PM, Henry Rich <[email protected]> wrote: > If your arrays are large (say, 10000 long) I would expect J to be better > than half the speed of C. Can you share your application? > > If you have an implementation of +/ . * on double-precision floats that's > faster than J 8.06, I would be obliged if you'd send me a copy of the > source code. > > Henry Rich > > > On 4/17/2017 5:14 PM, Michael Goodrich wrote: > >> This is getting interesting; I was already impressed with Js speed being >> only twice as slow as the C version, and faster than the R version of the >> same code. >> >> Looking forward to that 806 beta 3! >> >> Btw I should uninstall the latest (stable) and start afresh? >> >> >> Sent from my iPhone >> >> On Apr 17, 2017, at 5:03 PM, Raul Miller <[email protected]> wrote: >>> >>> I think you were surprised by >>> http://www.jsoftware.com/help/dictionary/special.htm >>> >>> Specifically the special handling for +/ .* (which is handled at >>> parsing time rather than at execution time - the way you have things >>> arranged, the parser will not see +/ .* and hypothetically you could >>> arrange for sum .* in contexts where sum was defined differently). >>> >>> I hope this helps, >>> >>> -- >>> Raul >>> >>> >>> On Mon, Apr 17, 2017 at 4:51 PM, Michael Goodrich >>> <[email protected]> wrote: >>> >>>> Greetings: >>>> >>>> Got a nasty surprise today. have a non-trivial J app with the following >>>> supporting original definitions: >>>> >>>> sum =. +/ >>>> dot =. +/ . * >>>> sqrd =. *: >>>> ssq =. +/ @: sqrd >>>> >>>> >>>> Which I changed (thinking I was being elegant) to >>>> >>>> sum =. +/ >>>> dot =. sum . * >>>> sqrd =. *: >>>> ssq =. sum @: sqrd >>>> >>>> After this change the run time increased by a factor of 5! >>>> >>>> Insights? >>>> ---------------------------------------------------------------------- >>>> For information about J forums see http://www.jsoftware.com/forums.htm >>>> >>> ---------------------------------------------------------------------- >>> For information about J forums see http://www.jsoftware.com/forums.htm >>> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> > > > --- > This email has been checked for viruses by AVG. > http://www.avg.com > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Dominus enim Iesus Ecclesiae Suae et, -Michael "Let your religion be less of a theory and more of a love affair." - G.K. Chesterton ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
