def __init__(self, nb_chan, group_by): self.ext_img = '.png' self.save_img = True self.show = False self.img_save_path = 'benchmark_img/' self.ground_truth = ['gnd_truth'] self.my_cft = cpp_file_tools(nb_chan, group_by, self.ext_img, self.save_img, self.show,ion=False)
def __init__(self, nb_chan, group_by): #general option self.save_obj = False self.ext_img = '.png' self.save_img = True self.show = False self.img_save_path = 'benchmark_img/' self.my_cft = cpp_file_tools(nb_chan, group_by, self.ext_img, self.save_img, self.show, ion=False) self.res_dict={} #simulated benchmark option self.simulated_dir_name = '../data/RT_classifier/BMIOutputs/0423_r600/' simulated_iteration = 5 self.simulated_files = [2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14] self.simulated_date = 't_0423' self.simulated_rat = 'r0' self.simulated_corename = 'healthyOutput_' self.simulated_change_every = len(self.simulated_files) self.simulated_first_train = 3 tmp=[] for i in range(simulated_iteration): tmp += self.simulated_files self.simulated_files = tmp #SCI benchmark option self.SCI_dir_name = '../data/RT_classifier/BMIOutputs/BMISCIOutputs/' self.SCI_corename = 'SCIOutput_' self.SCI_first_train = 5 self.SCI_min_obs = 10 self.SCI_files = {'r31': OrderedDict([ ('03', range(1, 25)+range(52, 58)), ('04', range(1, 45)), ('06', range(78, 113)), ('07', range(27, 51)), ('10', range(6, 31)), ('11', range(1, 16)), ('12', range(1, 27)), ('13', range(63, 89)), ('14', range(1, 23))]), 'r32': OrderedDict([ ('03', range(25, 52)), ('04', range(45, 83)), ('06', range(42, 78)), ('07', range(51, 82)), ('10', range(31, 69)), ('11', range(1, 36)), ('12', range(27, 54)), ('13', range(32, 63))]), 'r34': OrderedDict([ ('06', range(1, 42)), ('07', range(1, 27)), ('11', range(1, 31)), ('12', range(54, 87)), ('13', range(1, 32)), ('14', range(23, 48))]) }
import brain_state_calculate_c as bsc import cpp_file_tools_c as cft import pstats, cProfile file=["F:/data/r617/0620healthyOutput_1.txt","F:/data/r617/0620healthyOutput_2.txt","F:/data/r617/0620healthyOutput_3.txt"] my_bsc = bsc.brain_state_calculate(32) my_cft = cft.cpp_file_tools(32, 1) # cProfile.runctx('my_bsc.init_networks(file, my_cft)', globals(), locals(), "Profile.prof") # s = pstats.Stats("Profile.prof") # s.strip_dirs().sort_stats("time").print_stats() my_bsc.init_networks(file, my_cft) print "END kohonen" #my_bsc.train_one_file(file[1], my_cft, is_healthy=False, new_day=True, obs_to_add=0, with_RL=True, train_mod_chan=False, on_stim=False, autosave=False) cProfile.runctx('my_bsc.train_one_file(file[1], my_cft, is_healthy=False, new_day=True, obs_to_add=0, with_RL=True, train_mod_chan=False, on_stim=False, autosave=False)', globals(), locals(), "Profile.prof") s = pstats.Stats("Profile.prof") s.strip_dirs().sort_stats("time").print_stats() print 'END'
def change_chan_group_by(self, nb_chan, group_by): self.my_cft = cpp_file_tools(nb_chan, group_by, self.ext_img, self.save_img, self.show, ion=False)