def gen_benchmarks(self, force=False): if not os.path.isfile(self.filtering_benchmark) or force: print('generating benchmark {}...'.format( self.filtering_benchmark)) bench = [] for _ in range(100): bench.append( sample_mog(10, 1000, 4, rand_N=True, rand_K=True, return_ll=True)) torch.save(bench, self.filtering_benchmark) if not os.path.isfile(self.clustering_benchmark) or force: print('generating benchmark {}...'.format( self.clustering_benchmark)) bench = [] for _ in range(100): bench.append( sample_mog(10, 3000, 12, rand_N=True, rand_K=True, return_ll=True)) torch.save(bench, self.clustering_benchmark)
def gen_benchmarks(self, force=False): if not os.path.isfile(self.testfile) or force: print('generating benchmark {}...'.format(self.testfile)) bench = [] for _ in range(100): bench.append(sample_mog(10, 1000, 4, rand_N=True, rand_K=True, return_ll=True)) torch.save(bench, self.testfile) if not os.path.isfile(self.clusterfile) or force: print('generating benchmark {}...'.format(self.clusterfile)) bench = [] for _ in range(100): # bench.append(sample_mog(10, 3000, 12, bench.append(sample_mog(10, 600, 12, rand_N=True, rand_K=True, return_ll=True)) # bench.append(sample_mog_FP(B=10, N=-1, K=12, sample_K=False, det_per_cluster=4, dim=2, # onehot=True, add_false_positives=False, FP_count=64, meas_std=.1)) torch.save(bench, self.clusterfile)
def sample(self, B, N, K, **kwargs): return sample_mog(B, N, K, device='cuda', **kwargs)