parser.add_argument('--verbose', dest="verbose", default=False, action="store_true", help="The format of the log") args = parser.parse_args() list_of_directory = os.listdir(args.folder) group = {} for directory in list_of_directory: if(args.fls not in directory and args.fls != "*"): # list_of_directory.remove(list_of_directory) pass else: try: logger_object = logger.JSONLogger(os.path.join(args.folder,directory,"log.json"), mod="continue") dct_key = logger_object["dataset"]+"-"+str(logger_object["size"])+"D" if(args.verbose): print("Folder \""+directory+"\" embedding size->"+str(logger_object["size"])) if(dct_key not in group): group[dct_key] = {} # euclidean classifier getter ll = [logger_object["unsupervised_eval"]["nmi"]] if(ll[0] == 0.): print("0 error in ", directory, " better ignore it please ") if("nmi" not in group[dct_key]): group[dct_key]["nmi"] = [] group[dct_key]["nmi"] += ll
help= "Precision at to evaluate (e.g --precision 1 3 5 | evaluate precision at 1, 3 and 5) " ) parser.add_argument('--cuda', dest="cuda", action="store_true") args = parser.parse_args() torch.set_default_tensor_type(torch.DoubleTensor) if (args.folder == "" and args.id == ""): print("Please give arguments for --folder or --id") quit() if args.folder == "" and args.id != "": global_config = config.ConfigurationFile("./DATA/config.conf") saving_folder = global_config["save_folder"] args.folder = os.path.join(saving_folder, args.id) log_in = logger.JSONLogger(os.path.join(args.folder, "log.json"), mod="continue") dataset_name = log_in["dataset"] n_gaussian = log_in["n_gaussian"] print("EVALUATE SUPERVISED CLUSTERING ON ") print("\t Dataset -> ", dataset_name) print("\t Number of communities -> ", n_gaussian) size = log_in["size"] # print("Loading Corpus ") X, Y = data_loader.load_corpus(dataset_name) representations_init = torch.load( os.path.join(args.folder, "embeddings_init.t7")) representations = torch.load(os.path.join(args.folder, "embeddings.t7"))[0]
help="Do force relaunch experiment evaluation") args = parser.parse_args() nb_communities_dict = { "dblp": 5, "flickr": 195, "blogCatalog": 39, "wikipedia": 40 } list_of_directory = os.listdir(args.folder) for directory in list_of_directory: try: path_to_experiment = os.path.join(args.folder, directory) logger_object = logger.JSONLogger(os.path.join(path_to_experiment, "log.json"), mod="continue") # if the experiment has already been evaluated we go to the next one if ("unsupervised_eval" in logger_object and "supervised_eval" in logger_object and not args.force): print(directory, " has already been evaluated") # continue else: pass if (0 == 1): pass else: print(directory) # set info vars print('Loading Corpus')