fr1ll / clip-plot

A WebGL viewer for UMAP-clustered images
https://fr1ll.github.io/clip-plot/
MIT License
2 stars 0 forks source link

Improve code style for get_umap_layout and get_rasterfairy_layout #49

Open fr1ll opened 1 year ago

fr1ll commented 1 year ago

To do:

fr1ll commented 1 year ago

Encompasses Refactor get_umap_layout to avoid need for process_multi_layout_umap #47

CarloOtano commented 1 year ago

Interesting to note that process_single_layout_umap uses cuml_ready. In addition it will use "label" (labels are not used if cuml_ready is used).

fr1ll commented 1 year ago

Yes, good point. My feeling is that umap is a small part of the runtime unless you run many umaps, so it's not of much use in process_single_layout_umap.

CarloOtano commented 1 year ago

Another interesting difference between process_single_layout_umap and process_single_layout_umap is that a model is saved for multi layout (pickled) but not for single layout.

It all has to do how they reuse cached embeddings:

CarloOtano commented 1 year ago

I am porting the missing functionality from single layout to multi layout. I will then deprecate single layout and always use multi layout.

CarloOtano commented 1 year ago

Another interesting difference between process_single_layout_umap and process_single_layout_umap is that a model is saved for multi layout (pickled) but not for single layout.

It all has to do how they reuse cached embeddings:

* Single layout

  * Looks for existing layout (umap-<plot_id>.json)

* Multi Layout

  * Loads model (a pickled AlignedUMAP object)
  * Writes each layout

I need to understand better why the models are saved, loaded and updated on the multi umap layout. It looks like updating UMAP object is not as simple as updating an AlignedUMAP object.