Skip to content

Sampling takes too much time, can use GPU? #16

@abrarrahmanabir

Description

@abrarrahmanabir

I am working with the GSE87544. It has 14k cells approx. The sampling is taking more than couple of hours. how to use GPU to accelerate this? I am unable to find any option such as device to select.
'''
print('Sampling cells to compose pseudo-bulk data')
for i, sample_prop in tqdm(enumerate(cell_num)):
for j, celltype in enumerate(celltype_groups.keys()):
select_indices = torch.multinomial(input=sc_data_tensor[celltype_groups[celltype]], num_samples=sample_prop[j], replacement=True)
sample[i] += sc_data_tensor[select_indices].sum(0)

'''
this is the part where it takes huge time.
please help .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions