Jan-Pieter wrote: > j901 on iPadOS seems to get vector graphics from plot.
It's truer to say that j901 for iOS handles vector graphics best via PDF, for which (in the current release of the app) is most reliably generated by Plot. The reasons are complex, platform dependent and JAL-version dependent. I recommend the iOS app be ignored as a good how-to guide for anything J Playground might be faced with. Good choice of demo topic, though. This could be J Playground's killer app. On Sat, 4 Jun 2022 at 21:42, Jan-Pieter Jacobs <janpieter.jac...@gmail.com> wrote: > I had some fun putting J Playground through its paces and wrote the > following neural network demo: > > > https://jsoftware.github.io/j-playground/bin/html2#url=https://gist.githubusercontent.com/jpjacobs/6ff68c07bf764ad886e097ffbd19f5f0/raw/52b0563a7daa76df7fa57a3743da45ca0755f1a7/nn.ijs > > It dowloads the CSV and DSV packages and the Spirals dataset, normalises > the data and applies some random jitter. > The neural network can be given any number of layers of any size (of > course, respecting the input layer to be of size 2 and the output layer of > size 3,as there are 2 input dimensions and 3 labels, one-hot encoded), e.g. > net=: nn 2 15 8 3 > It is trained with stochastic gradient descent and backpropagation with > quadratic loss, using e.g. 5000 100 0.1 sgd__net spl =: splitdata data ,. > labels > When finished, it outputs some stats and some nice pictures of the data and > classification borders, using report__net spl. > > I was **very** impressed to see it run (entire script with 5000 training > epochs, and visualisation) without going out of memory in under 35 secs on > my mid-range phone… just wow. > > Some things I noted with respect to the playground: > - I had to patch the enclength_jzlib_ verb to allow bigger viewmat pictures > (see at the bottom of the script). > - It's a pity the text output is blocked until all calculations are done, > as this renders it impossible to give status updates. Is there a trick like > in JQt (wd 'msgs') to overcome this? > - Maybe related: plots and text output do not keep their relative output > positions, which I think would be desirable when trying to make a coherent > example. > - The plot quality is not great yet, while I saw j901 on iPadOS seems to > get vector graphics from plot. As the Playground would be the showcase of > J, it would be great if it could also include crisp graphics. > - Lastly, I noted some strange scrolling glitches after running the script > in chrome on Windows (didn't try elsewhere): when scrolling up the terminal > output would jump back down from time to time. > > Any suggestions for improvement are of course welcome, though I kept the > features minimal to avoid making it too lengthy. To my taste, the report > function is for instance a bit too wordy, but necessary to show some > interesting graphs. If one were really ambitious, it could be turned into > something like: http://playground.tensorflow.org/ ( open source, by the > way). > > I hope you have fun tinkering with the neural network! > Best regards > Jan-Pieter > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm