For this I use gron [0]. It's very convenient.
This looks neat. However since I read about Koka's dot selection [0], I keep thinking that this is an even neater syntax:
fun showit( s : string )
s.encode(3).count.println
However, this is of course impossible to implement in most languages as the dot is already meaningful for something else.I built a small static web app [0] (with svelte and tensorflow js) that shows gradient descent. It has two kind of problems: wave (the default) and linear. In the first case, the algorithm learns y = ax + b ; in the second, y = cos(ax + b). The training data is generated from these functions with some noise.
I spent some time making it work with interpolation so that the transitions are smooth.
Then I expanded to another version, including a small neural network (nn) [1].
And finally, for the two functions that have a 2d parameter space, I included a viz of the loss [2]. You can click on the 2d space and get a new initial point for the descent, and see the trajectory.
Never really finished it, though I wrote a blog post about it [3]
[0] https://gradfront.pages.dev/
[1] https://f36dfeb7.gradfront.pages.dev/