mixture = pickle.load(pkl_file)
pkl_file.close()  

#Get initial clustering for testing
initpicklefile = personal_homedir + 'global_superclustering/global_code/init_synthetic_cat_4.p'
initpkl_file = open(initpicklefile,'rb')
initclust = pickle.load(initpkl_file)
initpkl_file.close()  

#embed()
mixture_dict = mixture[0]
#num_starting_clusters = 15
#num_spikes = mixture_dict['superclusters'].shape[0]
#initclust = tc.generate_random_initial_clustering(num_starting_clusters, num_spikes )

#superdata used to be called silly
superdata = sorting.sparsify_superclusters(mixture_dict['superclusters'])
outsparse = superdata.to_sparse_data() #don't need to write the outsil variable, everything is stored within the sparse class
distdata = superdata.supercluster_distribution()
start_time = time.time()
[clust10, dic10] = superdata.clump_fine_clustering(10)
time_taken_clump = time.time()-start_time
print('Time taken for clump clustering %.2f s' %(time_taken_clump))

kk = KK(outsparse,**script_params)
#kk.cluster_from(clust10)
kk.cluster_from(initclust)
#Automatically create clust100 via
#kk.cluster_hammingmask_starts(100)
embed()
Пример #2
0
import pickle
import numpy as np
import matplotlib.pyplot as plt
import sorting 
from supercluster import *
from klustakwik2 import *
import imp # lets you reload modules using e.g.imp.reload(sorting)
from IPython import embed
import time


little = np.array([[1,4,5,6,0,0,0], [0,0,0,7,7,1,1], [0,0,0,7,7,1,1], [1,4,5,6,0,0,0], [2,0,1,1,1,1,3], [4,5,0,0,0,12,10],
                   [8,8,8,8,4,4,4], [8,8,8,8,4,4,4],[3,0,1,1,56,13,1],[3,0,1,1,56,13,1],
                  [3,0,0,0,0,0,1], [3,0,0,0,0,0,1],[0,0,0,7,7,1,1],[3,0,1,1,56,13,1], [1,4,5,7,0,0,0],[1,4,5,8,0,0,0]], dtype = int)
print(little.shape)
superlittle = sorting.sparsify_superclusters(little)
cute_little = superlittle.to_sparse_data()
cute_distribution = superlittle.supercluster_distribution()

picklefile = '/home/skadir/globalphy/nicktest/nick_global_320001_supercluster.p'
pkl_file = open(picklefile,'rb')
[time_taken_parallel, full_adjacency, channel_order_dict,globalcl_dict,supercluster_info,supercluster_results, superclusters] = pickle.load(pkl_file)
pkl_file.close()  

silly = sorting.sparsify_superclusters(superclusters)
outsil = silly.to_sparse_data()
distdata = silly.supercluster_distribution()
start_time = time.time()
[clust100, dic100] = silly.clump_fine_clustering(100)
time_taken_clump = time.time()-start_time
print('Time taken for clump clustering %.2f s' %(time_taken_clump))
from emcat import KK
from default_parameters import default_parameters


script_params = default_parameters.copy()
#script_params.update(
#        run_monitoring_server=False,
#        debug=True,
#        )

picklefile = '/home/skadir/globalphy/nicktest/nick_global_80001_supercluster.p'
pkl_file = open(picklefile,'rb')
[time_taken_parallel, full_adjacency, channel_order_dict,globalcl_dict,supercluster_info,supercluster_results, superclusters] = pickle.load(pkl_file)
pkl_file.close()  

#superdata used to be called silly
superdata = sorting.sparsify_superclusters(superclusters)
outsil = superdata.to_sparse_data() #don't need to write the outsil variable, everything is stored within the sparse class
distdata = superdata.supercluster_distribution()
start_time = time.time()
[clust50, dic50] = superdata.clump_fine_clustering(50)
time_taken_clump = time.time()-start_time
print('Time taken for clump clustering %.2f s' %(time_taken_clump))
embed()
kk = KK(superdata,**script_params)
kk.cluster_from(clust50)

#Automatically create clust100 via
#kk.cluster_hammingmask_starts(100)
embed()
Пример #4
0
#        run_monitoring_server=False,
#        debug=True,
#        )

picklefile = '/home/skadir/globalphy/global_superclustering/global_code/synthetic_cat.p'
pkl_file = open(picklefile, 'rb')
mixture = pickle.load(pkl_file)
pkl_file.close()
#embed()
mixture_dict = mixture[0]
num_starting_clusters = 15
num_spikes = mixture_dict['superclusters'].shape[0]
initclust = tc.generate_random_initial_clustering(num_starting_clusters,
                                                  num_spikes)
#superdata used to be called silly
superdata = sorting.sparsify_superclusters(mixture_dict['superclusters'])
outsparse = superdata.to_sparse_data(
)  #don't need to write the outsil variable, everything is stored within the sparse class
distdata = superdata.supercluster_distribution()
start_time = time.time()
[clust10, dic10] = superdata.clump_fine_clustering(10)
time_taken_clump = time.time() - start_time
print('Time taken for clump clustering %.2f s' % (time_taken_clump))

kk = KK(outsparse, **script_params)
#kk.cluster_from(clust10)
kk.cluster_from(initclust)
#Automatically create clust100 via
#kk.cluster_hammingmask_starts(100)
embed()