royerlab / aydin

Aydin — User-friendly, Fast, Self-Supervised Image Denoising for All.
https://royerlab.github.io/aydin/
BSD 3-Clause "New" or "Revised" License
151 stars 14 forks source link

Possible error on random patch generation method #238

Closed AhmetCanSolak closed 2 years ago

AhmetCanSolak commented 2 years ago

Upon some discussion with @li-li-github today, we realized behavior of the current random patch generation method might be different than what was desired. We wrote the pseudo-code below as a reference for desired behavior. I will be implementing it to compare with existing implementation and then we can possibly discover opportunities for code optimization.

List[slice_objects] generate_random_patches(
    image:BXYZC,
    adoption_rate,
    patch_size,
    nb_patches_per_image, 
):
    list_of_slice_objects = []

    for b in B:
        patches_per_b = generate_patches_per_b(nb_patches_per_image / adoption_rate)

        sorted_patches = sort_entropies_of_histograms_of_patches_per_b()

        result = filter(sorted_patches, adoption_rate)

        list_of_slice_objects.append(make_slice_object(result))

    response = vstack(list_of_slice_objects)

    return response
AhmetCanSolak commented 2 years ago

This is addressed in #239 , so closing it.