Closed alex-l-kong closed 10 months ago
Can we add the same functionality to
assign_som_clusters
in theCellSOMCluster
class in cluster_helpers.py (and cell_som_clustering.py respectively)?
Sure, same batch size work?
Can we add the same functionality to
assign_som_clusters
in theCellSOMCluster
class in cluster_helpers.py (and cell_som_clustering.py respectively)?Sure, same batch size work?
Yup, that works.
What is the purpose of this PR?
The current hard-coded batch size of 100 makes pixel SOM cluster assignment extremely slow. For a powerful machine (and even modern-day M1's and M2's), it can handle a much larger batch size and offer a 100x+ speedup.
How did you implement your changes
Pass an argument through the PixelSOMCluster process called
num_parallel_pixels
, which controls how many SOM clusters get assigned at once.