Cheap and cheerful alternative to fluid.grid~ for larger data sets?

So due to a good breakthrough with fluid.jit.plotter (via some new info/knowledge from the Max beta forum being passed to @balintlaczko) I’ve been resisting 2d plotting of datasets for corpus scrubbing ala CataRT et al.

At the moment I’m doing something like this (ala my old experiments with fluid.datasetplot~):

This is really cool/handy for using a mouse, but I’d like to be able to navigate this with a gamepad or other grid-y surfaces.

Sadly fluid.grid~ absolutely chokes on a dataset of any significant size (as it turns out!). The dataset on the right is ~30k points and that pinwheeled Max for like 5min before I decided to just force quit it.

I imagine it’s doing loads of stuff trying to optimize the relationships between all the points, but for larger data, it seems like that’s not really viable. And there’s not really a lot of parameters to tweak with the algorithm to try and make it faster/dumber, so I’m wondering if there’s a cheap/fast way to make something grid-y out of larger datasets like this. Like some kind of brutal ordering/quantization or something like that? And/or is there any settings or pre-processing that can make fluid.grid~ happy with 30k data points.

1 Like

Ok I spent a bit of time this morning playing around with fluid.umap~ and although it’s quite a bit slower than I’d like, I can seem to make “circles” out of it, which is better than loop-de-loops.

For reference, with the ~30k dataset above, PCA takes 150ms to make this shape:

So that’s effectively “instant”.

And here is my best result with fluid.umap~:

You can see the settings below it, and this took ~13s.

So a few orders of magnitude slower, but a fair use of the space. Navigating it also sounds alright (some more extreme settings made a more evenly distributed circle, but the distribution sonically felt more random internally)

And here’s the same settings on a different corpus (~14k points):

This took about 4s, though it has produced a bit of an appendage. Playing with the settings it seems to make it more or less pronounced without ever getting rid of it.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

And here are some other settings and their durations:

This took 20s, and represents my first experiments of just trying way way less iterations. And it’s kind of a fuzzier version of the PCA shape, which is an improvement, though super slow.

By reducing the numneighbours I get something even fuzzier, and much faster:

This one took only 9.5s.

So that led me to focus on numenighbours as the main “rounding” factor. Bringing that quite low gave me this (in 8.5s):

So already kind of round-ish.

So overall the numneighbours appears to be the rounding factor, with 3 seeming like a sweet spot, although 2 also works pretty well.

I would have thought mindist would be the deciding factor given what it’s computing, but at rather small values you get wrinkle textures (@mindist 0.1 in 10s):

And pushing it the other way up to @mindist 3 gave me this (in 10s):

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

So this use of UMAP gives passable results, in that if you’re willing to wait ~12s, you can get a shape that better uses a 2d plane, but definitely too slow to be a default.

Ideally it would properly use the 2d plane by taking up the corners too, but this is a start at least.

The bad news is that this type of algorithm is intrinsically very expensive. I believe that there may be more approximate versions that could be less so, but I don’t really know what they are. Maybe we should have a vague feature request for someone to investigate that.

2 Likes

I’ll make an FR on the git with this thread as a link.

As an aside, for my immediate use case, I got to thinking that rather than trying to transform complex data, that perhaps it’s easier to just transform my input controller data instead. Since my intention here is to use a 2d control space (with an XY grid or a gamepad), that as long as I can get UMAP in to a circular shape, that I can perhaps map a 2d “square” onto a 2d “circle”?

I have/use this old bit of code from @a.harker where it takes a circular input and stretches it out to fill a square. Very useful as most gamepads can’t actually reach the corners otherwise:

<pre><code>
----------begin_max5_patcher----------
1916.3oc6aszbaaCD9r7uBTM8PcpsLwC9P8TyzY5s1K8PO3zQCDEjMRoHYIg
rcZlLS+G1+REuHMoLoBkDgRlznCTivBP7seXwhEKfd+ESltL6IV4TvO.tELY
x6uXxDcQpBlX+8joanOEmPK0UaZb1lMrTwzqLxDrmD5xWUPeDPAw7h3DVkzz
sax1JRXBca8rkxWoaQ1x2dcTiZxSqpHzVXNUDeOO8tEErXgAjjfnYdWAf3P0
WgApmHuYdf+P0jObwEpGWMPcImlxR1OVKumlyZhokYEqXEwYIYEFD4ofvyOf
Jr7RE0eZq1qJGcfpNJTqy95mvHu5up6uMYqXMAOM8tDcAnPUss.3tVfGcUqG
O+xxKxxyJD7rT8qbl+wPv7XQYBWovcxxUTfoHw6LT8sfobkEl4qtXSzzZZpf
tgIXEKXozkIsz9V7JpedMRaDEfQujW+LRkCgioNaskFKkNk8nDiuvmvCrmxK
.e6ZH3U.HJbF3GKioIzBkcJ.1M+.6ie5lUHSOxYQQMmFgPiqhmCJyYrUI7M+
lTgYiglhvSOt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gD3b6HhIe+Dn1.
Z97+OmQXH130wjYXhm9bEwJ6mulR3ulR3ulR3SIkvmRVJ1e5qHjiNSNlDT.G
3lzes5ryA7TvuHmOxySXkfr0f+8ebdFdNxzWP7O5zWXybS3.Yl5U9z99.+LM
VjU3bZo88No8Bx+DMIdqxRGjZwlAZqeAzFDU1JW583Feujb+du6YH.ZncTfY
eTAyaesVNCT3uWPyATqMuHCv9qs7GnIxpaL6ugb3IT6SEMFZV7ybB+iNKtmz
1+MWqtmLt4rLBNJ5DcJz4b6sqx3eH5beHHk4IbgjPUWMo8PpnONod0GmcgGC
6hOE10lSfP8BRgnyM6FmU5FCUe+y97dCUZ8dhN6mV2q.3YPhbiDXGwnm+o9V
FEq8jFb1YToiTniNSXe3YmLiL28HyYlJ2At+mL+nt1MZ6q4w4zMpI50.+ysk
JcYojWcioJY9mHOol.nH6+lw3lCmToyC6Df78b4ACpe6vAgCnywwf3i.2hC3
ghiF0bCeUdlbaEVij4Q56ZT.YFIJvCgla9DM+JfOpGQNSuPC1dy2o76PO4Sh
SgQvfGl8QNGGCZ5WfawA5P4i9M6UG+mdo+nYjPRjO1ZbOGWY22gHGoXpznML
8pxg7WtmzdOmxyMfq2Ir9S+HdBBb9IfYOhGr4fvBgt3.vhoEhr7rDSPkG38S
nmXIaQSNmkvg160mNRmd9SfngV6naLj1ty1rTWGtOZ5EquqVTq5T+uCC14v0
A0ydCnm8F6dNjLfdNrQrJGcO09ZS0WOQFidBOfdBOF5zvrXvcax3cFLYvcay
bhc8P5YuwfdGhIyXLNhGhJsCZFoIfCpqaOVuSfJnn.UzHXjuIwud0+ZrG3IA
Cklfm3.xPlWEDLBi7ACQkH6k+IDnhwIdvYQymSPj.yGnbCR8Kqikt145Ynf7
NWKictRFu75Xz+UwX2qggNLv9t9EW7gK9OHF2jAL
-----------end_max5_patcher-----------
</code></pre>

(though revisiting this now, it looks like drawing a smaller circle makes for some jerky movement in the output?)

But perhaps something similar to this, but the inverse, where it maps the 2d square onto the UMAP “circle”.

A logical conclusion to that would be some kind of transform tool where you can take a 2d input and add additional points/dots to stretch/distort any normalized 2d input into any arbitrarily-shaped output as a mapping problem, rather than a data transformation one.

2 Likes

A bit tangential to the thread, but I managed to work this out.

For the first part, it seems that Alex’s original code was turning a circle to a square at all magnitudes, so I amplitude output of cartopol to scale the “square”-ness, which feels quite natural. Diagonal lines feel more natural, and curving/swooping movements are less jagged.

Then for the second transformation (square2circ), I do a similar process turning it back around. I can’t tell if it’s mathematically perfect, but the output definitely follows the circle shape.

<pre><code>
----------begin_max5_patcher----------
3239.3oc6c0siaqaD95ceJTM5EYS85PRIpe5EEMn.EnWbJJPunWjTrP1V1qx
QVRGI5Ma5AGf9F1Wox+jsjrDEsM0ZmrKBfSrnj4Leb3v4a3Pke81alLO64nx
IV+QqOYcyM+5s2bC+RrKbi762LYS3yKRBK421j7vznjISEsjGRV7Xb55GJhV
PD+JPf2LvTKHDJ9aevt+x5eKer4YEKiJVjkjUHdH98r+CXs6MdIuayl+k6cl
z34YWGIuR51MwoIQDtLBkWr7wv7n5WfdWYaIU2FPd0MYKip+8vz0I7Kf7XRi
rKW2PbQSa7wdwMuHKOqfDmkx+ImgYW92t8V1GSMDD6F3OVPr8qDHNM5qT0sR
YIQOyg1IOE8bdg0ueEz58VPj2Lq+b4hvjvBl7aAqtcgBR9lPy+j0jI6ksCGs
rCvL.2A4TavBg5F+gNfIpv6lvK7Dz7EYa1DkRNP0K+ksgEQVjhvzxUYEahVZ
QxrVDWrHIx596u+OovfDiE1THogoTGA8ni1AGgNBLnNJ0lV5nTyGPGQN3iRG
8uP53mkZ4mmXQ6g7sDE5jmicccJX.Ux8BoRv4yrVVD90JqwMgoaCSR9lJKRe
9rMrbPy1SolgfirlMjG8JeD3.S6PGhPutcomaUlGEsLIdy+j5JO5r7g6hQ53
CGY2o4Dpae306UwvyM6zvalrJNI5onhRIzHuaJbmmW6x2T6QXvxWDXt+zcWJ
NUbI2cWpH5o3pm2Y2UCKn5Ngp3aK3Hy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8BYBXIP3iGiC18MSO.qkv
Ba9lz0TCIdt5LjXafgDOcLi8.lnmzxLCYhdBoQO4FXfdxsosphwInI5ogzIr
IPOWsVJAOFl8Z007+qiy79ycA5.v9FXnDqiVhMwTNrmNSDLQ7GXcbXgMwZHX
jtiSFomf5LNc1VDZY64YBcBniN4Y.cp8zzdlLibLfVs6WYf9x1X8ETq95rwP
j8EyWrd8M1cL7E2NpJUbJNaLF5pUeYBeW69UFnuLxbBnVyIfFYNAzVq9xDgm
zlRU28kefw5pAmpCfFoufZwmDnhOojNjOkVYP.v111Cy+iyz9a5rkaftCGvg
DaWdgo6AP69VCgSjNlV0UKStZUOsspk1Cqi19qg110OKu1Y66092s+1s+eHn
dTGM
-----------end_max5_patcher-----------
</code></pre>

Actually reworked the square2circ part quite a bit as it was doing weird motions near the extremes:

<pre><code>
----------begin_max5_patcher----------
3343.3oc6cszajiaD9r8uBEgbX7D6dHodmSYQ.BPNjf.jC4vNKLTqltslUsj
VI0d8rKVf7OL+kBEIkZI05QoWss2wXATuVTRUUerXQVEqhyud8Upaidllpp7
mU9dkqt5Wu9pq32J+FWI+6qTO39rWfaJ+wT8hNbfFlodqnsL5yY76qsQwc2W
Nlloj5+KTknGTdxOI6nafR5OczMgV7BA9gTunig72RSdyX2LuG8C2eeB0KSv
MFFlaP2pnYYuw3VEas7+P2ZCR4GjuS3wCQGyBnYb9BIuq+NN2Ds8K2oYPTO8
r9gEOJN+d+10Wme4VfRcH8mYexyD5fH2cGnooJX0djDjNWRz3BjEJ+Jgzojf
aSRPEeewCl80Xp3iqpV8yrJBYJMPA0i7oirEhjPL0GP9HsHe51cJeacC2qda
mxIYBxYdOl6d54BZVTbOxolinqyhKtZ3IzOpaM19woHewtgzfdDDBl2Gg0rH
7esQk+LhQW55EjH8QWgXTHxaiR1QSp1YKtiWTPThfG3j7zEbcRWQOVdyCQ6n
U4DlVQ.+FD9.JIU1WiBjaqc4DEhShhiRx7iB4exMFSAj88xRC7ykykDoaczg
wIRj3d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DQt3mFmxc.CM2SiSBYzmFmfURVkjSEZhgh0Vwrx
j.tTJWyZ.j.sjHW0xJ0BHSPV0Z8EZt5VvtqCWfGixIdRoqK48Rx7MSIYBKBt
iM3VsF0N82HAv8ChH3RtQ4t9iZq.UbDQAAilxFhYhdKs2EdtIYQwQACGkWwt
c6HpcTazTBx6D+G9gam5+BPTUOh+t0WRf.1ZZtUBdmWWF0OK.5phHHUpKiy5
h.Sq7+kXZXZoasHzxBBsptlhoSKMS.zhumxK.sHPjKsZyd17DmvTmm8CXDVa
iiCa5FMKi7+yjXcaeMNadGCh2QmlPeFzBjdMuma1zhX.ZLDYI5+I5fo07kKP
5Z3EQtvNfjKiEgVvrMrbzBChVyt+BaBhVVKFsFFCWDadXPiuvNKBs.M9BuHy
QU2Sqdwv42eAZrLZY5u.YmGatXzZPc97rOeAvPzkaMEHP1CwnEgVvVWV8mpb
e9QWBh2.NJINdlDGzncciWNhycGc4g8xUiN.wWB6b7DeC.sbVDZARtrVBaOk
b7.xk8hPKKPxk9hQKLHZgmMsfoGpsHxkND4xTaQjKMPxEZQjKLXecVbqXDSP
S.2vs0kxJlIbOJWIhiAYBEu7vNBj904qEQDxnFI0UNYZjLWMRjqyShqtSfql
IuEO1yckzVW+aW++AMQEQZB
-----------end_max5_patcher-----------
</code></pre>

Revisiting this again after some exciting email exchanges with @balintlaczko.

Here are some 4d (XY, size, color) projections using UMAP with different settings trying to optimize for efficient use of space and legibility. All of the projections below are using the same exact dataset (~28k points).

Probably the best so far (using same best settings above):

Covers the space well and sounds alright (though very randomish looking color distribution).

///////////////////////////////////////////////////////////////////////////////

This one has more local cohesion both in terms of color and sound in a kind of local/clustery way, but is a bit less evenly distributed overall (this browses better, but if I wasn’t looking and using a gamepad, there’s more empty space).

///////////////////////////////////////////////////////////////////////////////

This next one looks like a wrinkly version of the first one. Again, better clustering locally but more empty space.

///////////////////////////////////////////////////////////////////////////////

This starts getting more sparse in the higher-order space but browses nicely (though you can’t tell so much from the colors).

///////////////////////////////////////////////////////////////////////////////

Here we start getting into stringy territory:

///////////////////////////////////////////////////////////////////////////////

This seems to combine some of the “blur” from lower numneighbours with some of the wrinkly-ness from lower mindist.

///////////////////////////////////////////////////////////////////////////////

Although I didn’t list the duration for these, they were all between 9-13s (most being 9-10s) so are reasonably quick. It’s hard to balance the use of the space with visual legibility (and computation time).

1 Like

It’s outside the flucoma-verse, but you might check out Lloyd’s Algorithm. I’m using it for this purpose but in MMMAudio land.

1 Like

Interesting.

For my cases being outside of FluCoMa-land complicates stuff, but it looks like it does >2d and I assume from your recommendation it’s faster too.

Do you exclusively use this over the Jonker-Volgenant approach used in fluid.grid~ in MMMAudio (or your own stuff within MMM)?

I wouldn’t assume that. I’m not using it in a time-sensitive way so I haven’t benchmarked it at all.

That’s cool. I’m only using it in 2D. I use UMAP first to perhaps “unwrap” the manifold, then use Lloyd’s algorithm to spread the dots out to “cover the square.”

No. I’m not even sure it’s “better,” let alone what “better” means. But I think it’s an interesting algorithm and therefore fun to experiment with.

1 Like

@rodrigo.constanzo and @balintlaczko if you find a gridding algorithm that is significantly faster, we can maybe dream of an object, the same we we have PCA, MDS and UMAP for 3 different qualities of DR.

That would be very useful. And I agree, having a few flavors of grid-ifying would complement the DR nicely.

I’ve personally not played with stuff outside of a Max/FluCoMa context, so don’t have a point of reference other than what @tedmoore and @weefuzzy vaguely mentions earlier in the thread.

Maybe @jamesbradbury has messed with some of this kind of thing?

1 Like

Nup, sorry!

Hmm, can’t help either with that. I would have my own caveman-style approaches, but I have never studied how to do this efficiently.

As far as I see, you could want two types of things: 1) find an area in the dataset where you have a good coverage of samples in (nearly) equal-step distances (“fit a cube in somewhere a concave blob”), or 2) try to warp inter-sample distances to get a regular distribution (“iron the blob into a cube”).

I think the first one is probably easier to implement than the second, since with rescaling audio representations there is always a risk of distorting their perceptual relevance. But then you don’t get to use the whole dataset.

I also remember discussing with someone somewhere (maybe here in another thread) an idea to decimate a dataset with kmeans clustering, where you would use the cluster centers as “anchors” and sample points close to those centers. And the follow-up idea would be to draw axes between pairs of cluster centers and sample points close to those axes. It may not yield a regular area altogether, but it could “draw trajectories” between different groups of sounds. (Even on the fly..?)

That’s a good way to frame it.

I guess there’s also a use-case-centered way of thinking where you may just want to make the most of a surface area (e.g. trackpad, gamepad, touchOSC, etc…) where efficient use of the space is paramount and you would then kind of “learn” the projection.

Another way would be to perhaps take multiple individual reshapings/transformations/projections of several spaces and combine them into a single larger space where the goal isn’t so much making use of space, but rather creating relationships between spaces. So more of being able to distort and smear the projection ala photoshop brush or something.

Also reminds me a bit of the idea of a morphology between corpora as there could be overlapping sections in this too.

That’s interesting. I imagine that’s what UMAP and such are likely doing under the hood (conceptually), drawing local and global similarities and spacing things out.

But having a brute-force approach to that would be interesting.

kmeans is soon coming with new initialisation that is cleverer, albeit at a cost, so that approach might be fun to test indeed

1 Like