Lou1sM / meaningful_image_complexity

11 stars 0 forks source link

Correction in Readme Code Block #1

Closed Kalash1106 closed 2 months ago

Kalash1106 commented 3 months ago

The code block should be

from measure complexity import ComplexityMeasurer
import numpy as np

comp_meas = ComplexityMeasurer(ncs_to_check=8,                                           
                               n_cluster_inits=1,                                     
                               nz=2,
                               num_levels=4,
                               cluster_model=None,                                         
                               info_subsample=0.3,
                               print_times=False,
                               no_cluster_idxify=False,                                 
                               compare_to_true_entropy=False,            
                               display_cluster_label_imgs=False,               
                               display_scattered_clusters=False,          
                               verbose=False,
                               suppress_all_prints = True)

img = np.load(<path-to-img-file>)

complexity_of_img_at_each_level = comp_meas.interpret(img)
  1. The "cluster_model" argument should be 'None'
  2. The argument suppress_all_prints must be added
Lou1sM commented 3 months ago

Hi, thanks for these fixes. I changed the class init to make several of these arguments defaults so you don't need suppress_all_prints (though it defaults to False to keep setting it to True if you want no prints). For the cluster_model arge, I meant to set it to the str 'GMM', was just missing quotes. Setting it to None ended up with the same effect but I think that's not as clear. I made it so that it has to be one of ['GMM', 'kmeans', 'cmeans'].