Skip to content

[BUG] simplicial_set_embedding() broken #6345

Open
@willleeney

Description

@willleeney

Describe the bug
A clear and concise description of what the bug is.

simplicial_set_embedding() requests some keyword arguments are positional
simplicial_set_embedding() requests some arguments not in the source or in the docs
simplicial_set_embedding() doesn't work with random_state=int

Steps/Code to reproduce bug

import numpy as np
from cuml.manifold.umap import fuzzy_simplicial_set, simplicial_set_embedding
from umap.spectral import spectral_layout
from umap.umap_  import find_ab_params

X = np.random.rand(1000, 50).astype(np.float32)
graph = fuzzy_simplicial_set(X, n_neighbors=15, metric='euclidean')
layout = spectral_layout(X, graph, dim=2, random_state=42)
a, b = find_ab_params(1.0, 0.1)
embedding = simplicial_set_embedding(
            X, 
            graph,
            init=layout,
            a=a, b=b,
            n_epochs=200,
            n_components=2,
            random_state=4,
            verbose=False,
)

if you include these parameters:

      initial_alpha=1.0,
      gamma=1.0,
      negative_sample_rate=5,
      metric="euclidean",
      metric_kwds=None,
      output_metric="euclidean",
      output_metric_kwds=None

it will request these to also be included:

      densmap=False,
      densmap_kwds=None,
      output_dens=None,

as these as detailed in the docs are not allowed

      repulsion_strength=None, 
      convert_dtype=True,

and to actually get it to work i need to pass random_state as np.random.RandomState(42)

When it does work, it returns a tuple not an array as expected

Environment details:

  • Environment location: Docker
  • Linux Distro/Architecture: Ubuntu amd64
  • no GPU
  • conda install -c rapidsai -c nvidia -c conda-forge cuml-cpu=24.12 numpy-base=1.26.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions