I discovered this after spending half an hour optimizing one of @Fil’s notebooks
Then again, I accessed safe mode by typing it in the URL, just noticed that it isn’t easily accessible from a menu. So I guess safe mode was not intended to be accessed anywhere outside your own notebooks? In that case maybe block it on notebooks that are not your own? Or even better: show a “it looks like you’re accessing safe mode on someone else’s notebook, you can only do that on your own. Fork this notebook and open in safe mode?” page instead.
I’m not sure what our solution will be to that, but I’ve filed a bug so we can keep track of the problem. Thanks for letting us know, and sorry you lost your work.
No worries, I tried again later, making sure to use a forked notebook this time:
The only real significant change is that I inlined the dot product and the random direction function, and in the latter case also stopped allocating a new float array every time you called the function (did you know that typed array allocation is insanely slow?)
Excellent! I’ve reworked quite a bit on the notebook (my daughter needed it to calibrate the colors of the film she’s currently editing), and created a new notebook that applies the Sliced OT method and exports a LUT. I’ll try and apply your optimizations there too.
Here’s the notebook as a standalone tool (just an embed), and a video showing the workflow with DaVinci Resolve:
the source notebook is here:
I’m still editing some parameters to see what’s important in terms of quantity of pixels that we try to transport, the color model (RGB vs LAB), etc.
In particular the neural network that tries to generalize the mapping (source image => target image) is not very performant. I just used brain.js as a black box, I have no idea how to make it better.
inlined project_pixels completely. Surprisingly enough this had an effect!
we need an “indirect” sort for p, but not for q. On top of that I happened to have an unpublished conveniently semi-finished notebook on radix sort lying around that’s somewhat faster than the native sorts for bit typed arrays, and can take advantage of nearly-sorted arrays, so I added that too.