angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
70 stars 25 forks source link

Allow user to dynamically set batch size of pixel SOM assignments #1069

Closed alex-l-kong closed 10 months ago

alex-l-kong commented 11 months ago

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.

alex-l-kong commented 10 months ago

Can we add the same functionality to assign_som_clusters in the CellSOMCluster class in cluster_helpers.py (and cell_som_clustering.py respectively)?

Sure, same batch size work?

cliu72 commented 10 months ago

Can we add the same functionality to assign_som_clusters in the CellSOMCluster class in cluster_helpers.py (and cell_som_clustering.py respectively)?

Sure, same batch size work?

Yup, that works.