From 527cc285f3210e65574058a247ca24cc327db88a Mon Sep 17 00:00:00 2001 From: "Michael Pilosov, PhD" Date: Tue, 13 Feb 2024 05:21:39 +0000 Subject: [PATCH] drop in cuml --- makefile | 2 ++ scripts/sortcolor.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 16711e3..aa31c8b 100644 --- a/makefile +++ b/makefile @@ -55,6 +55,8 @@ umap: python scripts/sortcolor.py -s umap --dpi 300 --seed $$seed ; \ done +sort_umap:; + python scripts/sortcolor.py -s umap --dpi 300 --seed 21 sort_lex: python scripts/sortcolor.py -s lex --dpi 300 diff --git a/scripts/sortcolor.py b/scripts/sortcolor.py index 1b57691..d50bc00 100644 --- a/scripts/sortcolor.py +++ b/scripts/sortcolor.py @@ -79,15 +79,16 @@ if KIND in ("lex", "alpha", "abc"): preds = np.array(colors) elif KIND == "umap": - import umap + # from umap import UMAP + from cuml import UMAP # Use UMAP to create a 1D representation - reducer = umap.UMAP( + reducer = UMAP( n_components=1, n_neighbors=250, min_dist=0.005, metric="euclidean", - # random_state=SEED, + random_state=SEED, ) embedding = reducer.fit_transform(np.array(rgb_values))