Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDE in preprocess is not perfect #129

Closed
liuxiawei opened this issue Aug 14, 2024 · 4 comments
Closed

MDE in preprocess is not perfect #129

liuxiawei opened this issue Aug 14, 2024 · 4 comments

Comments

@liuxiawei
Copy link

the ov.pp.mde, the device is limit into cuda , and the params _kwargs can not modified and looks like confilt with constraint

@Starlitnightly
Copy link
Owner

Starlitnightly commented Aug 22, 2024

you are right, in new version the argument will be change in ov.pp.mde:

def mde(adata,embedding_dim=2,n_neighbors=15, basis='X_mde',n_pcs=None, use_rep=None, knn=True, 
        transformer=None, metric='euclidean',verbose=False,
        key_added=None,random_state=0,repulsive_fraction=0.7,constraint=None):
    '''
    MDE
    '''
......
    if constraint is None:
        _kwargs = {
        "embedding_dim": embedding_dim,
        "constraint": pymde.Standardized(),
        "repulsive_fraction": repulsive_fraction,
        "verbose": verbose,
        "device": 'cuda',
        "n_neighbors": n_neighbors,
    }
    else:
        _kwargs = {
        "embedding_dim": embedding_dim,
        "constraint": constraint,
        "repulsive_fraction": repulsive_fraction,
        "verbose": verbose,
        "device": 'cuda',
        "n_neighbors": n_neighbors,
    }

@liuxiawei
Copy link
Author

liuxiawei commented Aug 22, 2024

Thanks for you help! and it still limit device into cuda, It must use cuda?

@zuiluo1116
Copy link

Is there any chance for CPU only? For pyMDE support CPU situations.
Somthing like this (From https://pymde.org/):
import pymde import torch device = 'cuda' if torch.cuda.is_available() else 'cpu'

@zuiluo1116
Copy link

zuiluo1116 commented Dec 20, 2024

image
AND it worked like this.
Edited _preprocess.py at /usr/local/lib/python3.10/site-packages/omicverse/pp in docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants